Description Usage Arguments Details Value References Examples
Analytically forecast future expected Futures prices under the risk-neutral version of a specified N-factor model.
1 | Futures.Price.Forecast(X.0, parameters, t = 0, TTM = 1:10, Percentiles = NULL)
|
X.0 |
Initial values of the state vector. |
parameters |
A named vector of parameter values of a specified N-factor model. Function |
t |
a numeric specifying the time point at which to forecast futures prices |
TTM |
a vector specifying the time to maturity of futures contracts to value. |
Percentiles |
Optional. A vector of percentiles to include probabilistic forecasting intervals. |
Under the assumption or risk-neutrality, futures prices are equal to the expected future spot price. Additionally, under deterministic interest rates, forward prices are equal to futures prices. Let \mjeqnF_T,tF[T,t] denote the market price of a futures contract at time \mjeqntt with time \mjeqnTT until maturity. let * denote the risk-neutral expectation and variance of futures prices. The following equations assume that the first factor follows a Brownian Motion.
\mjdeqnE^*[ln(F_T,t)] =\sum_i=1^Ne^-\kappa_iTx_i(0) + \mu^*t + A(T-t)E^*[ln(F[T,t])] = sum_i=1^N (e^(-kappa[i] T) x[i,0] + mu * t + A(T-t))
Where: \mjdeqnA(T-t) = \mu^*(T-t)-\sum_i=1^N - \frac1-e^-\kappa_i (T-t)\lambda_i\kappa_i+\frac12(\sigma_1^2(T-t) + \sum_i.j\neq 1 \sigma_i \sigma_j \rho_i,j \frac1-e^-(\kappa_i+\kappa_j)(T-t)\kappa_i+\kappa_j) A(T-t) = mu^* (T-t) - sum_i=1^N ( - (1 - e^(-kappa[i] (T-t))lambda[i]) / kappa[i]) + 1/2 sigma[1]^2 (T-t) + sum_i.j != 1 sigma[i] sigma[j] rho[i,j] (1 - e^(-(kappa[i] + kappa[j])(T-t))) / (kappa[i] + kappa[j]) The variance is given by: \mjdeqnVar^*[ln(F_T,t)]= \sigma_1^2t + \sum_i.j\neq1 e^-(\kappa_i + \kappa_j)(T-t)\sigma_i\sigma_j\rho_i,j\frac1-e^-(\kappa_i+\kappa_j)t\kappa_i+\kappa_j Var^*[ln(F[T,t])] = sigma[1]^2 * t + sum_i.j != 1 e^(-(kappa[i] + kappa[j])(T-t)) sigma[i] sigma[j] rho[i,j] (1 - e^(-(kappa[i] + kappa[j])t))/(kappa[i] + kappa[j])
Futures.Price.Forecast
returns a vector of expected Futures prices under a given N-factor model with specified time to maturities at time \mjeqntt. When percentiles
are specified, the function returns a matrix with the corresponding confidence bands in each column of the matrix.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ##Example - Forecast Futures Prices of the Schwartz-Smith (2000) Two-Factor Oil Model:
##Step 1 - Run the Kalman Filter for the Two-Factor Oil Model:
Schwartz.Smith.Oil = CPM.Kalman.filter(parameter.values = SS.Oil$Two.Factor,
parameters = names(SS.Oil$Two.Factor),
log.futures = log(SS.Oil$Stitched.Futures),
dt = SS.Oil$dt,
TTM = SS.Oil$Stitched.TTM,
verbose = TRUE)
##Probabilistic Forecast of the Risk-Neutral N-factor Stochastic Differential Equation:
E.Futures = Futures.Price.Forecast(X.0 = Schwartz.Smith.Oil$X.t,
parameters = SS.Oil$Two.Factor,
t = 0,
TTM = seq(0,9,1/12),
Percentiles = c(0.1, 0.9))
##Not run - Plot results:
# matplot(seq(0,9,1/12), E.Futures, type = 'l', col = c(2,1,2), lty = c(2,1,2))
###Example 2 - Replicate the forecasts within Figure 2 of Schwartz and Smith (2000):
##Figure 2 of Schwartz and Smith (2000) was developed using Enron data and an assumption that mu
##was approximately 3% p.a.:
Enron.values <- c(0.0300875, 0.0161, 0.014, 1.19, 0.115, 0.158, 0.189)
names(Enron.values) <- CPM.Parameters(2, TRUE, FALSE, FALSE, 0,FALSE)
#Forecast expected spot prices under the "True" stochastic process:
SS.Expected.Spot <- Spot.Price.Forecast(X.0 = c(2.857, 0.119),
parameters = Enron.values,
t = seq(0,9,1/12),
Percentiles = c(0.1, 0.9))
#Forecast expected futures prices under the Risk-Neutral stochastic process:
SS.Futures.Curve <- Futures.Price.Forecast(X.0 = c(2.857, 0.119),
parameters = Enron.values,
TTM = seq(0,9,1/12))
SS.Figure.2 <- cbind(SS.Expected.Spot[,2], SS.Futures.Curve)
matplot(seq(0,9,1/12), log(SS.Figure.2), type = 'l', xlab = "Time (Years)", ylab = "Log(Price)",
col = 1, main = "Futures Prices and Expected Spot Prices")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.