Learn R Programming

mcmcsae (version 0.7.8)

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

238

Version

0.7.8

License

GPL-3

Maintainer

Harm Jan Boonstra

Last Published

December 11th, 2024

Functions in mcmcsae (0.7.8)

aggrMatrix

Utility function to construct a sparse aggregation matrix from a factor
anyNA,tabMatrix-method

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

Set options for the conjugate gradient (CG) sampler
matrix-vector

Fast matrix-vector multiplications
brt

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

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

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

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

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

Correlation factor structures in generic model components
mec

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

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

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

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

Create a sampler object
f_gamma

Functions for specifying a sampling distribution and link function
mcmcsae-package

Markov Chain Monte Carlo Small Area Estimation
glreg

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

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

Extract a list of parameter values for a single draw
model-information-criteria

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

Compute possibly sparse model matrix
posterior-moments

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

Create an object representing a Multivariate Log inverse Gamma (MLiG) prior distribution
pr_gamma

Create an object representing gamma prior distributions
pr_beta

Create an object representing beta prior distributions
pr_normal

Create an object representing a possibly multivariate normal prior distribution
generate_data

Generate a data vector according to a model
gen_control

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

Create an object representing truncated normal prior distributions
set_MH

Set options for Metropolis-Hastings sampling
setup_CG_sampler

Set up conjugate gradient sampler
pr_gig

Create an object representing Generalized Inverse Gaussian (GIG) prior distributions
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
pr_unif

Create an object representing uniform prior distributions
predict.mcdraws

Generate draws from the predictive distribution
summary.dc

Summarize a draws component (dc) object
print.mcdraws_summary

Print a summary of MCMC simulation results
stop_cluster

Stop a cluster
print.dc_summary

Display a summary of a dc object
subset.dc

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

Summarize an mcdraws object
weights.mcdraws

Extract weights from an mcdraws object
reg

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

Read MCMC draws from a file
plot.dc

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

Trace, density and autocorrelation plots
maximize_log_lh_p

Maximize the log-likelihood or log-posterior as defined by a sampler closure
mc_offset

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

Set up a cluster for parallel computing
sim_marg_var

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

Set computational options for the sampling algorithms
residuals-fitted-values

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

Get the parameter names from an mcdraws object
pr_exp

Create an object representing exponential prior distributions
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
transform_dc

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

Create an object representing an inverse Wishart prior, possibly with modeled scale matrix
pr_invchisq

Create an object representing inverse chi-squared priors with possibly modeled degrees of freedom and scale parameters
tabMatrix-indexing

S4 method for row and column subsetting a 'tabMatrix'
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
TMVN-methods

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

Compute MCMC diagnostic measures
GMRF_structure

Set a GMRF structure for a generic model component
MCMC-object-conversion

Convert a draws component object to another format
CG

Solve Ax=b by preconditioned conjugate gradients
Matrix-methods

S4 methods for products of matrix objects
acceptance_rates

Return Metropolis-Hastings acceptance rates
combine_iters

Combine multiple mcdraws objects into a single one by combining their draws
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