Package: mcmcsae 0.8.1

Harm Jan Boonstra

mcmcsae: Markov Chain Monte Carlo Small Area Estimation

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.

Authors:Harm Jan Boonstra [aut, cre], Grzegorz Baltissen [ctb]

mcmcsae_0.8.1.tar.gz
mcmcsae_0.8.1.tar.gz(r-4.7-arm64)mcmcsae_0.8.1.tar.gz(r-4.7-x86_64)mcmcsae_0.8.1.tar.gz(r-4.6-arm64)mcmcsae_0.8.1.tar.gz(r-4.6-x86_64)
mcmcsae_0.8.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
mcmcsae/json (API)

# Install 'mcmcsae' in R:
install.packages('mcmcsae', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))
Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

cpp

2.92 score 14 scripts 422 downloads 96 exports 26 dependencies

Last updated from:e88f32fc7e. Checks:6 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-arm64OK305
linux-devel-x86_64OK340
source / vignettesOK339
linux-release-arm64OK307
linux-release-x86_64OK341
wasm-releaseOK166

Exports:%m*v%acceptance_ratesaggrMatrixAR1bayesR2binomial_controlbrtCGCG_controlchol_controlcMVN_controlcombine_chainscombine_iterscompute_DICcompute_WAICcomputeDesignMatrixcreate_cMVN_samplercreate_samplercreate_TMVN_samplercrossprod_mvcustomf_binomialf_gammaf_gaussianf_gaussian_gammaf_multif_multinomialf_negbinomialf_poissonf_student_tgaussian_controlgengen_controlgenerate_dataget_drawget_meansget_sdsglregGMRF_structureiidlabels<-loom_directm_Gibbsm_HMCm_HMCZigZagm_softTMVNmaximize_log_lh_pmc_offsetmcmcsae_exampleMCMCsimmecmodel_matrixmultinomial_controln_chainsn_drawsn_effn_varsnegbinomial_controlpar_namesplot_coefpoisson_controlpr_betapr_exppr_fixedpr_gammapr_gigpr_invchisqpr_invwishartpr_MLiGpr_normalpr_truncnormalpr_unifR_hatread_drawsregRW1RW2ssampler_controlSBC_testseasonset_constraintsset_MHsetup_clustersim_marg_varspatialsplinesstop_clusterstudent_t_controlto_draws_arrayto_mcmctransform_dcvfacvregwaic

Dependencies:abindbackportscheckmateclicollapsedistributionalgenericsGIGrvggluelatticelifecycleloomagrittrMatrixmatrixStatsnumDerivpillarpkgconfigposteriorRcppRcppEigenrlangtensorAtibbleutf8vctrs

Linear regression, prediction, and survey weighting
Prediction | Weights | Outliers | References

Last update: 2026-07-20
Started: 2020-09-01

Basic area-level model
References

Last update: 2025-06-04
Started: 2020-09-01

Basic unit-level models
Binomial Unit-Level Model | References

Last update: 2025-06-04
Started: 2020-09-01

Readme and manuals

Help Manual

