Plot a location's time series of estimated/predicted values.
plot_location(
out,
location,
new_x = NULL,
type = "mean",
par.mfrow = c(1, 1),
pred.int = FALSE,
ci.level = c(0.025, 0.975),
uncertainty = TRUE,
xrange = NULL,
truth = FALSE,
ylim = NULL
)A plot of predicted values for location.
Output from BSTFA or BSTFAfull.
Either a single integer indicating the location in the data set to plot or a vector of length 2 providing the longitude and latitude of the new location.
If the original model included covariates x, include the same covariates for prediction location.
One of mean (default), median, ub, or lb indicating which summary statistic of the predicted values to return.
A vector of length 2 indicating the number of rows and columns to divide the plotting window. Default is c(1,1).
Logical scalar indicating whether the interval should be a posterior predictive interval (TRUE) or a posterior credible interval (FALSE; default).
If type='lb' or 'ub', the percentiles for the posterior interval.
Logical scalar indicating whether to plot the uncertainty bounds (TRUE; default) or not.
A date vector of length 2 providing the lower and upper bounds of the dates to include in the plot.
Logical scalar indicating whether to include the observed measurements (TRUE) or not (default). If TRUE, location must be an integer corresponding to the column of the data matrix for the in-sample prediction location.
Numeric vector of length 2 providing the lower and upper bounds of the y-axis. If NULL (default), the y-axis limits are chosen using the range of the predictions.
Candace Berrett and Adam Simpson
data(out.sm)
attach(out.sm)
plot_location(out.sm, location=1, pred.int=FALSE)
Run the code above in your browser using DataLab