Learn R Programming

bmstdr (version 0.8.2)

Bayesian Modeling of Spatio-Temporal Data with R

Description

Fits, validates and compares a number of Bayesian models for spatial and space time point referenced and areal unit data. Model fitting is done using several packages: 'rstan', 'INLA', 'spBayes', 'spTimer', 'spTDyn', 'CARBayes' and 'CARBayesST'. Model comparison is performed using the DIC and WAIC, and K-fold cross-validation where the user is free to select their own subset of data rows for validation. Sahu (2022) describes the methods in detail.

Copy Link

Version

Install

install.packages('bmstdr')

Monthly Downloads

328

Version

0.8.2

License

GPL-2

Maintainer

Sujit K. Sahu

Last Published

March 31st, 2025

Functions in bmstdr (0.8.2)

argo_floats_atlantic_2003

Temperature and salinity data from Argo floats in the North Atlantic Ocean at three layers of depth: surface (less than 50 meters), mid-layer (between 475-525 meters) and deep (975 to 1025 meters) during 2003.
Bsptime

Bayesian regression model fitting for point referenced spatio-temporal data. Calculates parameter estimates, validation statistics, and estimated values of several Bayesian model choice criteria.
Bcartime

Bayesian regression model fitting for areal and areal spatio-temporal data. Calculates parameter estimates, validation statistics, and estimated values of several Bayesian model choice criteria.
Bnormal

N(theta, sigma2): Using different methods.
bmstdr_variogram

Calculates and plots the variogram cloud and an estimated variogram.
BCauchy

Cauchy prior simulation example.
Bmchoice

Model choice criteria calculation for univariate normal model for both known and unknown sigma^2
Bmoving_sptime

Model fitting and validation for spatio-temporal data from moving sensors in time.
Bspatial

Bayesian regression model fitting for point referenced spatial data. Calculates parameter estimates, validation statistics, and estimated values of several Bayesian model choice criteria.
Weng

A 313 by 313 proximity matrix for the 313 LADCUAS in England. Each entry is either 0 or 1 and is 1 if the corresponding row and column LADCUAs share a common boundary.
engtotals

Total number of weekly Covid-19 deaths and cases in the 313 local Local Authority Districts, Counties and Unitary Authorities (LADCUA) in England during the first peak from March 13 to July 31, 2020.
calculate_validation_statistics

Calculates the four validation statistics: RMSE, MAE, CRPS and coverage given the observed values and MCMC iterates.
coef.bmstdr

Prints and returns the estimates of the coefficients
fitted.bmstdr

Extract fitted values from bmstdr objects.
fnc.delete.map.XYZ

This function is used to delete values outside the state of New York
calculate_dic

Calculate DIC function. Has two arguments: (1) log full likelihood at thetahat and (2) vector of log-likelihood at the theta samples Calculate the DIC criteria values
fig11.13.plot

Draws a time series (ribbon) plot by combining fitted and predicted values
calculate_waic

Calculate WAIC function. Has the sole argument component wise likelihood at thetahat samples. v must be a matrix Calculate the WAIC criteria values
get_parameter_estimates

Obtains parameter estimates from MCMC samples
colpalette

The color palette used to draw maps to illustrate the package bmstdr, see Sahubook;textualbmstdr It has the values in order: dodgerblue4, dodgerblue2, firebrick2, firebrick4 and purple.
engdeaths

Number of weekly Covid-19 deaths and cases in the 313 local Local Authority Districts, Counties and Unitary Authorities (LADCUA) in England during the 20 peaks in the first peak from March 13 to July 31, 2020.
get_validation_summaries

Obtains suitable validation summary statistics from MCMC samples obtained for validation.
is.bmstdr

Is it a bmstdr model fitted object?
materncov

Banerjee, Carlin and Gelfand (2015) Mat'ern covariance function
plot.bmstdr

Plot method for bmstdr objects.
maternfun

Banerjee et al Mat'ern covariance function
getvalidrows

Returns a vector of row numbers for validation.
nyspatial

Average ozone concentration values and three covariates from 28 sites in New York.
gridnyspatial

Values of three covariates for 100 grid locations in New York averaged over the 62 days during the months of July and August, 2006.
phichoice_sp

Grid search method for choosing phi Calculates the validation statistics using the spatial model with a given range of values of the decay parameter phi.
hitandfalsealarm

Calculate the hit and false alarm rates
resid.bmstdr

Extract residuals from a bmstdr fitted object.
residuals.bmstdr

Extract residuals from a bmstdr fitted object.
phichoicep

Calculates the validation statistics using the spatial model with a given range of values of the decay parameter phi.
print.bmstdr

Provides basic information regarding the fitted model.
gridnysptime

Values of three covariates for 100 grid locations in New York for the 62 days during the months of July and August, 2006.
summary.bmstdr

Provides basic summaries of model fitting.
obs_v_pred_plot

Observed against predicted plot
terms.bmstdr

Prints the terms
nysptime

Daily 8-hour maximum ozone concentration values and three covariates from 28 sites in New York for the 62 days during the months of July and August, 2006.
ydata

Average air pollution values from 28 sites in New York.