50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

mcmcsae (version 0.7.9)

Markov Chain Monte Carlo Small Area Estimation

Description

Fit multi-level models with possibly correlated random effects using Markov Chain Monte Carlo simulation. Such models allow smoothing over space and time and are useful in, for example, small area estimation.

Copy Link

Version

Install

install.packages('mcmcsae')

Monthly Downloads

195

Version

0.7.9

License

GPL-3

Maintainer

Harm Jan Boonstra

Last Published

June 4th, 2025

Functions in mcmcsae (0.7.9)

combine_iters

Combine multiple mcdraws objects into a single one by combining their draws
aggrMatrix

Utility function to construct a sparse aggregation matrix from a factor
acceptance_rates

Return Metropolis-Hastings acceptance rates
combine_chains

Combine multiple mcdraws objects into a single one by combining their chains
anyNA,tabMatrix-method

S4 method for generic 'anyNA' and signature 'tabMatrix'
brt

Create a model component object for a BART (Bayesian Additive Regression Trees) component in the linear predictor
create_TMVN_sampler

Set up a sampler object for sampling from a possibly truncated and degenerate multivariate normal distribution
correlation

Correlation factor structures in generic model components
chol_control

Set options for Cholesky decomposition
computeDesignMatrix

Compute a list of design matrices for all terms in a model formula, or based on a sampler environment
create_block_cMVN_sampler

Set up a a function for direct sampling from a constrained multivariate normal distribution
f_multinomial

Specify a multinomial sampling distribution
f_gaussian_gamma

Specify a Gaussian-Gamma sampling distribution
f_gamma

Specify a Gamma sampling distribution
f_negbinomial

Specify a negative binomial sampling distribution
f_poisson

Specify a Poisson sampling distribution
glreg

Create a model object for group-level regression effects within a generic random effects component.
labels

Get and set the variable labels of a draws component object for a vector-valued parameter
maximize_log_lh_p

Maximise the log-likelihood or log-posterior as defined by a sampler closure
f_gaussian

Specify a Gaussian sampling distribution
par_names

Get the parameter names from an mcdraws object
matrix-vector

Fast matrix-vector multiplications
gen_control

Set computational options for the sampling algorithms used for a 'gen' model component
plot_coef

Plot a set of model coefficients or predictions with uncertainty intervals based on summaries of simulation results or other objects.
mcmcsae_example

Generate artificial data according to an additive spatio-temporal model
plot.dc

Trace, density and autocorrelation plots for (parameters of a) draws component (dc) object
create_cMVN_sampler

Set up a function for direct sampling from a constrained multivariate normal distribution
plot.mcdraws

Trace, density and autocorrelation plots
gen

Create a model component object for a generic random effects component in the linear predictor
create_sampler

Create a sampler object
f_binomial

Specify a binomial sampling distribution
pr_gig

Create an object representing Generalised Inverse Gaussian (GIG) prior distributions
pr_gamma

Create an object representing gamma prior distributions
poisson_control

Set computational options for the sampling algorithms
mec

Create a model component object for a regression (fixed effects) component in the linear predictor with measurement errors in quantitative covariates
mc_offset

Create a model component object for an offset, i.e. fixed, non-parametrised term in the linear predictor
pr_invchisq

Create an object representing inverse chi-squared priors with possibly modelled degrees of freedom and scale parameters
pr_invwishart

Create an object representing an inverse Wishart prior, possibly with modelled scale matrix
pr_exp

Create an object representing exponential prior distributions
posterior-moments

Get means or standard deviations of parameters from the MCMC output in an mcdraws object
n_chains-n_draws-n_vars

Get the number of chains, samples per chain or the number of variables in a simulation object
generate_data

Generate a data vector according to a model
get_draw

Extract a list of parameter values for a single draw
mcmcsae-package

Markov Chain Monte Carlo Small Area Estimation
pr_beta

Create an object representing beta prior distributions
pr_MLiG

Create an object representing a Multivariate Log inverse Gamma (MLiG) prior distribution
model-information-criteria

Compute DIC, WAIC and leave-one-out cross-validation model measures
model_matrix

Compute possibly sparse model matrix
pr_normal

Create an object representing a possibly multivariate normal prior distribution
pr_fixed

Create an object representing a degenerate prior fixing a parameter (vector) to a fixed value
set_MH

Set options for Metropolis-Hastings sampling
set_constraints

Set up a system of linear equality and/or inequality constraints
pr_unif

Create an object representing uniform prior distributions
predict.mcdraws

Generate draws from the predictive distribution
residuals-fitted-values

Extract draws of fitted values or residuals from an mcdraws object
pr_truncnormal

Create an object representing truncated normal prior distributions
subset.dc

Select a subset of chains, samples and parameters from a draws component (dc) object
summary.dc

Summarise a draws component (dc) object
sampler_control

Set computational options for the sampling algorithms
transform_dc

Transform one or more draws component objects into a new one by applying a function
vfac

Create a model component object for a variance factor component in the variance function of a gaussian sampling distribution
summary.mcdraws

Summarise an mcdraws object
setup_CG_sampler

Set up conjugate gradient sampler
reg

Create a model component object for a regression (fixed effects) component in the linear predictor
sim_marg_var

Compute a Monte Carlo estimate of the marginal variances of a (I)GMRF
stop_cluster

Stop a cluster
read_draws

Read MCMC draws from a file
setup_cluster

Set up a cluster for parallel computing
vreg

Create a model component object for a regression component in the variance function of a gaussian sampling distribution
weights.mcdraws

Extract weights from an mcdraws object
tabMatrix-indexing

S4 method for row and column subsetting a 'tabMatrix'
print.dc_summary

Display a summary of a dc object
print.mcdraws_summary

Print a summary of MCMC simulation results
negbin_control

Set computational options for the sampling algorithms
Matrix-methods

S4 methods for products of matrix objects
CG_control

Set options for the conjugate gradient (CG) sampler
TMVN-methods

Functions for specifying the method and corresponding options for sampling from a possibly truncated and degenerate multivariate normal distribution
MCMCsim

Run a Markov Chain Monte Carlo simulation
MCMC-object-conversion

Convert a draws component object to another format
GMRF_structure

Set up a GMRF structure for a generic model component
SBC_test

Simulation based calibration
CG

Solve Ax=b by preconditioned conjugate gradients
ac_fft

Compute autocovariance or autocorrelation function via Wiener-Khinchin theorem using Fast Fourier Transform
MCMC-diagnostics

Compute MCMC diagnostic measures