Skip to contents

Generate the Pulse Treatment Effect (PTE) for a given autoregressive distributed lag (ADL) model

Usage

pte.calculator(x.vrbl, y.vrbl, limit)

Arguments

x.vrbl

a named vector of the x variables and corresponding lag orders in an ADL model

y.vrbl

a named vector of the (lagged) y variables and corresponding lag orders in an ADL model

limit

an integer for the number of periods to determine the PTE (beginning at 0)

Value

a list of limit + 1 mpoly formulae containing the PTE in each period

Details

pte.calculator does no calculation. It generates a list of mpoly formulae that contain variable names that represent the PTE in each period. The expectation is that these will be evaluated using coefficients from an object containing an ADL model with corresponding variables. It is used as a subfunction in both ts.ci.adl.plot and ts.ci.gecm.plot. Note: mpoly does not allow variable names with a .; variables passed to GDTE.calculator should not include this character

Author

Soren Jordan, Garrett N. Vande Kamp, and Reshi Rajan

Examples

# ADL(1,1)
x.lags <- c("x" = 0, "l_1_x" = 1) # lags of x
y.lags <- c("l_1_y" = 1)
h <- 5
PTEs <- pte.calculator(x.vrbl = x.lags, y.vrbl = y.lags, limit = h)
PTEs
#> [[1]]
#> x 
#> 
#> [[2]]
#> l_1_x  +  l_1_y x 
#> 
#> [[3]]
#> l_1_y l_1_x  +  l_1_y^2 x 
#> 
#> [[4]]
#> l_1_y^2 l_1_x  +  l_1_y^3 x 
#> 
#> [[5]]
#> l_1_y^3 l_1_x  +  l_1_y^4 x 
#> 
#> [[6]]
#> l_1_y^4 l_1_x  +  l_1_y^5 x 
#>