Learn R Programming

mcmcsae (version 0.8.1)

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

602

Version

0.8.1

License

GPL-3

Maintainer

Harm Jan Boonstra

Last Published

July 20th, 2026

Functions in mcmcsae (0.8.1)

create_cMVN_sampler

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

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

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

Create a sampler object
computeDesignMatrix

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

Combine multiple mcdraws objects into a single one by combining their chains
f_gamma

Specify a Gamma sampling distribution
correlation

Correlation factor structures in generic model components
f_binomial

Specify a binomial sampling distribution
create_block_cMVN_sampler

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

Specify a Student-t sampling distribution
gen_control

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

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

Set computational options for the sampling algorithms
f_multinomial

Specify a multinomial sampling distribution
f_negbinomial

Specify a negative binomial sampling distribution
glreg

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

Specify a Poisson sampling distribution
f_multi

Specify a multi-response sampling distribution
generate_data

Generate a data vector according to a model
get_draw

Extract a list of parameter values for a single draw
f_gaussian_gamma

Specify a Gaussian-Gamma sampling distribution
f_gaussian

Specify a Gaussian sampling distribution
mec

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

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

Generate artificial data according to an additive spatio-temporal model
multinomial_control

Set computational options for the sampling algorithms
mcmcsae-package

Markov Chain Monte Carlo Small Area Estimation
mc_offset

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

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

Trace, density and autocorrelation plots
n_chains-n_draws-n_vars

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

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

Set computational options for the sampling algorithms
plot_coef

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

Fast matrix-vector multiplications
pr_gig

Create an object representing Generalised Inverse Gaussian (GIG) prior distributions
model-information-criteria

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

Compute possibly sparse model matrix
maximize_log_lh_p

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

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

Create an object representing gamma prior distributions
par_names

Get the parameter names from an mcdraws object
negbinomial_control

Set computational options for the sampling algorithms
pr_normal

Create an object representing a possibly multivariate normal prior distribution
pr_invwishart

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

Create an object representing exponential prior distributions
pr_beta

Create an object representing beta prior distributions
pr_unif

Create an object representing uniform prior distributions
print.dc_summary

Display a summary of a dc object
pr_truncnormal

Create an object representing truncated normal prior distributions
reexports

Objects exported from other packages
reg

Specify a regression (fixed effects) component in the linear predictor
predict.mcdraws

Generate draws from the predictive distribution
s

Specify a smooth term component of the linear predictor
residuals-fitted-values

Extract draws of fitted values or residuals from an mcdraws object
print.mcdraws_summary

Print a summary of MCMC simulation results
set_MH

Set options for Metropolis-Hastings sampling
set_constraints

Set up a system of linear equality and/or inequality constraints
posterior-moments

Get means or standard deviations of parameters from the MCMC output in an mcdraws object
read_draws

Read MCMC draws from a file
summary.dc

Summarise a draws component (dc) object
sampler_control

Set computational options for the sampling algorithms
pr_MLiG

Create an object representing a Multivariate Log inverse Gamma (MLiG) prior distribution
subset.dc

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

Set (MCMC) computational options for a Student-t likelihood model
stop_cluster

Stop a cluster
sim_marg_var

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

Set up conjugate gradient sampler
setup_cluster

Set up a cluster for parallel computing
weights.mcdraws

Extract weights from an mcdraws object
transform_dc

Transform one or more draws component objects into a new one by applying a function
summary.mcdraws

Summarise an mcdraws object
vfac

Create a model component object for a variance factor component in the variance function of a gaussian sampling distribution
vreg

Create a model component object for a regression component in the variance function of a gaussian sampling distribution
tabMatrix-indexing

S4 method for row and column subsetting a 'tabMatrix'
TMVN-methods

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

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

Simulation based calibration
MCMCsim

Run a Markov Chain Monte Carlo simulation
GMRF_structure

Set up a GMRF structure for a generic model component
CG_control

Set options for the conjugate gradient (CG) sampler
MCMC-diagnostics

Compute MCMC diagnostic measures
MCMC-object-conversion

Convert a draws component object to another format
as.data.frame.dc_summary

Convert a dc_summary object to a data.frame
brt

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

Set computational options for the sampling algorithms
cMVN_control

Set options for fast sampling from a degenerate multivariate normal distribution
aggrMatrix

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

Return Metropolis-Hastings acceptance rates
Matrix-methods

S4 methods for products of matrix objects
CG

Solve Ax=b by preconditioned conjugate gradients
anyNA,tabMatrix-method

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

Set options for Cholesky decomposition
as.data.frame.mcdraws_summary

Convert a mcdraws_summary object to a data.frame
bayesR2

Compute a Bayesian measure of percentage of explained variance