only setx1 appears to do anything with arima models
christophergandrud opened this issue · comments
From #305
library(Zelig)
data(seatshare)
subset <- seatshare[seatshare$country == "UNITED KINGDOM",]
s.out <- zelig(unemp ~ leftseat, data = subset, model = "arima",
order = c(2,0,1)) %>%
setx(leftseat = 0.25) %>%
setx1(leftseat = 0.75) %>%
sim()
summary(s.out)
sim x :
-----
ev
mean sd 50% 2.5% 97.5%
[1,] 91.30382 477.675 52.19226 18.83912 272.1593
pv
mean sd 50% 2.5% 97.5%
[1,] 91.31568 477.6912 52.46997 18.98119 271.0645
fd
mean sd 50% 2.5% 97.5%
[1,] 215.0737 6901.896 -14.90352 -42.87303 52.84499
sim x1 :
-----
ev
mean sd 50% 2.5% 97.5%
[1,] 91.30382 477.675 52.19226 18.83912 272.1593
pv
mean sd 50% 2.5% 97.5%
[1,] 91.31568 477.6912 52.46997 18.98119 271.0645
fd
mean sd 50% 2.5% 97.5%
[1,] 215.0737 6901.896 -14.90352 -42.87303 52.84499
-
setx
should set the baseline -
setx1
should represent a shock
Currently setx
is overwritten by setx1
summary
for sim
should show QI for each time point
I made some simple modifications to the above code such that both setx
and setx1
are run and plotted next to each other. This is the result:
So, clearly not what we want.
Now turning to look more into what simx
and simx1
are doing. In particular, does simx1
use a baseline created by simx
, which I believe is the target behaviour?
Part of our confusion may be caused by the effect size in the example not being very large. If you put in silly values for setx
(e.g. 10 in the above example) the plot is different, so clearly setx
is not completely ignored, as we see here in setx1
:
Line 138 in be652cb
Maybe rather than continuing to fumble around here it would be good if @tercer wrote up an example of exactly what is going on in this example. I feel like we haven't clearly defined what we want to achieve enough to even determine if it is already present.
(One thing that does kind of bug me is that Zelig is returning a plot of predicted values for 44 years for this example. Not sure how realistic that timeframe is for illustrating the effect of left seat share on unemployment.)
After much discussion within the Zelig team. We have decided to deprecate all time series models. It was often unclear what the desired quantities of interest are and how the current implementation aimed to achieve them.
A warning will be added to the models and they will be fully deprecated on 1 February 2018.
Implemented: 82e1e2b