I have a relatively simple problem - an assumed mean and variance for a normally distributed variable, followed by a few data observations (just outcomes, no predictors). I’d like to use the data to update my estimates of the mean and standard deviation of that mean using rstanarm.
In general, if you want to deal with the output rather than the summary, you should do
params <- as.data.frame(m) # or as.matrix()
Now, the draws of sigma (and any other parameters) are in a column of params and you can do whatever you want with them, including
mad(params$sigma)
In principle, that should work but perhaps the code is not general enough to handle that case. You can append your new data point to your old data points and run stan_glm from there.
Thank you. Regarding question, in this case I don’t have any prior data points - just prior summaries (mu, sigma). Is this possible? Take just a N(mu, sigma) prior and update it for a single new data point?
Warning messages:
1: There were 194 divergent transitions after warmup. Increasing adapt_delta above 0.97 may help. See Runtime warnings and convergence problems
2: Examine the pairs() plot to diagnose sampling problems
3: The largest R-hat is 1.15, indicating chains have not mixed.
Running the chains for more iterations may help. See Runtime warnings and convergence problems
4: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See Runtime warnings and convergence problems
5: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
Running the chains for more iterations may help. See Runtime warnings and convergence problems
In case of future interest concerning this issue, it isn’t limited to the situation of only a single datapoint. The same error occurs if you have multiple datapoints that are equal, like: