Showing posts with label NelsonSiegel. Show all posts
Showing posts with label NelsonSiegel. Show all posts

R : Nelson-Siegel-Svensson (NSS) model with fixed or estimated constant decay parameters

This post implements the period-by-period estimation of the Nelson-Siegel-Svensson yield curve model with fixed or estimated constant decay parameters using R code.

Python : Nelson-Siegel or Svensson model with fixed lambda

This post implements the period-by-period OLS estimation of the Nelson-Siegel and Svensson yield curve model with fixed lambda.

R code snippet : Transform from long format to wide format

This post introduces a simple R code snippet for transforming the long format data to the wide format. We occasionally encounter the long format data such as yield curve data since it has two dimensions : maturity and time. For this end, we can use reshape() R built-in function.

Nelson-Siegel-Svensson Yield Curve model using R code

This post introduces Nelson-Siegel-Svensson (NSS) yield curve model which is an extension of Nelson-Siegel (NS) model with an additional curvature factor. It aims to fit longer term maturities well.

Understanding PCA 3 Factors of the Yield Curve using R code

This post explains how to decompose a movement of bond yields into 3 factors (level, slope, curvature) which is the work of Litterman and Scheinkman (1991). Using R functions for the principal component analysis and eigen decomposition, we can understand the contributions of these factors.

Non-linear Optimization by using constrOptim.nl R function

This post shows how to use constrOptim.nl() R function to solve non-linear optimization problem with or without equality or inequality constraints. Nelson-Siegel yield curve model is used as an target example. Its calculation time is faster than nloptr() function.

Non-linear Optimization of Nelson-Siegel model using nloptr R package

This post shows how to use nloptr R package to solve non-linear optimization problem with or without equality or inequality constraints. Nelson-Siegel yield curve model is used as an target example.

Run Excel Solver multiple times : Period-by-Period Estimations of Nelson-Siegel model

This post shows how to run an Excel solver using VBA macro multiple times. As an example, we take period by period estimations of Nelson-Siegel model.

Excel Solver using VBA macro : Nelson-Siegel yield curve fitting

This post shows how to run an Excel solver using VBA macro. If the number of optimization problems are more than two, every time we switch among these optimization problems, we have to change each settings for solver. It is tedious and may cause key-input errors. In this case, this approach is useful.