# 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:
SS_2F_filtered <- NFCP_Kalman_filter(parameter_values = SS_oil$two_factor,
parameter_names = names(SS_oil$two_factor),
log_futures = log(SS_oil$stitched_futures),
dt = SS_oil$dt,
futures_TTM = SS_oil$stitched_TTM,
verbose = TRUE)
## Step 2 - Probabilistic forecast of the risk-neutral two-factor
## stochastic differential equation (SDE):
futures_price_forecast(x_0 = SS_2F_filtered$x_t,
parameters = SS_oil$two_factor,
t = 0,
futures_TTM = seq(0,9,1/12),
percentiles = c(0.1, 0.9))
# }
Run the code above in your browser using DataLab