Spot.Price.Forecast: Spot.Price.Forecast

Description Usage Arguments Details Value References Examples

View source: R/Simulations.R

Description

Analytically forecast expected spot prices following the "true" process of a given n-factor stochastic model

Usage

1
Spot.Price.Forecast(X.0, parameters, t, Percentiles = NULL)

Arguments

X.0

Initial values of the state vector.

parameters

A named vector of parameter values of a specified N-factor model. Function CPM.Parameters is recommended.

t

a vector of discrete time points to forecast

Percentiles

Optional. A vector of percentiles to include probabilistic forecasting intervals.

Details

Future expected spot prices under the N-factor model can be forecasted through the analytic expression of expected future prices under the "true" N-factor process.

Given that the log of the spot price is equal to the sum of the state variables (equation 1), the spot price is log-normally distributed with the expected prices given by:

\loadmathjax \mjdeqn

E[S_t] = exp(E[ln(S_t)] + \frac12Var[ln(S_t)])exp(E[ln(S[t])] + 1/2 Var[ln(S[t])]) Where: \mjdeqnE[ln(S_t)] = \sum_i=1^Ne^-(\kappa_it)x_i(0) + \mu tE[ln(S[t])] = sum_i=1^N (e^(-(kappa[i] t)) x[i,0] + mu * t)

Where \mjeqn\kappa_i = 0kappa[i] = 0 when GBM=T and \mjeqn\mu = 0mu = 0 when GBM = F

\mjdeqn

Var[ln(S_t)] = \sigma_1^2t + \sum_i.j\neq1\sigma_i\sigma_j\rho_i,j\frac1-e^-(\kappa_i+\kappa_j)t\kappa_i+\kappa_j Var[ln(S[t])] = sigma[1]^2 * t + sum_i.j != 1 (sigma[i] sigma[j] rho[i,j] (1 - e^(-(kappa[i] + kappa[j])t)) / (kappa[i] + kappa[j]) )

and thus:

\mjdeqn

E[S_t] = exp(\sum_i=1^N e^-\kappa_itx_i(0) + (\mu + \frac12\sigma_1^2)t + \frac12\sum_i.j\neq1 \sigma_i\sigma_j\rho_i,j\frac1-e^-(\kappa_i+\kappa_j)t\kappa_i+\kappa_j) E[S[t]] = exp( sum_i=1^N e^(-kappa[i] t) x[i,0] + (mu + 1/2 sigma[1]^2)t + 1/2 (sum_i.j != 1( sigma[i] sigma[j] rho[i,j] (1 - e^(-(kappa[i] + kappa[j])t)) / (kappa[i] + kappa[j]))) )

Under the assumption that the first factor follows a Brownian Motion, in the long-run expected spot prices grow over time at a constant rate of \mjeqn\mu + \frac12\sigma_1^2mu + 1/2 sigma[1] as the \mjeqne^-\kappa_ite^(-kappa[i] * t) and \mjeqne^-(\kappa_i + \kappa_j)te^(-(kappa[i] + kappa[j])) terms approach zero.

An important consideration when forecasting spot prices using parameters estimated through maximum likelihood estimation is that the parameter estimation process takes the assumption of risk-neutrality and thus the true process growth rate \mjeqn\mumu is not estimated with a high level of precision. This can be shown from the higher standard error for \mjeqn\mumu than other estimated parameters, such as the risk-neutral growth rate \mjeqn\mu^*mu^*. See Schwartz and Smith (2000) for more details.

Value

Spot.Price.Forecast returns a vector of expected future spot prices under a given N-factor model at specified discrete future time points. When percentiles are specified, the function returns a matrix with the corresponding confidence bands in each column of the matrix.

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
 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
39
40
41
##Example 1: Forecast the Schwartz-Smith (2000) Two-Factor Oil Model:

##Step 1 - Run the Kalman Filter for the Two-Factor Oili Model:
Schwartz.Smith.Oil <- CPM.Kalman.filter(SS.Oil$Two.Factor,
                                      names(SS.Oil$Two.Factor),
                                      log(SS.Oil$Stitched.Futures),
                                      SS.Oil$dt,
                                      SS.Oil$Stitched.TTM,
                                      verbose = TRUE)

##Probabilistic Forecast of N-factor Stochastic Differential Equation:
E.Spot <- Spot.Price.Forecast(X.0 = Schwartz.Smith.Oil$X.t,
                                 parameters = SS.Oil$Two.Factor,
                                 t = seq(0,9,1/12),
                                 Percentiles = c(0.1, 0.9))
##Not run - Plot results:
# matplot(seq(0,9,1/12), E.Spot, type = 'l', col = c(2,1,2), lty = c(2,1,2))

##Example 2: Replicate Figure 1 from Schwartz and Smith (2000):

##Figure 1 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)

###Replicate Schwartz and Smith (2000) Figure 1:
SS.Expected.Spot <- Spot.Price.Forecast(X.0 = c(2.857, 0.119),
                                           Enron.values,
                                           t = seq(0,9,1/12),
                                           Percentiles = c(0.1, 0.9))
##Factor one only:
Equilibrium.theta <- Enron.values[!names(Enron.values) %in%
                                 c("kappa_2", "lambda_2", "sigma_2", "rho_1_2")]
SS.Expected.Equilibrium <- Spot.Price.Forecast(X.0 = c(2.857, 0),
                                                  Equilibrium.theta,
                                                  t = seq(0,9,1/12),
                                                  Percentiles = c(0.1, 0.9))
SS.Figure.1 <- cbind(SS.Expected.Spot, SS.Expected.Equilibrium)
matplot(seq(0,9,1/12), SS.Figure.1, type = 'l', col = 1, lty = c(rep(1,3), rep(2,3)),
xlab = "Time (Years)", ylab = "Spot Price ($/bbl, WTI)",
main = "Probabilistic Forecasts for Spot and Equilibrium Prices")

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