4 thoughts on “Splines in Stan; Spatial Models in Stan !

  1. As a spatial statistician, this puts me one step closer to using Stan in my MS-level Bayes course, so kudos to you! (The bigger step for is me deciding whether or not I want to teach Gibbs/Metropolis and then go to software that doesn’t use Gibbs/Metropolis, but that’s my problem not yours…)

    One minor comment: In the ICAR section of Mitzi’s write-up, the joint distribution is not a normal distribution (due to D-W being singular, as you point out a few lines later), and the pairwise difference formulation is off slightly — in particular, the “1/tau^{n/2}” piece outside of the exponent should have “(n-1)/2” if you only have one “spatial island” or, more generally, “(n-I)/2” if you have I spatial islands. Similarly, if you have I spatial islands, you need to have I sum-to-zero constraints (e.g., one for the contiguous US, one for Alaska, and one for Hawaii). Jim Hodges has a 2003 paper related to this in Biometrics (“On the precision of the conditionally autoregressive prior in spatial models”).

  2. On the splines example, the math near the end shows a_1 ~ N(0,tau) and a_i ~ N(a_i-1,tau) . I dont think this is right, as it seems to assume the same variance should be used for the starting value of the spline as well as the first derivative. Also, if we are interested in smoothing, I would be tempted to smooth the second derivative rather than the first (ie curvature rather than slope), but maybe it is an empirical question as to which is more appropriate. Finally, it would be useful to link this to the established literature on p-splines (ie penalized B-splines), as it seems that is what is going on here. These are all just suggestions (and may well be wrong) — thanks for the great case study!

    PS — sorry to put the comment here, there doesnt appear to be a comment or contact link on the case studies themselves. Maybe this would be useful?

Leave a Reply to Gregor Gorjanc Cancel reply

Your email address will not be published. Required fields are marked *