Compute the generic conditional moments of a solarModel object

solarMoments(
  t_now,
  t_hor,
  data,
  ARMA,
  GARCH,
  NM_model,
  transform,
  theta = 0,
  quiet = FALSE
)

Arguments

t_now

Date for today.

t_hor

Horizon date.

data

Slot data of a solarModel object. See the function solarModel for details.

ARMA

Slot ARMA of a solarModel object.

GARCH

Slot GARCH of a solarModel object.

NM_model

Slot NM_model of a solarModel object.

transform

Slot transform of a solarModel object.

theta

Numeric, vector of shift parameters for the Gaussian mixture residuals.

Details

Version 1.0.0.

Examples

model = solarModel$new(spec)
model$fit()
#> No outliers!
t_now = "2019-07-11"
t_hor = "2019-10-19"
data = model$data
ARMA = model$ARMA
GARCH  = model$GARCH
NM_model = model$NM_model
transform = model$transform
theta = 0
solarMoments(t_now, t_hor, data, ARMA, GARCH, NM_model, transform, theta = 0, quiet = FALSE)
#>  Forecast: 2019-10-19 given 2019-07-11
#> Warning: no non-missing arguments to max; returning -Inf
#> Error in 1:lag_max: result would be too long a vector
filter(model$moments$conditional, date == t_hor)
#> # A tibble: 1 × 16
#>   date        Year Month   Day   e_Yt sd_Yt   M_Y1  S_Y1  M_Y0  S_Y0 theta    p1
#>   <date>     <dbl> <dbl> <int>  <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 2019-10-19  2019    10    19 0.0181 0.806 -0.734 0.932 0.404 0.388     0 0.399
#> # ℹ 4 more variables: GHI_bar <dbl>, Ct <dbl>, alpha <dbl>, beta <dbl>
filter(model$moments$unconditional, date == t_hor)
#> Error in UseMethod("filter"): no applicable method for 'filter' applied to an object of class "NULL"

t_seq <- seq.Date(as.Date("2013-01-01"), as.Date("2013-12-31"), 1)
mom <- purrr::map_df(t_seq, ~solarr::solarMoments(.x-150, .x, data, ARMA, GARCH, NM_model, transform, theta = 0, quiet = FALSE))
#>  Forecast: 2013-01-01 given 2012-08-04
#> Warning: no non-missing arguments to max; returning -Inf
#> Error in map(.x, .f, ...):  In index: 1.
#> Caused by error in `1:lag_max`:
#> ! result would be too long a vector
solarOption_model(model, mom, control_options = control_solarOption(nyears = c(2005, 2024)))
#> Error: object 'mom' not found
solarOption_historical(model, control_options = control_solarOption(nyears = c(2005, 2024)))
#> ------------------------ Solar Option Payoffs (put) ------------------------ 
#> Yearly payoff: 181.76
#> Monthly payoffs: 
#>   Jan: 7.55   Feb: 10.9   Mar: 15.4
#>   Apr: 21.8   May: 30.3   Jun: 22.3
#>   Jul: 13.8   Ago: 13.2   Sep: 14.1
#>   Oct: 14.1   Nov: 11.7   Dec: 6.68