# NOT RUN {
# 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)
# }
Run the code above in your browser using DataLab