rsglmm_mcmc: Restricted Spatial Generalized Linear Mixed model

View source: R/rsglmm_mcmc.R

rsglmm_mcmcR Documentation

Restricted Spatial Generalized Linear Mixed model

Description

Fit a Restricted Spatial Generalized Linear Mixed model using ngspatial

Usage

rsglmm_mcmc(
  data,
  formula,
  family,
  E,
  n,
  W,
  area,
  proj,
  nsamp,
  burnin,
  lag,
  attractive = round(0.5 * (nrow(W)/2)),
  ...
)

Arguments

data

a data frame or list containing the variables in the model.

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

family

allowed families are: "gaussian", "poisson" and "binomial".

E

known component, in the mean for the Poisson likelihoods defined as E = exp(η), where η is the linear predictor. Default = 1.

n

a vector containing the number of trials for the binomial likelihood, or the number of required successes for the nbinomial2 likelihood. Default value is set to 1.

W

adjacency matrix.

area

areal variable name in data.

proj

"hh"

nsamp

number of samples. Default = 1000.

burnin

burn-in size.

lag

lag parameter.

attractive

the number of attractive Moran eigenvectors to use. See ?ngspatial::sparse.sglmm for more information.

...

other parameters used in ?ngspatial::sparse.sglmm

Value

$unrestricted

A list containing

  • $sample: a sample of size nsamp for all parameters in the model

  • $summary_fixed: summary measures for the coefficients

  • $summary_hyperpar: summary measures for hyperparameters

  • $summary_random: summary measures for random quantities

$restricted

A list containing

  • $sample: a sample of size nsamp for all parameters in the model

  • $summary_fixed: summary measures for the coefficients

  • $summary_hyperpar: summary measures for hyperparameters

  • $summary_random: summary measures for random quantities

$out

ngspatial output

$time

time elapsed for fitting the model


DouglasMesquita/RASCO documentation built on Nov. 16, 2022, 9:42 p.m.