cptFor-class: S4 class for a forecast changepoint object

Description Value Slots Examples

Description

An S4 class that contains the results of the analysis of sequential changepoint detection.

Note with many of the slots a postfix 2 indicates it is related to the analysis on the squared forecast errors. For example tau2 is the changepoint location using the squared forecast errors.

Value

An object of class cptFor.

Slots

errors

numeric vector. Forecast errors, one-step-ahead

m

numeric. Length of training data

detector

character. Type of changepoint detector to use. Choice of

  • "PageCUSUM": Page's CUSUM detector for 2-sided alternative hypothesis

  • "PageCUSUM1": Page's CUSUM detector for 1-sided alternative hypothesis

  • "CUSUM": Original CUSUM detector for 2-sided alternative hypothesis

  • "CUSUM1": Original CUSUM detector for 1-sided alternative hypothesis

forecastErrorType

character. Type of changes to look for. Choice of

  • "Both": Analysis is performed on both the raw and squared forecast errors,

  • "Raw": Analysis is only performed on the raw forecast errors. Only first order changes are reliably detected.

  • "Squared:" Analysis is only performed on the centred squared forecast errors.

gamma

numeric. Tuning parameter within detector

errorsVar

numeric. Variance of forecast errors in training data

errors2Var

numeric. Variance of squares of forecast errors

cusum

numeric. CUSUM values of forecast errors

cusum2

numeric. CUSUM values of squares of forecast errors

alpha

numeric. Type-1 error

critValue

numeric. Critical value used in the threshold to maintain type-1 error rate

threshold

numeric. threshold values for CUSUM values of forecast errors

threshold2

numeric. threshold values for CUSUM values of squares of forecast errors

tau

numeric. Time point when changepoint is flagged based upon forecast errors

tau2

numeric. Time point when changepoint is flagged based upon squares of forecast errors

updateStats

numeric vector. Update statistics needed for use with updateForecast

updateStats2

numeric vector. Update statistics needed for use with updateForecast

version

character. Version of changepoint.forecast version

date

character. Date object was created/updated

Examples

1
2
3
4
ans = cptForecast(c(stats::rnorm(400), stats::rnorm(100,3)), m=300)
summary(ans)
show(ans)
plot(ans)

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