R-INLA. Sam Clifford Su-Yun Kang Jeff Hsieh. 30 August Bayesian Research and Analysis Group 1 / 14

Similar documents
arxiv: v1 [stat.co] 16 May 2011

A short introduction to INLA and R-INLA

Beyond MCMC in fitting complex Bayesian models: The INLA method

Data are collected along transect lines, with dense data along. Spatial modelling using GMRFs. 200m. Today? Spatial modelling using GMRFs

NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET

NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET

Fast algorithms that utilise the sparsity of Q exist (c-package ( Q 1. GMRFlib) Seattle February 3, 2009

Overlapping block proposals for latent Gaussian Markov random fields

Spatial Statistics with Image Analysis. Outline. A Statistical Approach. Johan Lindström 1. Lund October 6, 2016

Spatial modelling using INLA

Bayesian SAE using Complex Survey Data Lecture 4A: Hierarchical Spatial Bayes Modeling

List of projects. FMS020F NAMS002 Statistical inference for partially observed stochastic processes, 2016

NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET. Fitting dynamic models using integrated nested Laplace approximations INLA

NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET. Animal models and Integrated Nested Laplace Approximations PREPRINT STATISTICS NO.

Integrated Non-Factorized Variational Inference

Centre for Biodiversity Dynamics, Department of Biology, NTNU, NO-7491 Trondheim, Norway,

Bayesian spatial hierarchical modeling for temperature extremes

Scaling intrinsic Gaussian Markov random field priors in spatial modelling

Performance of INLA analysing bivariate meta-regression and age-period-cohort models

Inference for latent variable models with many hyperparameters

-A wild house sparrow population case study

Computation fundamentals of discrete GMRF representations of continuous domain spatial models

The Bayesian approach to inverse problems

Analysing geoadditive regression data: a mixed model approach

Spatial point processes in the modern world an

Variational Principal Components

Summary STK 4150/9150

A general mixed model approach for spatio-temporal regression data

Aggregated cancer incidence data: spatial models

Technical Vignette 5: Understanding intrinsic Gaussian Markov random field spatial models, including intrinsic conditional autoregressive models

Bayesian Regression Linear and Logistic Regression

arxiv: v1 [stat.co] 3 Mar 2017

Multivariate Gaussian Random Fields with SPDEs

Non-Parametric Bayes

An EM algorithm for Gaussian Markov Random Fields

A tutorial in spatial and spatio-temporal models with R-INLA

Density Estimation. Seungjin Choi

Modelling and Inference for Bayesian Bivariate Animal Models using Integrated Nested Laplace Approximations

Improving posterior marginal approximations in latent Gaussian models

Lecture 13 Fundamentals of Bayesian Inference

Modelling geoadditive survival data

Nonstationary spatial process modeling Part II Paul D. Sampson --- Catherine Calder Univ of Washington --- Ohio State University

State Space Representation of Gaussian Processes

Factorization of Seperable and Patterned Covariance Matrices for Gibbs Sampling

Fast approximations for the Expected Value of Partial Perfect Information using R-INLA

The profit function system with output- and input- specific technical efficiency

Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations

LASSO-Type Penalization in the Framework of Generalized Additive Models for Location, Scale and Shape

Markov random fields. The Markov property

Machine Learning Techniques for Computer Vision

Faculty of Sciences School for Information Technology Master of Statistics

Probabilistic Graphical Models

Gaussian Process Regression Model in Spatial Logistic Regression

CSC 2541: Bayesian Methods for Machine Learning

Information geometry for bivariate distribution control

The Particle Filter. PD Dr. Rudolph Triebel Computer Vision Group. Machine Learning for Computer Vision

Gaussian Markov Random Fields: Theory and Applications

Conjugate Analysis for the Linear Model

Bayesian covariate models in extreme value analysis

Spatio-temporal modelling of daily air temperature in Catalonia

Sequential Bayesian Inference for Dynamic State Space. Model Parameters

13: Variational inference II

Spatial Statistics with Image Analysis. Lecture L08. Computer exercise 3. Lecture 8. Johan Lindström. November 25, 2016

arxiv: v4 [stat.me] 14 Sep 2015

Andrew B. Lawson 2019 BMTRY 763

ST 740: Linear Models and Multivariate Normal Inference

Automated Likelihood Based Inference for Stochastic Volatility Models using AD Model Builder. Oxford, November 24th 2008 Hans J.

Variational inference

Beyond Mean Regression

arxiv: v1 [stat.ap] 18 Apr 2011

Spacetime models in R-INLA. Elias T. Krainski

Theory of Stochastic Processes 8. Markov chain Monte Carlo

Big Data in Environmental Research

Large-scale Ordinal Collaborative Filtering

Hierarchical Nearest-Neighbor Gaussian Process Models for Large Geo-statistical Datasets

Regularization in Cox Frailty Models

On Gaussian Process Models for High-Dimensional Geostatistical Datasets

Bayes: All uncertainty is described using probability.

arxiv: v1 [stat.me] 13 May 2017

Bayesian Graphical Models for Structural Vector AutoregressiveMarch Processes 21, / 1

Metropolis-Hastings Algorithm

Chapter 4 - Fundamentals of spatial processes Lecture notes

How to solve the stochastic partial differential equation that gives a Matérn random field using the finite element method

Spatially Adaptive Smoothing Splines

GRAPH SIGNAL PROCESSING: A STATISTICAL VIEWPOINT

STA 4273H: Statistical Machine Learning

Stat260: Bayesian Modeling and Inference Lecture Date: February 10th, Jeffreys priors. exp 1 ) p 2

