Learn R Programming

BSTFA (version 0.1.0)

predictBSTFA: Estimate/predict values of the time series at a specific location.

Description

Estimate/predict values of the time series at a specific location.

Usage

predictBSTFA(
  out,
  location = NULL,
  type = "mean",
  ci.level = c(0.025, 0.975),
  new_x = NULL,
  pred.int = FALSE
)

Value

A matrix or vector of estimated/predicted values for location.

Arguments

out

Output from BSTFA or BSTFAfull.

location

Either a single integer indicating the location in the data set to provide predictions or a vector of length 2 providing the longitude and latitude of the new location. If location=NULL (default), the function will return predictions for all in-sample locations.

type

One of all, mean (default), median, ub, or lb indicating which summary statistic of the predicted values to return.

ci.level

If type='lb' or 'ub', the percentiles for the posterior interval.

new_x

If the original model included covariates x, include the same covariates for prediction location.

pred.int

Logical scalar indicating whether to include additional uncertainty for posterior predictive intervals (TRUE) or not (FALSE; default -- intervals represent posterior probabilities around the mean of location).

Author

Candace Berrett and Adam Simpson

Examples

Run this code
data(out.sm)
attach(out.sm)
loc1means <- predictBSTFA(out.sm, location=1, pred.int=FALSE)

Run the code above in your browser using DataLab