Learn R Programming

BSTFA (version 0.1.0)

Bayesian Spatio-Temporal Factor Analysis Model

Description

Implements Bayesian spatio-temporal factor analysis models for multivariate data observed across space and time. The package provides tools for model fitting via Markov chain Monte Carlo (MCMC), spatial and temporal interpolation, and visualization of latent factors and loadings to support inference and exploration of underlying spatio-temporal patterns. Designed for use in environmental, ecological, or public health applications, with support for posterior prediction and uncertainty quantification. Includes functions such as BSTFA() for model fitting and plot_factor() to visualize the latent processes. Functions are based on and extended from methods described in Berrett, et al. (2020) .

Copy Link

Version

Install

install.packages('BSTFA')

Monthly Downloads

144

Version

0.1.0

License

GPL (>= 2)

Maintainer

Candace Berrett

Last Published

August 28th, 2025

Functions in BSTFA (0.1.0)

plot_trace

Plot trace plots
plot_fourier_bases

Visualize fourier bases.
plot_factor

Plot the temporally-dependent factors.
plot_spatial_param

Plot the spatially-dependent parameter for in-sample locations.
utahDataList

Utah Minimum Temperatures
plot_location

Plot a location's time series of estimated/predicted values.
predictBSTFA

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

Output of BSTFA evaluated on a subset of utahDataList
bisquare1d

Bisquare bases for 1-dimensional space
BSTFA

Reduced BSTFA function
bisquare2d

Bisquare bases for 2-dimensional space
makePredS

Create a matrix of bisquare bases for new locations.
computeLogLik

Compute log-likelihood
defineRegion

Define the initial region of interest.
makeNewS

Create a matrix of bisquare bases for a set of locations.
BSTFAfull

Full BSTFA function
compute_summary

Print computation summary
convergence_diag

Check effective sample size and geweke diagnostic
map_spatial_param

Plot a map of interpolated spatially-dependent parameter values.
plot_annual

Plot annual/seasonal behavior at a specific location.