Prediction with rstanarm differs from prediction with stan


Hi All,

I am comparing the posterior predictions for a simple non-linear regression problem $k= \exp(a+b/T) $, between stan and rstanarm/glm.

The prediction with rstanarm/glm is surprisingly noisy in lower part of the control variable range (see image below).

This looks like a numerical problem, but I do not know how to investigate…


Red dots are the calibration data; orange bars depict prediction 95% CI by combination of variances from the posterior.

The source code:

testArrhenius.R (2.5 KB)

Operating System: debian 9.3
Interface Version: 2.17.2


I think you are using a different prior on the standard deviation of the errors.


Thanks Ben,

I reduced the scale of the normal prior to 1e-8 so that
the value of sigma is practically fixed. The error persists…

Now, I generated curves from the posterior sample of stan_glm,
as I do for stan. They are identical to the ones generated from
the stan posterior (orchid color).


The problem lies therefore in the posterior_predict() function,
or the way I interpret it…


what exactly are u simulating from the posterior with the Stan model?

The posterior_predict function from rstanarm will give you predictions of observations and as such include the residual error term.


I am just propagating the parameters uncertainty.

Now, I see why the posterior_predict() levels off around 1e-5

Thanks !