Learn R Programming

tfarima (version 0.3.2)

InterventionVar: Intervention variables

Description

InterventionVar creates an intervention variable to capture the effect of an external event.

Usage

InterventionVar(Y, date, type = c("P", "S", "R"), n.ahead = 0)

Arguments

Y

an object of class ts used to determine the sample period and frequency.

date

the date of the event, c(year, month).

type

a character indicating the type of intervention variables: (P) pulse, (S) step, (R).

n.ahead

number of additional observations to extend the sample period.

Value

An intervention variable, a 'ts' object.

References

G. E. P. Box, G. C. Tiao, <U+201C>Intervention Analysis with Applications to Economic and Environmental Problems<U+201D>, Journal of the American Statistical Association, Vol. 70, No. 349. (Mar., 1975), pp. 70-79.

Examples

Run this code
# NOT RUN {
Y <- seriesJ$Y
P58 <- InterventionVar(Y, date = 58, type = "P")

# }

Run the code above in your browser using DataLab