Bayesian computing with INLA and the R-INLA package H avard Rue - - PowerPoint PPT Presentation

bayesian computing with inla and the r inla package
SMART_READER_LITE
LIVE PREVIEW

Bayesian computing with INLA and the R-INLA package H avard Rue - - PowerPoint PPT Presentation

The R-INLA package Bayesian computing with INLA and the R-INLA package H avard Rue Norwegian University of Science and Technology Trondheim, Norway July 24, 2013 The R-INLA package Plan of this talk Plan of this talk Background of


slide-1
SLIDE 1

The R-INLA package

Bayesian computing with INLA and the R-INLA package

H˚ avard Rue Norwegian University of Science and Technology Trondheim, Norway July 24, 2013

slide-2
SLIDE 2

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-3
SLIDE 3

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-4
SLIDE 4

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-5
SLIDE 5

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-6
SLIDE 6

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-7
SLIDE 7

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-8
SLIDE 8

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-9
SLIDE 9

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-10
SLIDE 10

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-11
SLIDE 11

The R-INLA package Plan of this talk

Plan of this talk

  • Background of Bayesian computing
  • Maybe it is useful not to be so general?
  • Latent Gaussian models (LGMs)
  • The aim: approximating marginals
  • The key tools
  • The R-INLA package
  • Some special features
  • The road ahead Version 1
  • The road ahead Version 2
  • Discussion
slide-12
SLIDE 12

The R-INLA package Others...

The core-team

Finn Lindgren Daniel Simpson Thiago Martins Andrea Ribler

slide-13
SLIDE 13

The R-INLA package Background

Background

  • The issue of Bayesian computing is not “solved” even though

MCMC is available

  • Hierarchical models are more difficult for MCMC
  • The main obstacle for Bayesian modelling is the issue of

“Bayesian computing”

  • Generic MCMC-tools available: JAGS/OpenBUGS,
  • Tools based on MCMC are available for specific model classes,

like BayesX and stan

  • All these tools have a nice R-interface
slide-14
SLIDE 14

The R-INLA package Background

Background

  • The issue of Bayesian computing is not “solved” even though

MCMC is available

  • Hierarchical models are more difficult for MCMC
  • The main obstacle for Bayesian modelling is the issue of

“Bayesian computing”

  • Generic MCMC-tools available: JAGS/OpenBUGS,
  • Tools based on MCMC are available for specific model classes,

like BayesX and stan

  • All these tools have a nice R-interface
slide-15
SLIDE 15

The R-INLA package Background

Background

  • The issue of Bayesian computing is not “solved” even though

MCMC is available

  • Hierarchical models are more difficult for MCMC
  • The main obstacle for Bayesian modelling is the issue of

“Bayesian computing”

  • Generic MCMC-tools available: JAGS/OpenBUGS,
  • Tools based on MCMC are available for specific model classes,

like BayesX and stan

  • All these tools have a nice R-interface
slide-16
SLIDE 16

The R-INLA package Background

Background

  • The issue of Bayesian computing is not “solved” even though

MCMC is available

  • Hierarchical models are more difficult for MCMC
  • The main obstacle for Bayesian modelling is the issue of

“Bayesian computing”

  • Generic MCMC-tools available: JAGS/OpenBUGS,
  • Tools based on MCMC are available for specific model classes,

like BayesX and stan

  • All these tools have a nice R-interface
slide-17
SLIDE 17

The R-INLA package Background

Background

  • The issue of Bayesian computing is not “solved” even though

MCMC is available

  • Hierarchical models are more difficult for MCMC
  • The main obstacle for Bayesian modelling is the issue of

“Bayesian computing”

  • Generic MCMC-tools available: JAGS/OpenBUGS,
  • Tools based on MCMC are available for specific model classes,

like BayesX and stan

  • All these tools have a nice R-interface
slide-18
SLIDE 18

The R-INLA package Background

Background

  • The issue of Bayesian computing is not “solved” even though

MCMC is available

  • Hierarchical models are more difficult for MCMC
  • The main obstacle for Bayesian modelling is the issue of

“Bayesian computing”

  • Generic MCMC-tools available: JAGS/OpenBUGS,
  • Tools based on MCMC are available for specific model classes,

like BayesX and stan

  • All these tools have a nice R-interface
slide-19
SLIDE 19

The R-INLA package Do we need to be general?

The problem of generality

Although MCMC

  • is applicable in general
  • converge under mild conditions (even simple schemes)
  • is asymptotically fine

it is often to slow. However, “slow” can be fine.

slide-20
SLIDE 20

The R-INLA package Do we need to be general?

The problem of generality

Although MCMC

  • is applicable in general
  • converge under mild conditions (even simple schemes)
  • is asymptotically fine

it is often to slow. However, “slow” can be fine.

slide-21
SLIDE 21

The R-INLA package Do we need to be general?

The problem of generality

Although MCMC

  • is applicable in general
  • converge under mild conditions (even simple schemes)
  • is asymptotically fine

it is often to slow. However, “slow” can be fine.

slide-22
SLIDE 22

The R-INLA package Do we need to be general?

The problem of generality

Although MCMC

  • is applicable in general
  • converge under mild conditions (even simple schemes)
  • is asymptotically fine

it is often to slow. However, “slow” can be fine.

slide-23
SLIDE 23

The R-INLA package Do we need to be general?

The problem of generality

Although MCMC

  • is applicable in general
  • converge under mild conditions (even simple schemes)
  • is asymptotically fine

it is often to slow. However, “slow” can be fine.

slide-24
SLIDE 24

The R-INLA package Do we need to be general?

Let us be more specific!

  • Cannot make all (statisticians) happy
  • Can make some (statisticians) more happy!
slide-25
SLIDE 25

The R-INLA package Do we need to be general?

Let us be more specific!

  • Cannot make all (statisticians) happy
  • Can make some (statisticians) more happy!