Help pageTopics
Markov Chain Monte Carlo Small Area Estimationmcmcsae-package mcmcsae
Return Metropolis-Hastings acceptance ratesacceptance_rates
Utility function to construct a sparse aggregation matrix from a factoraggrMatrix
Convert a dc_summary object to a data.frameas.data.frame.dc_summary
Convert a mcdraws_summary object to a data.frameas.data.frame.mcdraws_summary
Compute a Bayesian measure of percentage of explained variancebayesR2
Set computational options for the sampling algorithmsbinomial_control
Create a model component object for a BART (Bayesian Additive Regression Trees) component in the linear predictorbrt
Set options for the conjugate gradient (CG) samplerCG_control
Set options for Cholesky decompositionchol_control
Set options for fast sampling from a degenerate multivariate normal distributioncMVN_control
Combine multiple mcdraws objects into a single one by combining their chainscombine_chains
Combine multiple mcdraws objects into a single one by combining their drawscombine_iters
Compute a list of design matrices for all terms in a model formula, or based on a sampler environmentcomputeDesignMatrix
Correlation factor structures in generic model componentsAR1 correlation custom iid RW1 RW2 season spatial splines
Set up a function for direct sampling from a constrained multivariate normal distributioncreate_cMVN_sampler
Create a sampler objectcreate_sampler
Set up a sampler object for sampling from a possibly truncated and degenerate multivariate normal distributioncreate_TMVN_sampler
Specify a binomial sampling distributionf_binomial
Specify a Gamma sampling distributionf_gamma
Specify a Gaussian sampling distributionf_gaussian
Specify a Gaussian-Gamma sampling distributionf_gaussian_gamma
Specify a multi-response sampling distributionf_multi
Specify a multinomial sampling distributionf_multinomial
Specify a negative binomial sampling distributionf_negbinomial
Specify a Poisson sampling distributionf_poisson
Specify a Student-t sampling distributionf_student_t
Set computational options for the sampling algorithmsgaussian_control
Create a model component object for a generic random effects component in the linear predictorgen
Set computational options for the sampling algorithms used for a 'gen' model componentgen_control
Generate a data vector according to a modelgenerate_data
Extract a list of parameter values for a single drawget_draw
Create a model object for group-level regression effects within a generic random effects component.glreg
Set up a GMRF structure for a generic model componentGMRF_structure
Get and set the variable labels of a draws component object for a vector-valued parameterlabels labels.dc labels<-
Fast matrix-vector multiplications%m*v% crossprod_mv matrix-vector
Maximise the log-likelihood or log-posterior as defined by a sampler closuremaximize_log_lh_p
Create a model component object for an offset, i.e. fixed, non-parametrised term in the linear predictormc_offset
Compute MCMC diagnostic measuresMCMC-diagnostics n_eff R_hat
Convert a draws component object to another formatas.array.dc as.matrix.dc MCMC-object-conversion to_draws_array to_mcmc
Generate artificial data according to an additive spatio-temporal modelmcmcsae_example
Run a Markov Chain Monte Carlo simulationMCMCsim
Create a model component object for a regression (fixed effects) component in the linear predictor with measurement errors in quantitative covariatesmec
Compute possibly sparse model matrixmodel_matrix
Compute DIC, WAIC and leave-one-out cross-validation model measurescompute_DIC compute_WAIC loo.mcdraws model-information-criteria waic.mcdraws
Set computational options for the sampling algorithmsmultinomial_control
Get the number of chains, samples per chain or the number of variables in a simulation objectn_chains n_chains-n_draws-n_vars n_draws n_vars
Set computational options for the sampling algorithmsnegbinomial_control
Get the parameter names from an mcdraws objectpar_names
Plot a set of model coefficients or predictions with uncertainty intervals based on summaries of simulation results or other objects.plot_coef
Trace, density and autocorrelation plots for (parameters of a) draws component (dc) objectplot.dc
Trace, density and autocorrelation plotsplot.mcdraws
Set computational options for the sampling algorithmspoisson_control
Get means or standard deviations of parameters from the MCMC output in an mcdraws objectget_means get_sds posterior-moments
Create an object representing beta prior distributionspr_beta
Create an object representing exponential prior distributionspr_exp
Create an object representing a degenerate prior fixing a parameter (vector) to a fixed valuepr_fixed
Create an object representing gamma prior distributionspr_gamma
Create an object representing Generalised Inverse Gaussian (GIG) prior distributionspr_gig
Create an object representing inverse chi-squared priors with possibly modelled degrees of freedom and scale parameterspr_invchisq
Create an object representing an inverse Wishart prior, possibly with modelled scale matrixpr_invwishart
Create an object representing a Multivariate Log inverse Gamma (MLiG) prior distributionpr_MLiG
Create an object representing a possibly multivariate normal prior distributionpr_normal
Create an object representing truncated normal prior distributionspr_truncnormal
Create an object representing uniform prior distributionspr_unif
Generate draws from the predictive distributionpredict.mcdraws
Display a summary of a 'dc' objectprint.dc_summary
Print a summary of MCMC simulation resultsprint.mcdraws_summary
Read MCMC draws from a fileread_draws
Specify a regression (fixed effects) component in the linear predictorreg
Extract draws of fitted values or residuals from an mcdraws objectfitted.mcdraws residuals-fitted-values residuals.mcdraws
Specify a smooth term component of the linear predictors
Set computational options for the sampling algorithmssampler_control
Simulation based calibrationSBC_test
Set up a system of linear equality and/or inequality constraintsset_constraints
Set options for Metropolis-Hastings samplingset_MH
Set up a cluster for parallel computingsetup_cluster
Compute a Monte Carlo estimate of the marginal variances of a (I)GMRFsim_marg_var
Stop a clusterstop_cluster
Set (MCMC) computational options for a Student-t likelihood modelstudent_t_control
Select a subset of chains, samples and parameters from a draws component (dc) objectsubset.dc
Summarise a draws component (dc) objectsummary.dc
Summarise an mcdraws objectsummary.mcdraws
Functions for specifying the method and corresponding options for sampling from a possibly truncated and degenerate multivariate normal distributionm_direct m_Gibbs m_HMC m_HMCZigZag m_softTMVN TMVN-methods
Transform one or more draws component objects into a new one by applying a functiontransform_dc
Create a model component object for a variance factor component in the variance function of a gaussian sampling distributionvfac
Create a model component object for a regression component in the variance function of a gaussian sampling distributionvreg
Extract weights from an mcdraws objectweights.mcdraws