# NOT RUN {
# Forecast futures prices of the Schwartz and Smith (2000) two-factor oil model:
## Step 1 - Run the Kalman filter for the two-factor oil model:
Schwartz.Smith.Oil = NFCP.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)
## Step 2 - Probabilistic forecast of the risk-neutral two-factor
## stochastic differential equation (SDE):
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))
# }
Run the code above in your browser using DataLab