Foundations of Statistical Inference

The Gaussian distribution

Modeling Real Estate Data using Quantile Regression

Gaussian Processes 1. Schedule

1 Bayesian Linear Regression (BLR)

Latent Gaussian Processes and Stochastic Partial Differential Equations

Disease mapping with Gaussian processes

The connection of dropout and Bayesian statistics

NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET. Fitting a log Gaussian Cox process with temporally varying effects a case study

Fully Bayesian Deep Gaussian Processes for Uncertainty Quantification

Nonparametric Bayesian Methods (Gaussian Processes)

Learning Multiple Tasks with a Sparse Matrix-Normal Penalty

Bayesian linear regression

Transcription:

1 / 14 R-INLA Sam Clifford Su-Yun Kang Jeff Hsieh Bayesian Research and Analysis Group 30 August 2012

What is R-INLA? R package for Bayesian computation Integrated Nested Laplace Approximation MCMC free Wrapper for GMRFlib http://www.r-inla.org Håvard Rue and Sara Martino. INLA Functions which allow to perform a full Bayesian analysis of structured additive models using Integrated Nested Laplace Approximaxion, 0.0 edition, December 2010. URL http://www.r-inla.org/ Håvard Rue and Turid Follestad. GMRFLib: Fast and exact simulation of Gaussian Markov random fields on graphs. Technical report, Norwegian University of Science and Technology, 2007. URL http://www.math.ntnu.no/hrue/gmrflib/ 2 / 14

Overview Replace all variables with their Laplace approximation Construct GMRF of posterior from prior likelihood GMRF prior conjugate to GMRF likelihood Solve with Newton method Håvard Rue, Sara Martino, and Nicolas Chopin. Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. Journal of the Royal Statistical Society B, 71:319 392, 2009 3 / 14

4 / 14 Laplace Approximation consider probability density p(x; θ) dx Replace with MVN (x; x, Q) where x maximises the log likelihood Q the Hessian of log likelihood at x Everything is now Gaussian

Gaussian Markov Random Field Multivariate normal density { } π (x) = Q (2π) n exp (x µ)t Q (x µ) 2 Conditional independence Q ij = 0 Many models and priors can be represented as GMRF linear model penalised random walk Besag and Besag, York and Mollie stochastic PDE over finite element basis AR(1) Håvard Rue and Leonhard Held. Gaussian Markov random fields: theory and applications. CRC Press, 2005 Stefan Lang and Andreas Brezger. Bayesian P-Splines. Journal of Computational and Graphical Statistics, 13(1):183 212, 2004 Julian Besag. Spatial interaction and the statistical analysis of lattice systems. Journal of the Royal Statistical Society, Series B, 36: 192 236, 1974 Julian Besag, Jeremy York, and Annie Mollié. Bayesian image restoration, with two applications in spatial statistics. Annals of the Institute of Statistical Mathematics, 43:1 20, 1991 Finn Lindgren, Håvard Rue, and Johan Lindström. An explicit link between Gaussian fields and Gaussian Markov random fields: the stochastic partial differential equation approach. Journal of the Royal Statistical Society B, 73, 2011 5 / 14

