InterventionVar: Intervention variables

View source: R/detvar.R

InterventionVarR Documentation

Intervention variables

Description

'InterventionVar()' creates pulse, step, or ramp variables at a given date.

Usage

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

Arguments

Y

A 'ts' object used to determine start, length and frequency.

date

Either a single positive index within the sample, or a vector 'c(year, month)' for monthly series. For non-seasonal series, 'c(year)' is also accepted.

type

One of '"P"' (pulse), '"S"' (step), or '"R"' (ramp = cumulative step).

n.ahead

Integer. Extra observations to extend the sample.

Value

A 'ts' intervention variable.

References

Box, G.E.P. and Tiao, G.C. (1975) “Intervention analysis with applications to economic and environmental problems”, *JASA*, 70(349), 70–79.

Examples

# Pulse at March 1958:
P <- InterventionVar(AirPassengers, date = c(1958, 3), type = "P")
# Or by index within the extended sample (here no extension):
P2 <- InterventionVar(AirPassengers, date = 123, type = "P")


tfarima documentation built on Nov. 5, 2025, 7:43 p.m.