Plot a map of interpolated spatially-dependent parameter values.
map_spatial_param(
out,
parameter = "slope",
loadings = 1,
type = "mean",
yearscale = TRUE,
new_x = NULL,
ci.level = c(0.025, 0.975),
fine = 100,
color.gradient = (grDevices::colorRampPalette(rev(RColorBrewer::brewer.pal(9, name =
"RdBu"))))(fine),
with.uncertainty = FALSE,
map = FALSE,
state = FALSE,
location = NULL,
addthin = 1
)A plot of spatially-dependent parameter values for a grid of interpolated locations.
Output from BSTFA or BSTFAfull.
One of 'slope' (default), 'loading', or 'mean'.
If parameter='loading', an integer indicating which factor loading to plot.
One of mean (default), median, ub, or lb indicating which summary statistic to plot at each location.
If parameter='slope', a logical scalar indicating whether to translate it to a yearly scale (TRUE; default).
If the original model included covariates x, include the same covariates for prediction location.
If type='lb' or 'ub', the percentiles for the posterior interval.
Integer specifying the number of grid points along both the longitude and latitude directions used to interpolate the parameter. The resulting interpolation grid will contain fine*fine total locations. If map=TRUE, state=TRUE, and location is specified, the grid will be clipped to the boundaries of the specified state, removing locations outside of it.
The color palette to use for the plot. Default is colorRampPalette(rev(RColorBrewer::brewer.pal(9, name='RdBu')))(fine).
Logical scalar indicating whether to include lower and upper credible interval bounds for the parameter. Default is FALSE.
Logical scalar indicating whether to include a map. Default value is FALSE. If TRUE, location must be specified.
Logical scalar used when map=TRUE indicating whether the location is a state in the United States (TRUE) or a country (FALSE).
Name of region to include in the map. Fed to region in the function ggplot2::map_data.
Integer indicating the number of saved draws to thin. Default is to not thin any addthin=1. This can save time when the object is from BSTFAfull and parameter='loading'.
Adam Simpson and Candace Berrett
data(out.sm)
attach(out.sm)
map_spatial_param(out.sm, parameter='slope', map=TRUE, state=TRUE, location='utah', fine=25)
Run the code above in your browser using DataLab