slide-26
SLIDE 26

The R-INLA package Latent Gaussian Models

Latent Gaussian models (LGMs)

  • Most Bayesian models used are within this class
  • This unification does not help modelling nor understanding,

but is very useful for computations

slide-27
SLIDE 27

The R-INLA package Latent Gaussian Models

Latent Gaussian models (LGMs)

  • Most Bayesian models used are within this class
  • This unification does not help modelling nor understanding,

but is very useful for computations

slide-28
SLIDE 28

The R-INLA package Latent Gaussian Models

Latent Gaussian models

θ ∼ π(θ) x | θ ∼ N(x ; µ(θ), Q(θ)) y | x, θ ∼

  • i

π(yi | ηi, θ)

  • This is a latent Gaussian models (LGMs)
  • dim(x) is (typically) large 102-105
  • dim(θ) is (typically) small 1-10
slide-29
SLIDE 29

The R-INLA package Latent Gaussian Models

Latent Gaussian models

θ ∼ π(θ) x | θ ∼ N(x ; µ(θ), Q(θ)) y | x, θ ∼

  • i

π(yi | ηi, θ)

  • This is a latent Gaussian models (LGMs)
  • dim(x) is (typically) large 102-105
  • dim(θ) is (typically) small 1-10
slide-30
SLIDE 30

The R-INLA package Latent Gaussian Models

Latent Gaussian models

θ ∼ π(θ) x | θ ∼ N(x ; µ(θ), Q(θ)) y | x, θ ∼

  • i

π(yi | ηi, θ)

  • This is a latent Gaussian models (LGMs)
  • dim(x) is (typically) large 102-105
  • dim(θ) is (typically) small 1-10
slide-31
SLIDE 31

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-32
SLIDE 32

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-33
SLIDE 33

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-34
SLIDE 34

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-35
SLIDE 35

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-36
SLIDE 36

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-37
SLIDE 37

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-38
SLIDE 38

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-39
SLIDE 39

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-40
SLIDE 40

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-41
SLIDE 41

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-42
SLIDE 42

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-43
SLIDE 43

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-44
SLIDE 44

The R-INLA package Latent Gaussian Models

  • Dynamic linear models
  • Stochastic volatility
  • Generalised linear (mixed) models
  • Generalised additive (mixed) models
  • Measurement error models
  • Spline smoothing
  • Semiparametric regression
  • Space-varying (semiparametric) regression models
  • Models for disease mapping
  • Log-Gaussian Cox-processes
  • Model-based geostatistics
  • Spatio-temporal models
  • Survival analysis
  • +++
slide-45
SLIDE 45

The R-INLA package Latent Gaussian Models

The aim: Approximate the posterior marginals

Compute from π(x, θ | y) ∝ π(θ) π(x | θ)

  • i∈I

π(yi | xi, θ) the posterior marginals: π(xi | y), for some or all i and/or π(θi | y), for some or all i

slide-46
SLIDE 46

The R-INLA package Latent Gaussian Models

End result

  • Can we compute (approximate) marginals directly?
  • YES!
  • Gain
  • Huge speedup & accuracy
  • The ability to treat LGMs properly
slide-47
SLIDE 47

The R-INLA package Latent Gaussian Models

End result

  • Can we compute (approximate) marginals directly?
  • YES!
  • Gain
  • Huge speedup & accuracy
  • The ability to treat LGMs properly
slide-48
SLIDE 48

The R-INLA package Latent Gaussian Models

End result

  • Can we compute (approximate) marginals directly?
  • YES!
  • Gain
  • Huge speedup & accuracy
  • The ability to treat LGMs properly
slide-49
SLIDE 49

The R-INLA package The main idea

Smoothing noisy observations (I)

Observations yi = m(i) + ǫi, i = 1, . . . , n for Gaussian iid noise ǫi with known precision. Will assume m(i) is a smooth function wrt i

slide-50
SLIDE 50

The R-INLA package The main idea

Smoothing noisy observations (I)

Observations yi = m(i) + ǫi, i = 1, . . . , n for Gaussian iid noise ǫi with known precision. Will assume m(i) is a smooth function wrt i

slide-51
SLIDE 51

The R-INLA package The main idea

Smoothing noisy observations (II)

n = 50 idx = 1:n fun = 100*((idx-n/2)/n)^3 y = fun + rnorm(n) plot(idx, y)

10 20 30 40 50 −10 −5 5 10 idx y

slide-52
SLIDE 52

The R-INLA package The main idea

Smoothing noisy observations (III)

Likelihood Gaussian observations with known precision yi|xi, θ ∼ N(xi, τ0) Latent A Gaussian model for the smooth function π(x|θ) ∝ θ(n−2)/2 exp

  • −θ

2

n

  • i=2

(xi − 2xi−1 + xi−2)2

  • Hyperparameter The smoothing parameter θ which we assign a

Γ(a, b) prior π(θ) ∝ θa−1 exp (−bθ) , θ > 0

slide-53
SLIDE 53

The R-INLA package The main idea

Smoothing noisy observations (III)

Likelihood Gaussian observations with known precision yi|xi, θ ∼ N(xi, τ0) Latent A Gaussian model for the smooth function π(x|θ) ∝ θ(n−2)/2 exp

  • −θ

2

n

  • i=2

(xi − 2xi−1 + xi−2)2

  • Hyperparameter The smoothing parameter θ which we assign a

Γ(a, b) prior π(θ) ∝ θa−1 exp (−bθ) , θ > 0

slide-54
SLIDE 54

The R-INLA package The main idea

Smoothing noisy observations (III)

Likelihood Gaussian observations with known precision yi|xi, θ ∼ N(xi, τ0) Latent A Gaussian model for the smooth function π(x|θ) ∝ θ(n−2)/2 exp

  • −θ

2

n

  • i=2

