summary.rls_fit: Print summary of an onlineforecast model fitted with RLS

summary.rls_fitR Documentation

Print summary of an onlineforecast model fitted with RLS

Description

The summary of an onlineforecast model fitted with RLS with simple stats providing a simple overview.

Usage

## S3 method for class 'rls_fit'
summary(object, scoreperiod = NA, scorefun = rmse, printit = TRUE, ...)

Arguments

object

of class rls_fit, so a fit calculated by rls_fit.

scoreperiod

logical (or index). If this scoreperiod is given, then it will be used over the one in the fit.

scorefun

The score function to be applied on each horizon.

printit

Print the result.

...

Not used.

Details

The following is printed:

* The model.

* Number of observations included in the scoreperiod.

* RLS coefficients summary statistics for the estimated coefficient time series (since observations are correlated, then usual statistics cannot be applied directly):

- mean: the sample mean of the series.

- sd: sample standard deviation of the series.

- min: minimum of the series.

- max: maximum of the series.

* Scorefunction applied for each horizon, per default the RMSE.

Value

A list of:

- scorefun.

- scoreval (value of the scorefun for each horizon).

- scoreperiod is the scoreperiod used.

Examples


# Take data
D <- subset(Dbuilding, c("2010-12-15", "2011-01-01"))
D$y <- D$heatload
D$scoreperiod <- in_range("2010-12-20", D$t)
# Define a model
model <- forecastmodel$new()
model$add_inputs(Ta = "Ta",
                 mu = "one()")
model$add_regprm("rls_prm(lambda=0.99)")
model$kseq <- 1:6
# Fit it
fit <- rls_fit(prm=c(lambda=0.99), model, D)

# Print the summary
summary(fit)
# We see:
#   - The model (output, inputs, lambda)
#   - The Ta coefficient is around -0.12 in average (for all horizons) with a standard dev. of 0.03,
#     so not varying extremely (between -0.18 and -0.027).
#   - The intercept mu is around 5.5 and varying very little.
#   - The RMSE is around 0.9 for all horizons.

# The residuals and coefficient series can be seen by
plot_ts(fit)


onlineforecast documentation built on Oct. 12, 2023, 5:15 p.m.