hom_sem {BSPADATA}R Documentation

Bayesian fitting of Spatial Error Model (SEM) with homoscedastic normal error term.

Description

Performs the Bayesian fitting of Homoscedastic Spatial Error Model (SEM) with normal error term

Usage

hom_sem(y, X, W, nsim, burn, step, b_pri, B_pri, r_pri, lambda_pri, beta_0, sigma2_0,
lambda_0, kernel = NULL,
plot = TRUE)

Arguments

y

Object of class matrix, with the dependent variable

X

Object of class matrix, with covariates of model

W

Object of class matrix, nb or listw related to Spatial Contiguity Matrix, Anselin(1988)

nsim

A number that indicates the amount of iterations

burn

A number that indicates the amount of iterations to be burn at the beginning of the chain

step

A number that indicates the length between samples in chain that generate the point estimates for each parameter.

b_pri

A vector with the prior mean of beta

B_pri

A matrix with the prior variance of beta

r_pri

A number with the prior shape parameter of sigma^2

lambda_pri

A number with the prior rate parameter of sigma2

beta_0

A vector with start values for beta chain

sigma2_0

A number with start value for sigma^2 chain

lambda_0

A number with start value for lambda chain

kernel

Distribution used in transition kernel to get samples of lambda, it can be "uniform" or "normal"

plot

If it is TRUE present the graph of the chains

Details

hom_sem is a function made in order to fit Spatial Error Model (SEM) with a normal homoscedatic disturbance term through MCMC methods as Metropolis-Hastings algorithm, under two proposals for trasition kernel to get samples of spatial error lag parameter, lambda.

Value

List with the following:

Bestimado

Estimated coefficients of beta

Sigma2est

Estimated coefficient of sigma^2

Lambdaest

Estimated coefficient of lambda

DesvBeta

Estimated standard deviations of beta

DesvGamma

Estimated standard deviation of gamma

DesvLambda

Estimated standard deviation of lambda

AccRate

Acceptance Rate for samples of lambda

BIC

Value of Bayesian Information Criterion

DIC

Value of Deviance Information Criterion

Author(s)

Jorge Sicacha-Parada <jasicachap@unal.edu.co>, Edilberto Cepeda-Cuervo <ecepedac@unal.edu.co>

References

1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

2.Cepeda, E. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105.

3.Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221.

4.Luc Anselin, Spatial Econometrics: Methods and Models, Kluwer Academic, Boston, 1988.

5. D. Gamerman, Markov Chains Monte Carlo: Stochastic Simulation for bayesian Inference, Chapman and Hall, 1997.

6. James Le Sage and Kelley Pace, Introduction to Spatial Econometrics, Chapman & Hall/CRC, Boca Raton, 2009.

Examples

library(spdep)
library(mvtnorm)
library(pscl)
n=49
x0=rep(1,n)
x1=runif(n,0,400)
x2=runif(n,10,23)
X=cbind(x0,x1,x2)
sigma2=rep(45,n)
Sigma=diag(sigma2)
data(oldcol)
W=COL.nb
matstand=nb2mat(W)
A=diag(n)-0.85*matstand
miu=(18+0.026*x1-0.4*x2)
Sigma2=t(solve(A))%*%Sigma%*%solve(A)
y=rmvnorm(1,miu,Sigma2)
y_1=t(y)
y=y_1
hom_sem(y,X,W=COL.nb,nsim=500,burn=25,step=5,b_pri=rep(0,3),B_pri=diag(rep(1000,3)),
r_pri=0.01,lambda_pri=0.01,beta_0=rep(0,3),
sigma2_0=90,lambda_0=0.5,kernel="normal",plot=FALSE)

[Package BSPADATA version 1.0 Index]