Learn R Programming

DSSP (version 0.1.1)

predict.dsspMod: Predictions from a model with new data.

Description

Predictions from a model with new data.

Usage

# S3 method for dsspMod
predict(object, newdata, ...)

Value

returns matrix with posterior densities for each row in the input data.

Arguments

object

a fitted dsspMod object.

newdata

a data frame for which to evaluate predictions.

...

optional and ignored arguments.

Examples

Run this code
data("meuse.all", package = "gstat")
sp::coordinates(meuse.all) <- ~ x + y
meuse.fit <- DSSP(
  formula = log(zinc) ~ 1, data = meuse.all[1:155, ], N = 100, function(x) -2 * log(1 + x),
  pars = c(0.001, 0.001)
)
preds <- predict(meuse.fit, meuse.all[156:164, ])

Run the code above in your browser using DataLab