krige.posterior function

Posterior Distribution for the Kriging Process

Posterior Distribution for the Kriging Process

This function finds the posterior density of a geospatial linear regression model given a point-referenced geospatial dataset and a set of parameter values. The function is useful for finding the optimum of or for sampling from the posterior distribution.

krige.posterior( tau2, phi, sigma2, beta, y, X, east, north, semivar.exp = 2, p.spatial.share = 0.5, p.range.share = 0.5, p.range.tol = 0.05, p.beta.var = 10, tot.var = var(y), local.Sigma = NULL, max.distance = NULL )

Arguments

  • tau2: Value of the nugget, or non-spatial error variance.
  • phi: Value of the decay term, driving the level of spatial correlation.
  • sigma2: Value of the partial sill, or maximum spatial error variance.
  • beta: Coefficients from linear model.
  • y: The outcome variable that is used in the kriging model.
  • X: The matrix of explanatory variables used in the kriging model.
  • east: Vector of eastings for all observations.
  • north: Vector of northings for all observations.
  • semivar.exp: This exponent, which must be greater than 0 and less than or equal to 2, specifies a powered exponential correlation structure for the data. One widely used specification is setting this to 1, which yields an exponential correlation structure. Another common specification is setting this to 2 (the default), which yields a Gaussian correlation structure.
  • p.spatial.share: Prior for proportion of unexplained variance that is spatial in nature. Must be greater than 0 and less than 1. Defaults to an even split.
  • p.range.share: Prior for the effective range term, as a proportion of the maximum distance in the data. Users should choose the proportion of distance at which they think the spatial correlation will become negligible. Must be greater than 0. Values greater than 1 are permitted, but users should recognize that this implies that meaningful spatial correlation would persist outside of the convex hull of data. Defaults to half the maximum distance.
  • p.range.tol: Tolerance term for setting the effective range. At the distance where the spatial correlation drops below this term, it is judged that the effective range has been met. Users are typically advised to leave this at its default value of 0.05 unless they have strong reasons to choose another level. Must be greater than 0 and less than 1.
  • p.beta.var: Prior for the variance on zero-meaned normal priors on the regression coefficients. Defaults to 10.
  • tot.var: Combined variance between the nugget and partial sill. Defaults to the variance of y. The metropolis.krige function inserts the residual variance from a standard linear model.
  • local.Sigma: The user is advised to ignore this option, or leave it the value of NULL. This option is included to reduce the number of computations required when this function is called by metropolis.krige.
  • max.distance: The user is advised to ignore this option, or leave it the value of NULL. This option is included to reduce the number of computations required when this function is called by metropolis.krige.

Returns

A single number that is the posterior density of the function, which is stored in object of class matrix.

Details

This function finds the posterior density for a kriging model. It is designed to be an internal function but is exported in the hope of it can be useful to some users. The function utilizes information provided about the parameters tau2, phi, sigma2, and beta. It also utilizes the observed data y, X, east, and north. Given a set of parameter values as well as the observed data, the function returns the posterior density for the specified model.

Examples

# Summarize Data summary(ContrivedData) #Initial OLS Model contrived.ols<-lm(y~x.1+x.2,data=ContrivedData);summary(contrived.ols) #Define Covariate Matrix covariates<-cbind(1,ContrivedData$x.1,ContrivedData$x.2) # Find the posterior density for the Contrived Data if all parameters were 1: s.test <- krige.posterior(tau2=1,phi=1,sigma2=1,beta=rep(1,ncol(covariates)), y=ContrivedData$y,X=covariates,east=ContrivedData$s.1,north=ContrivedData$s.2) # Print posterior density s.test

References

Jeff Gill. 2020. Measuring Constituency Ideology Using Bayesian Universal Kriging. State Politics & Policy Quarterly. doi:10.1177/1532440020930197

  • Maintainer: Jason S. Byers
  • License: GPL (>= 2)
  • Last published: 2022-05-01

Useful links