(xi − 2xi−1 + xi−2)2

  • Hyperparameter The smoothing parameter θ which we assign a

Γ(a, b) prior π(θ) ∝ θa−1 exp (−bθ) , θ > 0

slide-55
SLIDE 55

The R-INLA package The main idea

Smoothing noisy observations (IV)

Since x, y|θ ∼ N(·, ·) we can compute (numerically) all marginals, using that π(θ|y) ∝

Gaussian

  • π(x, y|θ) π(θ)

π(x|y, θ)

  • Gaussian

and x|y, θ ∼ N(·, ·) so that π(xi|y) =

  • π(xi|θ, y)
  • Gaussian

π(θ|y) dθ

slide-56
SLIDE 56

The R-INLA package The main idea

Smoothing noisy observations (IV)

Since x, y|θ ∼ N(·, ·) we can compute (numerically) all marginals, using that π(θ|y) ∝

Gaussian

  • π(x, y|θ) π(θ)

π(x|y, θ)

  • Gaussian

and x|y, θ ∼ N(·, ·) so that π(xi|y) =

  • π(xi|θ, y)
  • Gaussian

π(θ|y) dθ

slide-57
SLIDE 57

The R-INLA package The main idea

Smoothing noisy observations (IV)

Since x, y|θ ∼ N(·, ·) we can compute (numerically) all marginals, using that π(θ|y) ∝

Gaussian

  • π(x, y|θ) π(θ)

π(x|y, θ)

  • Gaussian

and x|y, θ ∼ N(·, ·) so that π(xi|y) =

  • π(xi|θ, y)
  • Gaussian

π(θ|y) dθ

slide-58
SLIDE 58

The R-INLA package The main idea

Smoothing noisy observations (IV)

Since x, y|θ ∼ N(·, ·) we can compute (numerically) all marginals, using that π(θ|y) ∝

Gaussian

  • π(x, y|θ) π(θ)

π(x|y, θ)

  • Gaussian

and x|y, θ ∼ N(·, ·) so that π(xi|y) =

  • π(xi|θ, y)
  • Gaussian

π(θ|y) dθ

slide-59
SLIDE 59

The R-INLA package The main idea

1 2 3 4 5 6 0.0 0.2 0.4 0.6 0.8 1.0 log.prec exp(log.dens)

Posterior marginal for theta

slide-60
SLIDE 60

The R-INLA package The main idea

1 2 3 4 5 6 0.0 0.2 0.4 0.6 0.8 1.0 log.prec exp(log.dens)

Posterior marginal for theta, interpolated

slide-61
SLIDE 61

The R-INLA package The main idea

−14 −12 −10 −8 0.0 0.2 0.4 0.6 0.8 x density

Posterior marginals for x[1] for each theta (unweighted)

slide-62
SLIDE 62

The R-INLA package The main idea

−14 −12 −10 −8 0.00 0.05 0.10 0.15 x density

Posterior marginals for x[1] for each theta (weighted)

slide-63
SLIDE 63

The R-INLA package The main idea

−14 −12 −10 −8 0.0 0.2 0.4 0.6 0.8 x density

Posterior marginals for x[1]

slide-64
SLIDE 64

The R-INLA package The main idea

Extensions

This is the basic idea behind INLA. It is really really simple. However, we need to extend this basic idea so we can deal with

  • More than one hyperparameter
  • Non-Gaussian observations

...the devil is in the details!

slide-65
SLIDE 65

The R-INLA package The main idea

Extensions

This is the basic idea behind INLA. It is really really simple. However, we need to extend this basic idea so we can deal with

  • More than one hyperparameter
  • Non-Gaussian observations

...the devil is in the details!

slide-66
SLIDE 66

The R-INLA package The main idea

Extensions

This is the basic idea behind INLA. It is really really simple. However, we need to extend this basic idea so we can deal with

  • More than one hyperparameter
  • Non-Gaussian observations

...the devil is in the details!

slide-67
SLIDE 67

The R-INLA package The main idea

Extensions

This is the basic idea behind INLA. It is really really simple. However, we need to extend this basic idea so we can deal with

  • More than one hyperparameter
  • Non-Gaussian observations

...the devil is in the details!

slide-68
SLIDE 68

The R-INLA package The main idea

Extensions

This is the basic idea behind INLA. It is really really simple. However, we need to extend this basic idea so we can deal with

  • More than one hyperparameter
  • Non-Gaussian observations

...the devil is in the details!

slide-69
SLIDE 69

The R-INLA package The tools

The tools

  • Precision matrices
  • Sparse matrices/GMRFs/Markov
  • Laplace approximations
slide-70
SLIDE 70

The R-INLA package The tools

The tools

  • Precision matrices
  • Sparse matrices/GMRFs/Markov
  • Laplace approximations
slide-71
SLIDE 71

The R-INLA package The tools

The tools

  • Precision matrices
  • Sparse matrices/GMRFs/Markov
  • Laplace approximations
slide-72
SLIDE 72

The R-INLA package The tools Precision matrices

Hierarchical models

First layer x ∼ N(0, Qx) Second layer y|x ∼ N(x, Qy) Then Prec x y

  • =

Qx + Qy −Qy −Qy Qy

  • Very efficient: computational and storage
slide-73
SLIDE 73

The R-INLA package The tools Precision matrices

Hierarchical models

First layer x ∼ N(0, Qx) Second layer y|x ∼ N(x, Qy) Then Prec x y

  • =

Qx + Qy −Qy −Qy Qy

  • Very efficient: computational and storage
slide-74
SLIDE 74

The R-INLA package The tools Precision matrices

Hierarchical models

First layer x ∼ N(0, Qx) Second layer y|x ∼ N(x, Qy) Then Prec x y

  • =

Qx + Qy −Qy −Qy Qy

  • Very efficient: computational and storage
slide-75
SLIDE 75

The R-INLA package The tools Sparse matrices

