NFCP (version 0.1.0)

cov_func: model_covariance: (formerly cov_func)

Description

Calculate the covariance matrix of state variables for a given N-factor model parameters and discrete time step.

Usage

cov_func(parameters, dt)

Arguments

parameters

a named vector of parameters of an N-factor model. Function NFCP.Parameters is recommended.

dt

a discrete time step

Value

A matrix object with dimensions N NN X N, where \(N\) is the number of factors of the specified N-factor model.

Details

The primary purpose of the model_covariance function is to be called within other functions of the NFCP package. The covariance of an N-factor model is given by:

cov_1,1(x_1,t,x_1,t) = _1^2tcov[1,1](x[1,t],x[1,t]) = sigma[1]^2 * t cov_i,j(x_i,t,x_j,t) = _i_j_i,j1-e^-(_i+_j)t_i+_jcov[i,j](x[i,t],x[j,t]) = sigma[i] sigma[j] rho[i,j] (1-e^(-(kappa[i]+kappa[j])t ) / (kappa[i] + kappa[j])

References

Schwartz, E. S., and J. E. Smith, (2000). Short-Term Variations and Long-Term Dynamics in Commodity Prices. Manage. Sci., 46, 893-911.

Cortazar, G., and L. Naranjo, (2006). An N-factor Gaussian model of oil futures prices. Journal of Futures Markets: Futures, Options, and Other Derivative Products, 26(3), 243-268.

Examples

Run this code
# NOT RUN {
#Calculate the covariance matrix of a two-factor model over one discrete (weekly) time step:
SS.Oil.covariance <- cov_func(SS.Oil$Two.Factor, SS.Oil$dt)
# }

Run the code above in your browser using DataCamp Workspace