updateForecast: Update Analysis of Forecast Errors

Description Usage Arguments Details Value Examples

View source: R/updateForecast.R

Description

This function updates the analysis in a cptFor object with new forecast errors. This allows for the online implementation of the method as new forecast errors become available.

Usage

1
updateForecast(newErrors, model)

Arguments

newErrors

numeric vector. New Forecast errors to perform changepoint analysis upon.

model

cptFor object. Output of call to function cptForecast where initial forecast errors were analysed.

Details

This function can be embedded within a framework to allow for the sequential analysis of forecast errors as new data becomes available. Say you receive a new forecast error each day then this function can be used to update the analysis and then a flag can be created to signal when a changepoint has been detected by monitoring the tau and tau2 slots.

Value

An object of class cptFor

Examples

1
2
3
4
ans = cptForecast(stats::rnorm(500), m=300)
ans = updateForecast(stats::rnorm(10, 3), model=ans)
summary(ans)
plot(ans)

grundy95/changepoint.forecast documentation built on Dec. 20, 2021, 1:45 p.m.