Sparse matrices/GMRFs/Markov

Conditional independence gives sparsity xi ⊥ xj | x−ij ⇐ ⇒ Qij = 0 In most cases, only O(n) of the n(n + 1)/2 elements in Q are non-zero.

slide-76
SLIDE 76

The R-INLA package The tools Sparse matrices

Sparse matrices/GMRFs/Markov

Conditional independence gives sparsity xi ⊥ xj | x−ij ⇐ ⇒ Qij = 0 In most cases, only O(n) of the n(n + 1)/2 elements in Q are non-zero.

slide-77
SLIDE 77

The R-INLA package The tools Sparse matrices

Example (I)

Auto-regressive model of order p xt = φ1xt−1 + · · · + φpxt−p + ǫt then Q is a band-matrix with band-width p

slide-78
SLIDE 78

The R-INLA package The tools Sparse matrices

Example (I)

Auto-regressive model of order p xt = φ1xt−1 + · · · + φpxt−p + ǫt then Q is a band-matrix with band-width p

−0.5 0.0 0.5 1.0 1.5

The precision matrix

40 42 44 46 48 50

The covariance matrix

slide-79
SLIDE 79

The R-INLA package The tools Sparse matrices

Example (II)

Gaussian models for areal data

2e+05 3e+05 4e+05 5e+05 6e+05 7e+05 8e+05 1200000 1300000 1400000 1500000 1600000 xylims$x xylims$y −1.0 −0.8 −0.6 −0.4 −0.2 0.0

slide-80
SLIDE 80

The R-INLA package The tools Sparse matrices

Example (III)

Gaussian models on the sphere. (Have to “make” it Markov!)

slide-81
SLIDE 81

The R-INLA package The tools Sparse matrices

Numerical methods for sparse matrices

  • Only O(n) of the O(n2) terms are non-zero
  • Computational costs (factorisation):
  • O(n) in time
  • O(n3/2) in space
  • O(n2) in space×time
  • Tasks

Q = LLT Qx = b log |Q(θ)| diag(Q−1)

slide-82
SLIDE 82

The R-INLA package The tools Sparse matrices

Numerical methods for sparse matrices

  • Only O(n) of the O(n2) terms are non-zero
  • Computational costs (factorisation):
  • O(n) in time
  • O(n3/2) in space
  • O(n2) in space×time
  • Tasks

Q = LLT Qx = b log |Q(θ)| diag(Q−1)

slide-83
SLIDE 83

The R-INLA package The tools Sparse matrices

Numerical methods for sparse matrices

  • Only O(n) of the O(n2) terms are non-zero
  • Computational costs (factorisation):
  • O(n) in time
  • O(n3/2) in space
  • O(n2) in space×time
  • Tasks

Q = LLT Qx = b log |Q(θ)| diag(Q−1)

slide-84
SLIDE 84

The R-INLA package The tools Sparse matrices

Numerical methods for sparse matrices

  • Only O(n) of the O(n2) terms are non-zero
  • Computational costs (factorisation):
  • O(n) in time
  • O(n3/2) in space
  • O(n2) in space×time
  • Tasks

Q = LLT Qx = b log |Q(θ)| diag(Q−1)

slide-85
SLIDE 85

The R-INLA package The tools Sparse matrices

Numerical methods for sparse matrices

  • Only O(n) of the O(n2) terms are non-zero
  • Computational costs (factorisation):
  • O(n) in time
  • O(n3/2) in space
  • O(n2) in space×time
  • Tasks

Q = LLT Qx = b log |Q(θ)| diag(Q−1)

slide-86
SLIDE 86

The R-INLA package The tools Sparse matrices

Numerical methods for sparse matrices

  • Only O(n) of the O(n2) terms are non-zero
  • Computational costs (factorisation):
  • O(n) in time
  • O(n3/2) in space
  • O(n2) in space×time
  • Tasks

Q = LLT Qx = b log |Q(θ)| diag(Q−1)

slide-87
SLIDE 87

The R-INLA package The tools The Laplace approximation

The Laplace approximation: The classic case

Compute and approximation to the integral

  • exp(ng(x)) dx

where n is the parameter going to ∞. Let x0 be the mode of g(x) and assume g(x0) = 0: g(x) = 1 2g′′(x0)(x − x0)2 + · · · .

slide-88
SLIDE 88

The R-INLA package The tools The Laplace approximation

The Laplace approximation: The classic case

Compute and approximation to the integral

  • exp(ng(x)) dx

where n is the parameter going to ∞. Let x0 be the mode of g(x) and assume g(x0) = 0: g(x) = 1 2g′′(x0)(x − x0)2 + · · · .

slide-89
SLIDE 89

The R-INLA package The tools The Laplace approximation

The Laplace approximation: The classic case...

Then

  • exp(ng(x)) dx =

n(−g′′(x0)) + · · · Error analysis gives Estimate(n) True = 1 + O(1/n) so the relative error is O(1/n).

slide-90
SLIDE 90

The R-INLA package The tools The Laplace approximation

The Laplace approximation: The classic case...

Then

  • exp(ng(x)) dx =

n(−g′′(x0)) + · · · Error analysis gives Estimate(n) True = 1 + O(1/n) so the relative error is O(1/n).

slide-91
SLIDE 91

The R-INLA package The tools The Laplace approximation

Errors in the approximations

Result:1 With n repeated measurements y of the same x, then

  • π(θ|yn)

π(θ|yn) = 1 + O(n−3/2) after re-normalisation.

  • The Relative error is a very very very nice property!
  • The error-rate is impressive!
  • Unfortunately, the assumptions made are usually not valid for

LGMs, but...

1Tierney & Kadane, JASA, 1986

slide-92
SLIDE 92

The R-INLA package The tools The Laplace approximation

Errors in the approximations

Result:1 With n repeated measurements y of the same x, then

  • π(θ|yn)

