gamlss.gmrf: Gaussian Markov Random Field fitting within GAMLSS

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/gmrf-for-gamlss.R

Description

The function gmrf() can be used to fit Markov Random Field additive terms within GAMLSS.

Usage

1
2
3
4
5
gamlss.gmrf(x, y, w, xeval = NULL, ...)
gmrf(x, precision = NULL, neighbour = NULL, polys = NULL,
                 area = NULL, adj.weight = 1000, df = NULL, lambda =
                 NULL, start = 10, method = c("Q", "A"), control =
                 gmrf.control(...), ...)

Arguments

x

a factor containing the areas

precision

the precision matrix if set

neighbour

an object containing the neighbour information for the area if set

polys

the polygon information if set

area

this argument is here to allow more areas than the levels of the factor x, see example below

adj.weight

a value to adjust the iterative weight if necessary

df

degrees of freedom for fitting if required, only for method="A"

lambda

The smoothing parameter lambda if known, only for method="A"

start

starting value for the smoothing parameter lambda

method

"Q" for Q-function, or "A" for alternating method

y

working response variable

w

iterative weights

xeval

whether to predict or not

control

to be use for some of the argument of MRF().

...

for extra arguments

Details

The function gmrf() is to support the function MRF() and MRFA() within GAMLSS. It is intended to be called within a GAMLSS formula. The function gmrf() is not intended to be used directly. It is calling the function MRFA() and MRF() within the GAMLSS fitting algorithm. The results using the option method="Q" or method="A" should produce identical results.

Value

a fitted gamlss object

Author(s)

Fernanda De Bastiani, Mikis Stasinopoulos, Robert Rigby and Vlasios Voudouris.

Maintainer: Fernanda <fernandadebastiani@gmail.com>

References

Stasinopoulos, D. M., Rigby, R. A., Heller, G. Z., Voudouris, V. and De Bastiani, F. (2017) Flexible Regression and Smoothing: Using GAMLSS in R. Chapman and Hall, Boca Raton. (see also http://www.gamlss.org/)

De Bastiani, F. Rigby, R. A., Stasinopoulos, D. M., Cysneiros, A. H. M. A. and Uribe-Opazo, M. A. (2016) Gaussian Markov random spatial models in GAMLSS. Journal of Applied Statistics, pp 1-19.

Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.

Rue and Held (2005) Gaussian markov random fields: theory and applications, Chapman & Hall, USA.

Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.

See Also

MRF, MRFA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(gamlss)
library(mgcv)
data(columb)
data(columb.polys)
vizinhos=polys2nb(columb.polys)
precisionC <- nb2prec(vizinhos,x=columb$district)
# MRFA
 m1<- gamlss(crime~ gmrf(district, polys=columb.polys, method="Q"), data=columb)
 m2<- gamlss(crime~ gmrf(district, polys=columb.polys, method="A"), data=columb)
AIC(m1,m2, k=0)
draw.polys(columb.polys, getSmo(m2), scheme="topo")

gamlss.spatial documentation built on Aug. 10, 2017, 5:05 p.m.