Use predict.ssnbayes() instead. 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.

pred_ssnbayes(
  object = object,
  path = path,
  obs_data = obs_data,
  pred_data = pred_data,
  net = 1,
  nsamples = 100,
  addfunccol = "afvArea",
  locID_pred = locID_pred,
  chunk_size = chunk_size,
  seed = seed
)

Arguments

object

A stanfit object returned from ssnbayes

path

Path with the name of the SSN object

obs_data

The observed data frame

pred_data

The predicted data frame

net

(optional) Network from the SSN object

nsamples

The number of samples to draw from the posterior distributions. (nsamples <= iter)

addfunccol

The variable used for spatial weights

locID_pred

(optional) the location id for the predictions. Used when the number of pred locations is large.

chunk_size

(optional) the number of locID to make prediction from

seed

(optional) A seed for reproducibility

Value

A data frame

Author

Edgar Santos-Fernandez

Examples

#pred <- pred_ssnbayes(path = path,
#obs_data = clear,
#stanfit = fit_ar,
#pred_data = preds,
#net = 2,
#nsamples = 100, # number of samples to use from the posterior in the stanfit object
#addfunccol = 'afvArea') # variable used for spatial weights