π(θ|yn) = 1 + O(n−3/2) after re-normalisation.

  • The Relative error is a very very very nice property!
  • The error-rate is impressive!
  • Unfortunately, the assumptions made are usually not valid for

LGMs, but...

1Tierney & Kadane, JASA, 1986

slide-93
SLIDE 93

The R-INLA package The tools The Laplace approximation

Errors in the approximations

Result:1 With n repeated measurements y of the same x, then

  • π(θ|yn)

π(θ|yn) = 1 + O(n−3/2) after re-normalisation.

  • The Relative error is a very very very nice property!
  • The error-rate is impressive!
  • Unfortunately, the assumptions made are usually not valid for

LGMs, but...

1Tierney & Kadane, JASA, 1986

slide-94
SLIDE 94

The R-INLA package The tools The Laplace approximation

Errors in the approximations

Result:1 With n repeated measurements y of the same x, then

  • π(θ|yn)

π(θ|yn) = 1 + O(n−3/2) after re-normalisation.

  • The Relative error is a very very very nice property!
  • The error-rate is impressive!
  • Unfortunately, the assumptions made are usually not valid for

LGMs, but...

1Tierney & Kadane, JASA, 1986

slide-95
SLIDE 95

The R-INLA package The R-INLA package

The R-INLA package

  • A front end in R to

define LGMs and to do approximate Bayesian analysis using INLA

  • The project is located

at www.r-inla.org

slide-96
SLIDE 96

The R-INLA package The R-INLA package

The interface

result = inla(formula, data = data, family = family, ...) summary(result) plot(result) etc...

slide-97
SLIDE 97

The R-INLA package The R-INLA package

Formula

The formula is mostly as “usual” y ~ 1 + x1 + x2 + x3:x4 + f(z1, model=...) + f(z2, model=...)

  • LHS: the response
  • RHS: the linear predictor
  • “fixed effects”: x1, x2...
  • “random effects” indexed by z1, z2
  • f () define some Gaussian model!
slide-98
SLIDE 98

The R-INLA package The R-INLA package

Formula

The formula is mostly as “usual” y ~ 1 + x1 + x2 + x3:x4 + f(z1, model=...) + f(z2, model=...)

  • LHS: the response
  • RHS: the linear predictor
  • “fixed effects”: x1, x2...
  • “random effects” indexed by z1, z2
  • f () define some Gaussian model!
slide-99
SLIDE 99

The R-INLA package The R-INLA package

Formula

The formula is mostly as “usual” y ~ 1 + x1 + x2 + x3:x4 + f(z1, model=...) + f(z2, model=...)

  • LHS: the response
  • RHS: the linear predictor
  • “fixed effects”: x1, x2...
  • “random effects” indexed by z1, z2
  • f () define some Gaussian model!
slide-100
SLIDE 100

The R-INLA package The R-INLA package

Formula

The formula is mostly as “usual” y ~ 1 + x1 + x2 + x3:x4 + f(z1, model=...) + f(z2, model=...)

  • LHS: the response
  • RHS: the linear predictor
  • “fixed effects”: x1, x2...
  • “random effects” indexed by z1, z2
  • f () define some Gaussian model!
slide-101
SLIDE 101

The R-INLA package The R-INLA package

Formula

The formula is mostly as “usual” y ~ 1 + x1 + x2 + x3:x4 + f(z1, model=...) + f(z2, model=...)

  • LHS: the response
  • RHS: the linear predictor
  • “fixed effects”: x1, x2...
  • “random effects” indexed by z1, z2
  • f () define some Gaussian model!
slide-102
SLIDE 102

The R-INLA package The R-INLA package

Special features

Although the “formula” framework is great, we needed to add new features to be able to more models Some of these are

  • More than one family
  • copy
  • remote computing
slide-103
SLIDE 103

The R-INLA package The R-INLA package

Special features

Although the “formula” framework is great, we needed to add new features to be able to more models Some of these are

  • More than one family
  • copy
  • remote computing
slide-104
SLIDE 104

The R-INLA package The R-INLA package

Special features

Although the “formula” framework is great, we needed to add new features to be able to more models Some of these are

  • More than one family
  • copy
  • remote computing
slide-105
SLIDE 105

The R-INLA package The R-INLA package

Special features

Although the “formula” framework is great, we needed to add new features to be able to more models Some of these are

  • More than one family
  • copy
  • remote computing
slide-106
SLIDE 106

The R-INLA package The R-INLA package

More than one family

Every observation could have its own likelihood. Need to make it easy.

  • Response is a matrix or list
  • Each “column” defines a separate “family”
  • Each “family” has its own hyperparameters
slide-107
SLIDE 107

The R-INLA package The R-INLA package

Simple example

> Y [,1] [,2] [1,] 1 NA [2,] 2 NA [3,] NA 3 [4,] NA 4 result = inla(Y ~ 1 + x, family = c("gaussian", "gaussian"), control.family = list(list(...), list(...)), data = list(Y=Y, x=x))

slide-108
SLIDE 108

The R-INLA package The R-INLA package Feature: copy

Feature: copy

Fixes a limitation in the formula-formulation of the model The model formula = y ~ f(i, ...) + ... Only allow ONE element from each sub-model, to contribute to the linear predictor for each observation.

slide-109
SLIDE 109

The R-INLA package The R-INLA package Feature: copy

Feature: copy

Fixes a limitation in the formula-formulation of the model The model formula = y ~ f(i, ...) + ... Only allow ONE element from each sub-model, to contribute to the linear predictor for each observation.

slide-110
SLIDE 110

The R-INLA package The R-INLA package Feature: copy

Feature: copy

Suppose ηi = ui + ui+1 + ... Then we can code this as formula = y ~ f(i, model="iid") + f(i.plus, copy="i") + ...

  • Create internally an additional sub-model which is ǫ-close to

