Tag: Quantitative Finance

Coding towards CFA (34) – The Parametric Method of VaR Estimation

Coding towards CFA (34) – The Parametric Method of VaR Estimation

In the previous blog post, we explored the Historical Method of VaR Estimation. The historical method is simple and intuitive; however, it relies on the assumption that financial markets will repeat historical patterns, disregarding structural changes in market conditions. This limitation makes the historical method less practical in real-world scenarios. In this blog post, I will … Continue reading Coding towards CFA (34) – The Parametric Method of VaR Estimation

Coding towards CFA (33) – VaR Overview and the Historical Method

Coding towards CFA (33) – VaR Overview and the Historical Method

Value at Risk (VaR) is arguably the most widely used metric for risk management. It quantifies the potential loss in the value of a portfolio over a certain period. In this blog post, I will first provide an overview of VaR, clarifying its definition and discussing its advantages and disadvantages. Then, I will implement Python code … Continue reading Coding towards CFA (33) – VaR Overview and the Historical Method

Coding towards CFA (31) – Credit Transition Matrix and Credit Migration Analysis

Coding towards CFA (31) – Credit Transition Matrix and Credit Migration Analysis

Credit Migration Analysis with Credit Transition Matrix is discussed in the CFA Fixed Income, Module 4, Section 3, "Credit Scores and Credit Ratings". Credit migration refers to changes in the credit rating of a bond issuer, which can impact the value and expected returns of an investment. A Credit Transition Matrix is a tool used … Continue reading Coding towards CFA (31) – Credit Transition Matrix and Credit Migration Analysis

Coding towards CFA (30) – Calculating CVA (Credit Valuation Adjustment)

Coding towards CFA (30) – Calculating CVA (Credit Valuation Adjustment)

Credit Valuation Adjustment (CVA) is the present value of the potential credit risk associated with an investment that carries counterparty risk. The CFA curriculum, Fixed Income, Module 4, Section 2, presents the detailed steps for calculating CVA. In this blog post, I will replicate these steps using Python. Below is a diagram I created to … Continue reading Coding towards CFA (30) – Calculating CVA (Credit Valuation Adjustment)

Coding towards CFA (29) – Pricing Credit Default Swap with QuantLib

Coding towards CFA (29) – Pricing Credit Default Swap with QuantLib

In the previous blog, I manually crafted the Python code for pricing CDS without relying on third-party quant libraries. While this approach was useful for understanding the underlying algorithm, in practice, it's preferable to use a mature, validated library for standardisation when available. In this blog post, I will revisit the CDS pricing exercise using … Continue reading Coding towards CFA (29) – Pricing Credit Default Swap with QuantLib

Coding towards CFA (28) – Pricing Credit Default Swaps

Coding towards CFA (28) – Pricing Credit Default Swaps

Some Basics of Credit Default Swap (CDS) A Credit Default Swap is a credit derivative instrument that functions as a form of insurance, where one party pays a series of premiums to another party in exchange for protection against the risk of default by the issuer of the underlying debt. Parties Involved: Protection Buyer - Owns … Continue reading Coding towards CFA (28) – Pricing Credit Default Swaps

Coding towards CFA (27) – Pricing Capped and Floored Floating-Rate Bonds with QuantLib

Coding towards CFA (27) – Pricing Capped and Floored Floating-Rate Bonds with QuantLib

The concept of "capped and floored floating-rate bonds" is covered in Section 9, Module 3 of the CFA Fixed Income curriculum. Compared to fixed-rate bonds, floating-rate bonds have distinct features that make their valuation and pricing more complex. In this blog post, I will begin by discussing the key features of floating-rate bonds and then … Continue reading Coding towards CFA (27) – Pricing Capped and Floored Floating-Rate Bonds with QuantLib

Coding towards CFA (26) – Effect of Interest Rate and Volatility

Coding towards CFA (26) – Effect of Interest Rate and Volatility

In CFA Fixed Income curriculum, module 3, section 3, "Effect of Interest Rate Volatility", the impact of interest rate volatility on the value of callable and putable bonds is explored. In this blog post, I will replicate the examples from the CFA curriculum using Python code, leveraging the QuantLib library for bond valuations, including: Effect … Continue reading Coding towards CFA (26) – Effect of Interest Rate and Volatility

Coding towards CFA (25) – Pricing Callable and Putable Bonds with QuantLib

Coding towards CFA (25) – Pricing Callable and Putable Bonds with QuantLib

The valuation and analysis of bonds with embedded options is the most focused topic discussed in the CFA Level 2 Fixed Income curriculum. These types of bonds, such as callable and puttable bonds, introduce an additional layer of complexity due to the optionality features embedded within the instrument. In this blog post, I will discuss … Continue reading Coding towards CFA (25) – Pricing Callable and Putable Bonds with QuantLib

Coding towards CFA (24) – Calculate Key Rate Duration

Coding towards CFA (24) – Calculate Key Rate Duration

The concept of Key Rate Duration is discussed in the CFA, Fixed Income, module 1, section 8, "The Maturity Structure of Yield Curve Volatilities" and module 3, section 7, "One-Sided and Key Duration". In the real world, the yield curve does not always shift in parallel. Instead, different maturities may experience varying changes in interest … Continue reading Coding towards CFA (24) – Calculate Key Rate Duration