Learn R Programming

DIFM (version 1.0.1)

Dynamic ICAR Spatiotemporal Factor Models

Description

Bayesian factor models are effective tools for dimension reduction. This is especially applicable to multivariate large-scale datasets. It allows researchers to understand the latent factors of the data which are the linear or non-linear combination of the variables. Dynamic Intrinsic Conditional Autocorrelative Priors (ICAR) Spatiotemporal Factor Models 'DIFM' package provides function to run Markov Chain Monte Carlo (MCMC), evaluation methods and visual plots from Shin and Ferreira (2023). Our method is a class of Bayesian factor model which can account for spatial and temporal correlations. By incorporating these correlations, the model can capture specific behaviors and provide predictions.

Copy Link

Version

Install

install.packages('DIFM')

Monthly Downloads

151

Version

1.0.1

License

GPL (>= 2)

Maintainer

Hwasoo Shin

Last Published

November 11th, 2025

Functions in DIFM (1.0.1)

marginal_d_cpp

Marginal predictive density
marginal.d

Marginal predictive density
difm.model.attributes

Initialize model attributes for DIFM
permutation.order

Order of permutation by the largest absolute value in each eigenvector
DIFMcpp

Run Dynamic ICAR Factors Model (DIFM), with C++ codes
difm.hyp.parm

Hyperparameters for DIFM
buildH

Spatial dependence matrix of the factor loadings
Violent

Violent crime data in United States
DIFMR

Run Dynamic ICAR Factors Model (DIFM)
permutation.scale

Permute the dataset by the largest absolute value in each eigenvector, and scale
plot_B.CI

Credible interval plot of factor loadings
plot_tau.CI

Credible interval plot of factor loadings variance
plot_sigma2.CI

A credible interval plot of posterior of sigma squared
plot_X.CI

Credible interval plot of common factors
plot_B.spatial

Spatial plots of factor loadings
DIFM-package

tools:::Rd_package_title("DIFM")
Property

Property crime in United States
WestStates

Westen states in United States