How to access/compute the prediction intervals printed out by apollo_prediction()?
Posted: 16 Nov 2021, 14:50
Hi David and Stephane,
I did a scenario-analysis with a simple ordered logit modle using apollo_prediction():
The 95% prediction/confidence intervals of the market shares are printed to the console but I'm rather interested in either finding a way to save them as objects or alternatively to compute them "by hand" using the output in pred$draws. Searching through your manual and academic paper I couldn't find how exactly they are computed.
The issue is that I'm applying a bootstrap-like procedure like so:
Now I'd like to not only save the point estimates at each iteration but also the prediction intervals for each j. Is there any (painless) way to do this?
Best,
Lucas
I did a scenario-analysis with a simple ordered logit modle using apollo_prediction():
Code: Select all
pred <- apollo_prediction(Model.3,apollo_probabilities,apollo_inputs,prediction_settings = list(runs=100))
The issue is that I'm applying a bootstrap-like procedure like so:
Code: Select all
MS.save <- list()
for(j in 1:500){
wt.new <- manipulate_wt(wt.original,new.wt.distribution) # randomly assigns WaitingTime intervals to the observations according to new.wt.distribution using sample()
database$WaitingTime <- wt.new
apollo_inputs <- apollo_validateInputs()
pred <- apollo_prediction(Model.3,apollo_probabilities,apollo_inputs,prediction_settings = list(runs=100))
MS.save[[j]] <- colMeans(pred$at_estimates[,3:5]) # save market shares for each j
}
Best,
Lucas