residuals.dsspMod {DSSP}R Documentation

Get residuals from dsspMod model

Description

Get residuals from dsspMod model

Usage

## S3 method for class 'dsspMod'
residuals(object, newdata, robust = TRUE, ...)

Arguments

object

an object of class dsspMod

newdata

a data frame for which to estimate residuals.

robust

whether or not to use median (rather than mean) of posterior density to as estimate calculate residuals.

...

additional arguments which are ignored.

Value

vector containing residuals with same length as rows in data used.

Examples

library(sp)
library(gstat)
data(meuse.all)
coordinates(meuse.all) <- ~ x + y

f <- function(x) -x ## log-prior for exponential distribution for the smoothing parameter

## Draw 100 samples from the posterior of eta given the data y.
OUTPUT <- DSSP(
  formula = log(zinc) ~ 1, data = meuse.all, N = 100,
  pars = c(0.001, 0.001), log_prior = f
)
residuals(OUTPUT)

[Package DSSP version 0.1.1 Index]