6 / 14 Newton solver Posterior GMRF as surface to be maximised Newton-Raphson solver seeks global maximum GMRF mean is location of maximum value GMRF precision is Hessian at maximum value

7 / 14 Posterior inference GMRF mean is location of maximum value GMRF precision is Hessian at maximum value Integrate to obtain marginals of parameters Easy because everything is Gaussian

8 / 14 Posterior summaries 95% region of HPD Kullback-Leibler divergence DIC, log likelihood, etc.

Prior precisions GMRF is a conjugate prior for GMRF wide variety of likelihoods and priors example random walk of order 2 p (β λ) MVN (0, Q) p (λ) Γ (1, b). λ transformed to log λ log-gamma prior replaced with its Laplace approximation Row 5 10 15 20 5 10 15 20 Column Dimensions: 24 x 24 Figure: C for random walk penalty of order 2 with 24 unique covariate values 6 4 2 0 2 4 Stefan Lang and Andreas Brezger. Bayesian P-Splines. Journal of Computational and Graphical Statistics, 13(1):183 212, 2004 9 / 14

10 / 14 Defining custom precision matrices generic0 most general, Q = τc ( ) generic1 Q = τ I β λmax C generic2 for two level hierarchical model expression build a custom prior

11 / 14 Example Daily trend one week of simulated data ( ( ) ) 2πti y i N sin, 0.33 2 24 generic0 Row 5 10 6 4 2 cyclic random walk penalty of order 2 sum to zero constraint small amount added to diagonal 15 20 5 10 15 20 Column Dimensions: 24 x 24 0 2 4 (y β, λ, τ) MVN (y; Xβ, τi) MVN (β λ; 0, λc) Γ (λ; 1, b) Γ (τ; 1, b)

y 12 / 14 Example Results PostDens [Precision for the Gaussian observations] 0.00 0.15 0.30 6 8 10 12 14 16 18 f(t) 1.5 0.5 0.5 1.5 5 10 15 20 t PostDens [Precision for t] 0.000 0.004 0.008 0 200 400 600 800 1000 1200 1.5 0.5 0.5 1.5 0 50 100 150 Index Figure: σ = 0.318 (0.285, 0.356) Figure: Fitted smooth

Other cool stuff can be run on remote supercomputer GMRFlib parallelisable obtain successive starting values to aid convergence animalinla survival models SPDE spatial (spatio-temporal) models MCMC sampler included for comparison Håvard Rue and Turid Follestad. GMRFLib: Fast and exact simulation of Gaussian Markov random fields on graphs. Technical report, Norwegian University of Science and Technology, 2007. URL http://www.math.ntnu.no/hrue/gmrflib/ Sara Martino Anna Marie Holand, Ingelin Steinsland and Henrik Jensen. Animal models and integrated nested Laplace approximations. Technical Report 4/2011, Norges Teknisk-Naturvitenskapelige Universitet, 2011 Sara Martino and Håvard Rue. Complex data modeling and computationally intensive statistical methods, chapter Case Studies in Bayesian Computation using INLA. 2010 Finn Lindgren, Håvard Rue, and Johan Lindström. An explicit link between Gaussian fields and Gaussian Markov random fields: the stochastic partial differential equation approach. Journal of the Royal Statistical Society B, 73, 2011 Håvard Rue and Leonhard Held. Gaussian Markov random fields: theory and applications. CRC Press, 2005 13 / 14

14 / 14 Code library(inla) t <- rep(1:24,7) y <- rnorm(n=168,mean=sin(t * 2 * pi / 24),sd=0.33) make.crw2 <- function(n){ Q <- toeplitz( c(6,-4,1, rep(0,n-5), 1, -4)) return(as(q, "dgcmatrix")) } Q <- make.crw2(24) # image(q,col.regions=grey.colors(16)) result1 <- inla(y f(t, model="generic0",cmatrix=q,diagonal=1e-03,constr=t), data=as.data.frame(list(y = y, t=t)),verbose=t, control.predictor=list(compute=t)) windows() par(mfrow=c(2,1)) plot(y t, pch=1,ylab="f(t)",xlab="t") lines(result1$summary.random$t[,2]) lines(result1$summary.random$t[,4],lty=2) lines(result1$summary.random$t[,6],lty=2) plot(y, pch=1,ylab="y",xlab="index") lines(result1$summary.linear.predictor[,1]) lines(result1$summary.linear.predictor[,3],lty=2) lines(result1$summary.linear.predictor[,5],lty=2)