the target

  • Many copies allowed
  • Weighted copies: ui + βui+1
slide-111
SLIDE 111

The R-INLA package The R-INLA package Feature: copy

Feature: copy

Suppose ηi = ui + ui+1 + ... Then we can code this as formula = y ~ f(i, model="iid") + f(i.plus, copy="i") + ...

  • Create internally an additional sub-model which is ǫ-close to

the target

  • Many copies allowed
  • Weighted copies: ui + βui+1
slide-112
SLIDE 112

The R-INLA package The R-INLA package Feature: copy

(Classical) Measurement error-model using copy

yi ∼ ηi = . . . + βxi + . . . where x is unknown but observed as x′, where f.ex. x′ = x + ǫ

slide-113
SLIDE 113

The R-INLA package The R-INLA package Feature: copy

Example 1

y ∼ N(µ + βx, τ) xobs ∼ N(x, κ) Write this a a joint model y xobs

  • =

µ

  • +

βx

  • +

x

  • +
  • 1

√τ ǫ

  • +
  • 1

√κ

ǫ

  • using two families + copy
slide-114
SLIDE 114

The R-INLA package The R-INLA package Feature: copy

Example 1

y ∼ N(µ + βx, τ) xobs ∼ N(x, κ) Write this a a joint model y xobs

  • =

µ

  • +

βx

  • +

x

  • +
  • 1

√τ ǫ

  • +
  • 1

√κ

ǫ

  • using two families + copy
slide-115
SLIDE 115

The R-INLA package The R-INLA package Feature: copy

Example 2

y ∼ N(βx, τ) xobs ∼ Poisson(exp(x))

slide-116
SLIDE 116

The R-INLA package The R-INLA package Feature: copy

Example 3: Preferencial sampling

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 1 2 3 4 5 6 7

Preferential sampling

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 1 2 3 4 5 6 7

Random sampling

slide-117
SLIDE 117

The R-INLA package The R-INLA package Feature: remote

Feature: remote computing

For large/huge models, it is convenient to run the computations (only!) on a remote (Linux/Mac) computational server inla(...., inla.call="remote")

  • The computations are done in a separate program outside R

system("inlaprogram INPUT OUTPUT")

  • It is straight forward to implement (using Cygwin on

Windows) scp INPUT $host: ssh $host inlaprogram INPUT OUTPUT scp $host:OUTPUT .

  • Really make use of a computational server
slide-118
SLIDE 118

The R-INLA package The R-INLA package Feature: remote

Feature: remote computing

For large/huge models, it is convenient to run the computations (only!) on a remote (Linux/Mac) computational server inla(...., inla.call="remote")

  • The computations are done in a separate program outside R

system("inlaprogram INPUT OUTPUT")

  • It is straight forward to implement (using Cygwin on

Windows) scp INPUT $host: ssh $host inlaprogram INPUT OUTPUT scp $host:OUTPUT .

  • Really make use of a computational server
slide-119
SLIDE 119

The R-INLA package The R-INLA package Feature: remote

Feature: remote computing

For large/huge models, it is convenient to run the computations (only!) on a remote (Linux/Mac) computational server inla(...., inla.call="remote")

  • The computations are done in a separate program outside R

system("inlaprogram INPUT OUTPUT")

  • It is straight forward to implement (using Cygwin on

Windows) scp INPUT $host: ssh $host inlaprogram INPUT OUTPUT scp $host:OUTPUT .

  • Really make use of a computational server
slide-120
SLIDE 120

The R-INLA package The R-INLA package Feature: remote

Feature: remote computing

For large/huge models, it is convenient to run the computations (only!) on a remote (Linux/Mac) computational server inla(...., inla.call="remote")

  • The computations are done in a separate program outside R

system("inlaprogram INPUT OUTPUT")

  • It is straight forward to implement (using Cygwin on

Windows) scp INPUT $host: ssh $host inlaprogram INPUT OUTPUT scp $host:OUTPUT .

  • Really make use of a computational server
slide-121
SLIDE 121

The R-INLA package Road head Version 1

The road ahead-1.0

Current code

  • Current code is > 100 000 lines of R/C/C++ lines
  • Written in parallel with the development...
  • Some of the internal design could have been better
  • Parts of the code are not easy accessible for others
  • Would be nice with a rewrite...
slide-122
SLIDE 122

The R-INLA package Road head Version 1

The road ahead-1.0

Current code

  • Current code is > 100 000 lines of R/C/C++ lines
  • Written in parallel with the development...
  • Some of the internal design could have been better
  • Parts of the code are not easy accessible for others
  • Would be nice with a rewrite...
slide-123
SLIDE 123

The R-INLA package Road head Version 1

The road ahead-1.0

Current code

  • Current code is > 100 000 lines of R/C/C++ lines
  • Written in parallel with the development...
  • Some of the internal design could have been better
  • Parts of the code are not easy accessible for others
  • Would be nice with a rewrite...
slide-124
SLIDE 124

The R-INLA package Road head Version 1

The road ahead-1.0

Current code

  • Current code is > 100 000 lines of R/C/C++ lines
  • Written in parallel with the development...
  • Some of the internal design could have been better
  • Parts of the code are not easy accessible for others
  • Would be nice with a rewrite...
slide-125
SLIDE 125

The R-INLA package Road head Version 1

The road ahead-1.0

Current code

  • Current code is > 100 000 lines of R/C/C++ lines
  • Written in parallel with the development...
  • Some of the internal design could have been better
  • Parts of the code are not easy accessible for others
  • Would be nice with a rewrite...
slide-126
SLIDE 126

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-127
SLIDE 127

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-128
SLIDE 128

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-129
SLIDE 129

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-130
SLIDE 130

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-131
SLIDE 131

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-132
SLIDE 132

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-133
SLIDE 133

The R-INLA package Road head Version 1

The road ahead Version 1

