Create shock(s) to add to a sfcr_scenario().

sfcr_shock(variables, start, end)

Arguments

variables

A sfcr_set() with formula(e) containing the name of the variable(s) that will be shocked on the left-hand side and their new values on the right- hand side.

It is possible to add exogenous series a shock instead of constant variables. However, the length of such series must be exactly the same as the period of the shock (i.e., the difference between start and end).

start

An integer indicating the period when the shock takes place.

end

An integer indicating the period when the shock ends.

Author

João Macalós, joaomacalos@gmail.com

Examples

sfcr_shock( variables = sfcr_set(G_d ~ 30, W ~ 1.5), start = 5, end = 66)
#> $variables #> [[1]] #> G_d ~ 30 #> <environment: 0xaba7ba0> #> #> [[2]] #> W ~ 1.5 #> <environment: 0xaba7ba0> #> #> attr(,"class") #> [1] "sfcr_set" "list" #> #> $start #> [1] 5 #> #> $end #> [1] 66 #> #> attr(,"class") #> [1] "sfcr_shock" "list"
sfcr_shock( variables = sfcr_set(G_d ~ seq(30, 40, length.out=62)), start = 5, end = 66)
#> $variables #> [[1]] #> G_d ~ seq(30, 40, length.out = 62) #> <environment: 0xaba7ba0> #> #> attr(,"class") #> [1] "sfcr_set" "list" #> #> $start #> [1] 5 #> #> $end #> [1] 66 #> #> attr(,"class") #> [1] "sfcr_shock" "list"