Correlated Nelson Siegel Parameters

A simple assumption for the distribution of the nelson-siegel model is that the parameters follow a normal distribution. When viewed as a time series, this typically means that the parameters follow uncorrelated Ito Processes.

However, there is no reason a priori to think that the changes in the parameters are uncorrelated. An extension to the above model would be to silulate the parameters as Correlated Ito Processes.

Calculating the Moments

In order to specify a correlated model, one needs to specify the variances and covariances (correlations) among the parameters. (see moments).

A simple way to calculate the moments is to use the moments api. The following code converts the parameter differences to an array of numbers, and then it calculates the covariance as a matrix.

let numbers = data.map(p=>{ return [ p.level,p.slope,p.shape,p.decay ]; }); (async ()=>{ let mt = await import('/code/moments/v1.0.0/moments.mjs'); let covariance = mt.covariance(numbers); $val.set('covariance', covariance); $console.log(JSON.stringify(covariance)); })();

Calculating the Moments of the Nelson Siegel Parameters

When given a dataset representing the fitted nelson siegel parameters of a set of daily (or any period lenght) curve, a set of moments can be calculated using the moments api, which can then be used to simulate movements in the curve.

Demonstration