The solarModel class combines seasonal components, bounded transformations, ARMA-GARCH dynamics, and monthly Gaussian mixture residual models for solar radiation data.

Value

An R6 object of class solarModel.

Details

The class stores a solarModel_spec object and fitted data summaries. Most public methods update the object state in place and are intended for the package fitting workflow.

Note

Version 1.0.4

Public fields

interpolated

Logical values, when TRUE the time-series and the parameters are interpolated.

Active bindings

data

A data frame with fitted data, seasonal quantities, and monthly parameters.

seasonal_data

A data frame containing seasonal and monthly summaries.

monthly_data

A data frame containing monthly parameters.

loglik

The log-likelihood computed on train data.

spec

A solarModel_spec object that controls the model fitting process.

moments

Get a list containing the conditional moments.

coefficients

Get the model parameters as a named list.

Methods


Method new()

Initialize a solarModel

Usage

solarModel$new(spec)

Arguments

spec

An object of class solarModel_spec. See solarModel_spec.

Returns

Initializes object state during construction.


Method fit()

Initialize and fit a solarModel object given the specification contained in $control.

Usage

solarModel$fit()

Returns

Updates the object state. The return value is not intended for use.


Method fit_seasonal_model_Ct()

Initialize and fit a seasonalClearsky model given the specification contained in $control.

Usage

solarModel$fit_seasonal_model_Ct()

Returns

Updates the clear-sky model and fitted data stored in the object.


Method compute_risk_drivers()

Compute the risk drivers and impute the observation that are greater or equal to the clear sky level.

Usage

solarModel$compute_risk_drivers()

Returns

Updates fitted data and outlier information stored in the object.


Method fit_transform()

Fit the parameters of the solarTransform object.

Usage

solarModel$fit_transform(detect_outliers = TRUE)

Arguments

detect_outliers

Logical. If TRUE, transformation-bound outliers are detected.

Returns

Updates transformation parameters and transformed data stored in the object.


Method fit_seasonal_mean()

Fit a seasonalModel the transformed variable (Yt) and compute deseasonalized series (Yt_tilde).

Usage

solarModel$fit_seasonal_mean()

Returns

Updates fitted seasonal mean quantities stored in the object.


Method fit_monthly_mean()

Correct the deseasonalized series (Yt_tilde) by subtracting its monthly mean (Yt_tilde_uncond).

Usage

solarModel$fit_monthly_mean()

Returns

Updates monthly mean corrections when enabled.


Method fit_mean_model()

Fit an ARMA model (Yt_tilde) and compute the residuals (eps).

Usage

solarModel$fit_mean_model()

Returns

Updates ARMA fitted values and residuals stored in the object.


Method fit_seasonal_variance()

Fit a seasonalModel on AR squared residuals (eps) and compute deseasonalized residuals eps_tilde.

Usage

solarModel$fit_seasonal_variance()

Returns

Updates seasonal variance quantities stored in the object.


Method fit_monthly_variance()

Correct the standardized series (eps_tilde) by subtracting its monthly mean (sigma_uncond).

Usage

solarModel$fit_monthly_variance()

Returns

Updates monthly variance corrections when enabled.


Method correct_seasonal_variance()

Correct the parameters of the seasonal variance to ensure a unitary variance

Usage

solarModel$correct_seasonal_variance()

Returns

Updates seasonal variance parameters when correction is enabled.


Method fit_variance_model()

Fit a GARCH model on the deseasonalized residuals (eps_tilde). Compute the standardized (u) and monthly deseasonalized residuals (u_tilde).

Usage

solarModel$fit_variance_model()

Returns

Updates GARCH variance and standardized residuals stored in the object.


Method fit_mixture_model()

Initialize and fit a solarMixture object.

Usage

solarModel$fit_mixture_model()

Returns

Updates the monthly Gaussian mixture model stored in the object specification.


Method update()

Update the parameters inside object

Usage

solarModel$update(params)

Arguments

params

List of parameters. See the slot $coefficients for a template.

Returns

Updates model parameters and resets the stored log-likelihood.


Method update_moments()

Update the moments inside object

Usage

solarModel$update_moments()

Returns

Updates the stored conditional moments.


Method update_logLik()

Update the log-likelihood inside object

Usage

solarModel$update_logLik()

Returns

Updates observation-level and total log-likelihood values.


Method update_risk_drivers()

Update the clear sky and risk drivers

Usage

solarModel$update_risk_drivers()

Returns

Updates clear-sky values, risk drivers, and transformed data.


Method update_classification()

Update the classification of the Bernoulli random variable.

Usage

solarModel$update_classification(filter = FALSE)

Arguments

filter

Logical. If TRUE, the mixture model is filtered before classification.

Returns

Updates mixture classification columns stored in fitted data.


Method filter()

Filter the time series when new parameters are supplied in the method $update(params).

Usage

solarModel$filter(fit = FALSE)

Arguments

fit

Logical. If TRUE, monthly mean and variance corrections are recomputed.

Returns

Updates the stored data summaries. The return value is not intended for use.


Method logLik()

Compute the log-likelihood of the model and update the slot $loglik.

Usage

solarModel$logLik(moments, target = "Yt", quasi = FALSE)

Arguments

moments

Dataset containing the moments to use for computation.

target

Character. Target variable to use, either "Yt" or "GHI".

quasi

Logical. If TRUE, compute the Gaussian quasi log-likelihood.

Returns

A numeric vector of observation-level log-likelihood values.


Method print()

Print method for solarModel class.

Usage

solarModel$print()

Returns

Prints a summary of the object.


Method clone()

The objects of this class are cloneable with this method.

Usage

solarModel$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

spec <- solarModel_spec$new()
spec$specification("Bologna", max_date = "2005-01-10")
#> No outliers!
model <- solarModel$new(spec)

if (interactive()) {
  model$fit()
  model$loglik
}