Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

NFCP_parameters

Specify parameters of N-factor model


Description

the NFCP_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 NFCP package.

Usage

NFCP_parameters(N_factors, GBM, initial_states, N_ME, 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_states

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

N_ME

numeric. The number of independent measuring errors of observable futures contracts to consider in the Kalman filter.

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 \(N\) state variables \(x_t\).

When GBM = TRUE: \[log(S_{t}) = \sum_{i=1}^N x_{i,t}\] When GBM = FALSE: \[log(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: \[dx_{1,t} = \mu^*dt + \sigma_{1} dw_{1}t\]

When GBM = FALSE: \[dx_{1,t} = - (\lambda_{1} + \kappa_{1}x_{1,t})dt + \sigma_{1} dw_{1}t\]

And: \[dx_{i,t} =_{i\neq 1} - (\lambda_{i} + \kappa_{i}x_{i,t})dt + \sigma_{i} dw_{i}t\]

where: \[E(w_{i})E(w_{j}) = \rho_{i,j}\]

The following constant parameters are defined as:

var \(\mu\): long-term growth rate of the Brownian Motion process.

var \(E\): Constant equilibrium level.

var \(\mu^*=\mu-\lambda_1\): Long-term risk-neutral growth rate

var \(\lambda_{i}\): Risk premium of state variable \(i\).

var \(\kappa_{i}\): Reversion rate of state variable \(i\).

var \(\sigma_{i}\): Instantaneous volatility of state variable \(i\).

var \(\rho_{i,j} \in [-1,1]\): Instantaneous correlation between state variables \(i\) and \(j\).

Disturbances - Measurement Error:

The Kalman filtering algorithm assumes a given measure of measurement error or disturbance in the measurement equation (ie. matrix \(H\)). 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). These disturbances are typically assumed independent.

var \(ME_i\) measurement error of contract \(i\).

where the measurement error of futures contracts \(ME_i\) is equal to 'ME_' [i] (i.e. 'ME_1', 'ME_2', ...) specified in arguments parameter_values and parameter_names.

There are three particular cases on how the measurement error of observations can be treated in the NFCP_Kalman_filter function:

Case 1: Only one ME is specified. The Kalman filter assumes that the measurement error of observations are independent and identical.

Case 2: One ME is specified for every observed futures contract. The Kalman filter assumes that the measurement error of observations are independent and unique.

Case 3: A series of ME's are specified for a given grouping of maturities of futures contracts. The Kalman filter assumes that the measurement error of observations are independent and unique to their respective time-to-maturity.

Grouping of maturities for case 3 is specified through the ME_TTM argument. This is a vector that specifies the maximum maturity to consider for each respective ME parameter argument.

in other words, ME_1 is considered for observations with TTM less than ME_TTM[1], ME_2 is considered for observations with TTM less than ME_TTM[2], ..., etc.

The first case is clearly the simplest to estimate, but can be a restrictive assumption. The second case is clearly the most difficult to estimate, but can be an infeasible assumption when considering all available futures contracts that make up the term structure of a commodity.

Case 3 thus serves to ease the restriction of case 1, and allow the user to make the modeling of measurement error as simple or complex as desired for a given set of maturities.

Diffuse Assumption: If initial_states = F, a 'diffuse' assumption is made within Kalman filtering and parameter estimation functions (See NFCP.MLE or NFCP.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 NFCP 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

##Generate parameter of a Two-factor model Crude Oil model
##as first presented by Schwartz and Smith (2000):
two_factor_parameters <- NFCP_parameters(N_factors = 2,
                                        GBM = TRUE,
                                        initial_states = FALSE,
                                        N_ME = 5)
print(two_factor_parameters)

NFCP

N-Factor Commodity Pricing Through Term Structure Estimation

v1.0.1
GPL-3
Authors
Thomas Aspinall [aut, cre] (<https://orcid.org/0000-0002-6968-1989>), Adrian Gepp [aut] (<https://orcid.org/0000-0003-1666-5501>), Geoff Harris [aut] (<https://orcid.org/0000-0003-4284-8619>), Simone Kelly [aut] (<https://orcid.org/0000-0002-6528-8557>), Colette Southam [aut] (<https://orcid.org/0000-0001-7263-2347>), Bruce Vanstone [aut] (<https://orcid.org/0000-0002-3977-2468>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.