However, there are exciting development within the project as well

  • Non-stationary Gaussian fields using SPDE’s
  • Non-separable space-time Gaussian fields using SPDE’s
  • Flexible-models (!!!)
  • Add-on and overlay packages
  • Package for constructing credible regions for contours and

excursions from INLA-output (Bolin & Lindgren)

  • Extending the R-INLA Package for Spatial Statistics (Bivand

& G´

  • mez-Rubio)
  • Package for additive genetic models/pedigree based models

(Holand & Steinsland)

  • Package for multiple shrinkage priors with applications to RNA

sequencing (Van der Wiel)

slide-134
SLIDE 134

The R-INLA package Road head Version 1

The road ahead Version 1

  • Current version supports a lot of LGMs
  • There are still a number of models which we should be able to

do but cannot

  • The critical assumption in our definition of LGMs, is

π(u | x, θ) =

  • i

π(yi | ηi, θ)

  • In words, one observation depends only on one linear predictor.
slide-135
SLIDE 135

The R-INLA package Road head Version 1

The road ahead Version 1

  • Current version supports a lot of LGMs
  • There are still a number of models which we should be able to

do but cannot

  • The critical assumption in our definition of LGMs, is

π(u | x, θ) =

  • i

π(yi | ηi, θ)

  • In words, one observation depends only on one linear predictor.
slide-136
SLIDE 136

The R-INLA package Road head Version 1

The road ahead Version 1

  • Current version supports a lot of LGMs
  • There are still a number of models which we should be able to

do but cannot

  • The critical assumption in our definition of LGMs, is

π(u | x, θ) =

  • i

π(yi | ηi, θ)

  • In words, one observation depends only on one linear predictor.
slide-137
SLIDE 137

The R-INLA package Road head Version 1

The road ahead Version 1

  • Current version supports a lot of LGMs
  • There are still a number of models which we should be able to

do but cannot

  • The critical assumption in our definition of LGMs, is

π(u | x, θ) =

  • i

π(yi | ηi, θ)

  • In words, one observation depends only on one linear predictor.
slide-138
SLIDE 138

The R-INLA package Road head Version 1

The road ahead Version 1

  • We can “circumvent” this assumption, introducing a second

layer of linear predictors in the latent field η∗ = Aη, fixed matrix A where π(y | x, θ) =

  • i

π(yi | η∗

i , θ)

  • This is implemented as

r = inla(formula, control.predictor = list(A=A), ...)

  • Although this is is a very useful feature, it does not solve the

underlying problem

slide-139
SLIDE 139

The R-INLA package Road head Version 1

The road ahead Version 1

  • We can “circumvent” this assumption, introducing a second

layer of linear predictors in the latent field η∗ = Aη, fixed matrix A where π(y | x, θ) =

  • i

π(yi | η∗

i , θ)

  • This is implemented as

r = inla(formula, control.predictor = list(A=A), ...)

  • Although this is is a very useful feature, it does not solve the

underlying problem

slide-140
SLIDE 140

The R-INLA package Road head Version 1

The road ahead Version 1

  • We can “circumvent” this assumption, introducing a second

layer of linear predictors in the latent field η∗ = Aη, fixed matrix A where π(y | x, θ) =

  • i

π(yi | η∗

i , θ)

  • This is implemented as

r = inla(formula, control.predictor = list(A=A), ...)

  • Although this is is a very useful feature, it does not solve the

underlying problem

slide-141
SLIDE 141

The R-INLA package Road head Version 2

The road ahead Version 2

  • What is needed is a more wide definition of LGMs, where the
  • bservations enters slightly differently

π(y | x, θ) =

  • i

π(yi | {ηj, j ∈ Si}, θ)

  • In most cases |Si| ∈ {1, 2, 3}, but not always
  • This is DOABLE extension of the current INLA-algorithm!
  • Require a rewrite of the code
slide-142
SLIDE 142

The R-INLA package Road head Version 2

The road ahead Version 2

  • What is needed is a more wide definition of LGMs, where the
  • bservations enters slightly differently

π(y | x, θ) =

  • i

π(yi | {ηj, j ∈ Si}, θ)

  • In most cases |Si| ∈ {1, 2, 3}, but not always
  • This is DOABLE extension of the current INLA-algorithm!
  • Require a rewrite of the code
slide-143
SLIDE 143

The R-INLA package Road head Version 2

The road ahead Version 2

  • What is needed is a more wide definition of LGMs, where the
  • bservations enters slightly differently

π(y | x, θ) =

  • i

π(yi | {ηj, j ∈ Si}, θ)

  • In most cases |Si| ∈ {1, 2, 3}, but not always
  • This is DOABLE extension of the current INLA-algorithm!
  • Require a rewrite of the code
slide-144
SLIDE 144

The R-INLA package Road head Version 2

The road ahead Version 2

  • What is needed is a more wide definition of LGMs, where the
  • bservations enters slightly differently

π(y | x, θ) =

  • i

π(yi | {ηj, j ∈ Si}, θ)

  • In most cases |Si| ∈ {1, 2, 3}, but not always
  • This is DOABLE extension of the current INLA-algorithm!
  • Require a rewrite of the code
slide-145
SLIDE 145

The R-INLA package Road head Version 2

The road ahead Version 2

With this extension we can f.ex do LGMs with

  • Zero-inflated likelihoods, where the excess probability for zero,

depends on its own linear predictor

  • Likelihoods with overdispersion, where also the overdispersion

depends on a linear predictor

  • capture-recapture and distance sampling models
  • more general survival models (censoring)
  • improved models for aggregated count-data
  • +++
slide-146
SLIDE 146

The R-INLA package Road head Version 2

The road ahead Version 2

With this extension we can f.ex do LGMs with

  • Zero-inflated likelihoods, where the excess probability for zero,

depends on its own linear predictor

  • Likelihoods with overdispersion, where also the overdispersion

