CPM.Parameters: Specify parameters of N-factor model

Description Usage Arguments Details Value References Examples

View source: R/KF-dependencies.R

Description

\loadmathjax

the CPM.Parameters function specifies the parameters of a commodity pricing model under the N-factor framework first described by Cortazar and Naranjo (2006). This function is a recommended starting position for the application of N-factor models within the NFCPM package.

Usage

1
2
3
4
5
6
7
8
CPM.Parameters(
  N.factors,
  GBM,
  Initial.State,
  S.Constant,
  N.contracts = NULL,
  verbose = TRUE
)

Arguments

N.factors

numeric. Number of state variables in the spot price process.

GBM

logical. If GBM = T, factor 1 of the model is assumed to follow a Brownian Motion, inducing a unit-root in the spot price process.

Initial.State

logical. If Initial.State = T, the initial state vector is specified as unknown parameters of the commodity pricing model.

S.Constant

logical. If S.Constant = T, the white noise of observable contracts are assumed and identical (and independent).

N.contracts

numeric. The number of individual observation white noise terms when S.Constant = F. Optional when S.Constant = T. When N.contracts = 0, the value of CPM.Parameters returns a vector without any "sigma.contract" or "sigma.contracts" elements.

verbose

logical. If verbose = T, the specified N-factor model is printed when the function is called.

Details

The N-factor model The N-factor model was first presented in the work of Cortazar and Naranjo (2006, equations 1-3). The N-factor framework describes the spot price process of a commodity as the correlated sum of \mjeqnNN state variables \mjeqnx_tx[t].

When GBM = TRUE: \mjdeqnlog(S_t) = \sum_i=1^N x_i,tlog(S[t]) = sum_i=1^n x[i,t] When GBM = FALSE: \mjdeqnlog(S_t) = E + \sum_i=1^N x_i,tlog(S[t]) = E + sum_i=1^n x[i,t]

Additional factors within the spot-price process are designed to result in additional flexibility, and possibly fit to the observable term structure, in the spot price process of a commodity. The fit of different N-factor models, represented by the log-likelihood can be directly compared with statistical testing possible through a chi-squared test.

Flexibility in the spot price under the N-factor framework allows the first factor to follow a Brownian Motion or Ornstein-Uhlenbeck process to induce a unit root. In general, an N-factor model where GBM = T allows for non-reversible behaviour within the price of a commodity, whilst GBM = F assumes that there is a long-run equilibrium that the commodity price will revert to in the long-term.

State variables are thus assumed to follow the following processes:

When GBM = TRUE: \mjdeqndx_1,t = \mu^*dt + \sigma_1 dw_1tdx[1,t] = mu^* dt + sigma[1] dw[1]t

When GBM = FALSE: \mjdeqndx_1,t = - (\lambda_1 + \kappa_1x_1,t)dt + \sigma_1 dw_1tdx[1,t] = - (lambda[1] + kappa[1] x[1,t]) dt + sigma[1] dw[t]t

And: \mjdeqndx_i,t =_i\neq 1 - (\lambda_i + \kappa_ix_i,t)dt + \sigma_i dw_itdx[i,t] =_(i != 1) - (lambda[i] + kappa[i] x[i,t]dt + sigma[i] dw[i]t)

where: \mjdeqnE(w_i)E(w_j) = \rho_i,jE(w[i])E(w[j])

The following constant parameters are defined as:

var \mjeqn\mumu: long-term growth rate of the Brownian Motion process.

var \mjeqnEE: Constant equilibrium level.

var \mjeqn\mu^*=\mu-\lambda_1mu^* = mu-lambda[1]: Long-term risk-neutral growth rate

var \mjeqn\lambda_ilambda[i]: Risk premium of state variable \mjeqnii.

var \mjeqn\kappa_ikappa[i]: Reversion rate of state variable \mjeqnii.

var \mjeqn\sigma_isigma[i]: Instantaneous volatility of state variable \mjeqnii.

var \mjeqn\rho_i,j \in [-1,1]rho[i,j] in [-1,1]: Instantaneous correlation between state variables \mjeqnii and \mjeqnjj.

Measurement Error:

The Kalman Filtering algorithm assumes a given measure of measurement error (ie. matrix \mjeqnHH). Measurement errors can be interpreted as error in the model's fit to observed prices, or as errors in the reporting of prices (Schwartz and Smith, 2000).

var \mjeqns_is[i] Observation error of contract \mjeqnii.

When S.Constant = T, the values of parameter \mjeqns_is[i] are assumed constant and equal to object 'sigma.contracts'. When S.Constant = F, the observation error of futures contracts \mjeqns_is[i] is equal to parameter 'sigma.contract_' [i].

When N.contracts = 0, "sigma.contract" parameters are not returned within the parameter vector.

Diffuse Assumption: If Initial.State = F, a 'diffuse' assumption is made within Kalman filtering and parameter estimation functions (See CPM.Parameter.Estimation or CPM.Kalman.filter for more information)

Value

A vector of parameter names for a specified N-factor spot price process. This vector is ideal for application within many other functions within the NFCPM package

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

1
2
3
4
5
6
7
8
##Generate parameter of a Two-factor model Crude Oil model
##as first presented by Schwartz and Smith (2000):
SS.Oil.Two.Factor.parameters <- CPM.Parameters(N.factors = 2,
                                                      GBM = TRUE,
                                                      Initial.State = FALSE,
                                                      S.Constant = FALSE,
                                                      N.contracts = 5)
print(SS.Oil.Two.Factor.parameters)

TomAspinall/TSE documentation built on Jan. 7, 2021, 7:43 p.m.