Solved – Geostatistical analysis using spatial.exp in WinBugs

bayesianbugslogisticspatial

I have a logistic regression model in GeoBugs to estimate predictors of prevalence of a disease. Can anyone tell me if there is a simple way to determine the lower and upper bounds of phi for spatial.exp.

This is part of the model:

Infected[i] ~ dbin(p[i], tested[i])
logit(p[i]) <- alpha + beta1*covar1[i] + beta2*covar2[i]  + u[i] 
mu[i] <- 0
u[1:N] ~ spatial.exp(mu[], x[], y[], tau, phi, 1)

This how I have specified the priors:

phi ~ dunif(0.25, 20)

At the moment my selection has been arbitrary. The GeoBugs manual only goes as far as saying that the bounds of the distribution are determined by the data.

What I would like to know is there a dummies version of the best way to select the values.

Best Answer

I have worked this out myself. The lower bound for phi can be estiamted from

-ln(0.5)/(max separating distance between points)

To find the max separating distance I used the following code in R. My data are in a flat file with x and y coords renamed to long and lat respectively:

data <- read.csv(file="file.csv", header=T, sep=",")
coords <- data.frame(data$long,data$lat) 
library(sp)
pointDist <- apply(coords, 1, function(eachPoint) spDistsN1(as.matrix(coords), eachPoint, longlat=TRUE))
distances <- as.vector(pointDist)
max(distances)