depends on a linear predictor

  • capture-recapture and distance sampling models
  • more general survival models (censoring)
  • improved models for aggregated count-data
  • +++
slide-147
SLIDE 147

The R-INLA package Road head Version 2

The road ahead Version 2

With this extension we can f.ex do LGMs with

  • Zero-inflated likelihoods, where the excess probability for zero,

depends on its own linear predictor

  • Likelihoods with overdispersion, where also the overdispersion

depends on a linear predictor

  • capture-recapture and distance sampling models
  • more general survival models (censoring)
  • improved models for aggregated count-data
  • +++
slide-148
SLIDE 148

The R-INLA package Road head Version 2

The road ahead Version 2

With this extension we can f.ex do LGMs with

  • Zero-inflated likelihoods, where the excess probability for zero,

depends on its own linear predictor

  • Likelihoods with overdispersion, where also the overdispersion

depends on a linear predictor

  • capture-recapture and distance sampling models
  • more general survival models (censoring)
  • improved models for aggregated count-data
  • +++
slide-149
SLIDE 149

The R-INLA package Road head Version 2

The road ahead Version 2

With this extension we can f.ex do LGMs with

  • Zero-inflated likelihoods, where the excess probability for zero,

depends on its own linear predictor

  • Likelihoods with overdispersion, where also the overdispersion

depends on a linear predictor

  • capture-recapture and distance sampling models
  • more general survival models (censoring)
  • improved models for aggregated count-data
  • +++
slide-150
SLIDE 150

The R-INLA package Road head Version 2

The road ahead Version 2

With this extension we can f.ex do LGMs with

  • Zero-inflated likelihoods, where the excess probability for zero,

depends on its own linear predictor

  • Likelihoods with overdispersion, where also the overdispersion

depends on a linear predictor

  • capture-recapture and distance sampling models
  • more general survival models (censoring)
  • improved models for aggregated count-data
  • +++
slide-151
SLIDE 151

The R-INLA package Road head Version 2

The road ahead Version 2

  • Require an extended interface from within R; many formulas
  • Each likelihood model may f.ex accept a linear predictor at

several places

  • My HOPE is that “SOME” will do this well...
  • If so, it would be the most used Bayesian software! (My view)
slide-152
SLIDE 152

The R-INLA package Road head Version 2

The road ahead Version 2

  • Require an extended interface from within R; many formulas
  • Each likelihood model may f.ex accept a linear predictor at

several places

  • My HOPE is that “SOME” will do this well...
  • If so, it would be the most used Bayesian software! (My view)
slide-153
SLIDE 153

The R-INLA package Road head Version 2

The road ahead Version 2

  • Require an extended interface from within R; many formulas
  • Each likelihood model may f.ex accept a linear predictor at

several places

  • My HOPE is that “SOME” will do this well...
  • If so, it would be the most used Bayesian software! (My view)
slide-154
SLIDE 154

The R-INLA package Road head Version 2

The road ahead Version 2

  • Require an extended interface from within R; many formulas
  • Each likelihood model may f.ex accept a linear predictor at

several places

  • My HOPE is that “SOME” will do this well...
  • If so, it would be the most used Bayesian software! (My view)
slide-155
SLIDE 155

The R-INLA package Discussion

Discussion

  • Most statistical models in use today, are of LGM1/LGM2 type
  • GMRF-models are important, speed/memory
  • The INLA approach seems to be sufficiently accurate in near

all cases. Can be improved.

  • Some exciting developments going on
  • An INLA2 for the extended class LGM2, is doable and will be

hugely important for Bayesian computing

  • If anyone is interested in doing INLA2, let me know...
slide-156
SLIDE 156

The R-INLA package Discussion

Discussion

  • Most statistical models in use today, are of LGM1/LGM2 type
  • GMRF-models are important, speed/memory
  • The INLA approach seems to be sufficiently accurate in near

all cases. Can be improved.

  • Some exciting developments going on
  • An INLA2 for the extended class LGM2, is doable and will be

hugely important for Bayesian computing

  • If anyone is interested in doing INLA2, let me know...
slide-157
SLIDE 157

The R-INLA package Discussion

Discussion

  • Most statistical models in use today, are of LGM1/LGM2 type
  • GMRF-models are important, speed/memory
  • The INLA approach seems to be sufficiently accurate in near

all cases. Can be improved.

  • Some exciting developments going on
  • An INLA2 for the extended class LGM2, is doable and will be

hugely important for Bayesian computing

  • If anyone is interested in doing INLA2, let me know...
slide-158
SLIDE 158

The R-INLA package Discussion

Discussion

  • Most statistical models in use today, are of LGM1/LGM2 type
  • GMRF-models are important, speed/memory
  • The INLA approach seems to be sufficiently accurate in near

all cases. Can be improved.

  • Some exciting developments going on
  • An INLA2 for the extended class LGM2, is doable and will be

hugely important for Bayesian computing

  • If anyone is interested in doing INLA2, let me know...
slide-159
SLIDE 159

The R-INLA package Discussion

Discussion

  • Most statistical models in use today, are of LGM1/LGM2 type
  • GMRF-models are important, speed/memory
  • The INLA approach seems to be sufficiently accurate in near

all cases. Can be improved.

  • Some exciting developments going on
  • An INLA2 for the extended class LGM2, is doable and will be

hugely important for Bayesian computing

  • If anyone is interested in doing INLA2, let me know...
slide-160
SLIDE 160

The R-INLA package Discussion

Discussion

  • Most statistical models in use today, are of LGM1/LGM2 type
  • GMRF-models are important, speed/memory
  • The INLA approach seems to be sufficiently accurate in near

all cases. Can be improved.

  • Some exciting developments going on
  • An INLA2 for the extended class LGM2, is doable and will be

hugely important for Bayesian computing

  • If anyone is interested in doing INLA2, let me know...