Two case studies:

Splines in Stan, by Milad Kharratzadeh.

Spatial Models in Stan: Intrinsic Auto-Regressive Models for Areal Data, by Mitzi Morris.

This is great. Thanks, Mitzi! Thanks, Milad!

Posted by Andrew on 10 October 2017, 3:23 pm

Two case studies:

Splines in Stan, by Milad Kharratzadeh.

Spatial Models in Stan: Intrinsic Auto-Regressive Models for Areal Data, by Mitzi Morris.

This is great. Thanks, Mitzi! Thanks, Milad!

## Recent Comments

- Martha (Smith) on The challenge of fitting “good advice” into a coherent course on statistics
- Martha (Smith) on The challenge of fitting “good advice” into a coherent course on statistics
- jim on The challenge of fitting “good advice” into a coherent course on statistics
- Daniel Lakeland on The challenge of fitting “good advice” into a coherent course on statistics
- John Williams on The challenge of fitting “good advice” into a coherent course on statistics
- John Maindonald on Several reviews of Deborah Mayo’s new book, Statistical Inference as Severe Testing: How to Get Beyond the Statistics Wars
- Daniel Lakeland on The challenge of fitting “good advice” into a coherent course on statistics
- Daniel Lakeland on The challenge of fitting “good advice” into a coherent course on statistics
- Martha (Smith) on The challenge of fitting “good advice” into a coherent course on statistics
- Ben on The challenge of fitting “good advice” into a coherent course on statistics
- Ben on The challenge of fitting “good advice” into a coherent course on statistics
- AlexGamma on The challenge of fitting “good advice” into a coherent course on statistics
- Daniel Lakeland on The challenge of fitting “good advice” into a coherent course on statistics
- Michael Nelson on The challenge of fitting “good advice” into a coherent course on statistics
- Brent Hutto on Low rate of positive coronavirus tests
- Steve on The challenge of fitting “good advice” into a coherent course on statistics
- Peter Dorman on The challenge of fitting “good advice” into a coherent course on statistics
- Kyle C on The challenge of fitting “good advice” into a coherent course on statistics
- Adede on The challenge of fitting “good advice” into a coherent course on statistics
- AllanC on The challenge of fitting “good advice” into a coherent course on statistics

## Categories

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”).

thank you for noticing that! and thanks for pointer to the Hodges paper which is admirably clear – available at: https://pdfs.semanticscholar.org/db52/43bcee9b8148695167460a51e513a27df368.pdf

There is a neat proposal on how to treat disconnected graphs in Freni-Sterrantino et al. (2017) on ArXiv: “A note on intrinsic Conditional Autoregressive models for disconnected graphs” https://arxiv.org/pdf/1705.04854.pdf

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?