R/all_func.R
predict.ssnbayes.Rd
It will take an observed and a prediction data frame. It requires the same number of observation/locations per day. It requires location id (locID) and points id (pid). The locID are unique for each site. The pid is unique for each observation. Missing values are allowed in the response but not in the covariates.
# S3 method for ssnbayes
predict(
object = object,
...,
path = path,
obs_data = obs_data,
pred_data = pred_data,
net = net,
nsamples = nsamples,
addfunccol = addfunccol,
locID_pred = locID_pred,
chunk_size = chunk_size,
seed = seed
)
A stanfit object returned from ssnbayes
Other parameters
Path with the name of the SSN object
The observed data frame
The predicted data frame
(optional) Network from the SSN object
The number of samples to draw from the posterior distributions. (nsamples <= iter)
The variable used for spatial weights
(optional) the location id for the predictions. Used when the number of pred locations is large.
(optional) the number of locID to make prediction from
(optional) A seed for reproducibility
A data frame
# \donttest{
#require('SSNdata')
#clear_preds <- readRDS(system.file("extdata/clear_preds.RDS", package = "SSNdata"))
#clear_preds$y <- NA
#pred <- predict(object = fit_ar,
# path = path,
# obs_data = clear,
# pred_data = clear_preds,
# net = 2,
# nsamples = 100, # numb of samples from the posterior
# addfunccol = 'afvArea', # var for spatial weights
# locID_pred = locID_pred,
# chunk_size = 60)
# }