Compute the premium given the moments
solarOption_model(
model,
moments,
portfolio,
nmonths = 1:12,
lambda = 0,
implvol = 1,
put = TRUE,
control_options = control_solarOption()
)An object with the class solarModel. See the function solarModel for details.
Tibble containing the forecasted moments for different days ahead. See the function solarMoments for more details.
Optional, A list of objects of the class solarOptionPortfolio.
Numeric vector, months in which the payoff should be computed. Can vary from 1 (January) to 12 (December).
Numeric, Sugeno parameter.
Numeric, implied volatility.
Logical, when TRUE, the default, will be computed the price for a put contract, otherwise for a call contract.
Named list with control parameters. See control_solarOption for more details.
Version 1.0.0.
# Model
model = solarModel$new(spec)
model$fit()
#> No outliers!
# Pricing without portfolio
moments <- model$moments$unconditional
# Premium
premium_Vt <- solarOption_model(model, moments, put = TRUE)
#> Error in UseMethod("filter"): no applicable method for 'filter' applied to an object of class "NULL"
# Pricing date
t_now <- as.Date("2021-12-31")
# Inception date
t_init <- as.Date("2022-01-01")
# Maturity date
t_hor <- as.Date("2022-12-31")
# solar options portfolio
portfolio <- SoRadPorfolio(model, t_now, t_init, t_hor)
# Moments
moments <- purrr::map_df(portfolio, ~model$Moments(t_now, .x$t_hor))
#> Error in map(.x, .f, ...): ℹ In index: 1.
#> ℹ With name: SoRad_20220101.
#> Caused by error in `.f()`:
#> ! attempt to apply non-function
# Premium
premium_Vt <- solarOption_model(model, moments, portfolio, put = TRUE)
#> Error in map(.x, .f, ...): ℹ In index: 1.
#> ℹ With name: SoRad_20220101.
#> Caused by error in `UseMethod()`:
#> ! no applicable method for 'filter' applied to an object of class "list"
premium_Vt$payoff_year$premium
#> Error: object 'premium_Vt' not found