Package: mcmcsae 0.7.8

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.7.8.tar.gz
mcmcsae_0.7.8.zip(r-4.5)mcmcsae_0.7.8.zip(r-4.4)mcmcsae_0.7.8.zip(r-4.3)
mcmcsae_0.7.8.tgz(r-4.5-x86_64)mcmcsae_0.7.8.tgz(r-4.5-arm64)mcmcsae_0.7.8.tgz(r-4.4-x86_64)mcmcsae_0.7.8.tgz(r-4.4-arm64)mcmcsae_0.7.8.tgz(r-4.3-x86_64)mcmcsae_0.7.8.tgz(r-4.3-arm64)
mcmcsae_0.7.8.tar.gz(r-4.5-noble)mcmcsae_0.7.8.tar.gz(r-4.4-noble)
mcmcsae_0.7.8.tgz(r-4.4-emscripten)mcmcsae_0.7.8.tgz(r-4.3-emscripten)
mcmcsae.pdf |mcmcsae.html
mcmcsae/json (API)
NEWS

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

On CRAN:

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

cpp

2.78 score 8 scripts 279 downloads 82 exports 26 dependencies

Last updated 2 months agofrom:3782e0840b. Checks:11 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 09 2025
R-4.5-win-x86_64OKFeb 09 2025
R-4.5-mac-x86_64OKFeb 09 2025
R-4.5-mac-aarch64OKFeb 09 2025
R-4.5-linux-x86_64OKFeb 09 2025
R-4.4-win-x86_64OKFeb 09 2025
R-4.4-mac-x86_64OKFeb 09 2025
R-4.4-mac-aarch64OKFeb 09 2025
R-4.3-win-x86_64OKFeb 09 2025
R-4.3-mac-x86_64OKFeb 09 2025
R-4.3-mac-aarch64OKFeb 09 2025

Exports:%m*v%acceptance_ratesaggrMatrixAR1brtCGCG_controlchol_controlcombine_chainscombine_iterscompute_DICcompute_WAICcomputeDesignMatrixcreate_cMVN_samplercreate_samplercreate_TMVN_samplercrossprod_mvcustomf_binomialf_gammaf_gaussianf_gaussian_gammaf_multinomialf_negbinomialf_poissongengen_controlgenerate_dataget_drawget_meansget_sdsglregGMRF_structureiidlabels<-m_directm_Gibbsm_HMCm_HMCZigZagm_softTMVNmaximize_log_lh_pmc_offsetmcmcsae_exampleMCMCsimmecmodel_matrixn_chainsn_drawsn_effn_varspar_namesplot_coefpr_betapr_exppr_fixedpr_gammapr_gigpr_invchisqpr_invwishartpr_MLiGpr_normalpr_truncnormalpr_unifR_hatread_drawsregRW1RW2sampler_controlSBC_testseasonset_MHsetup_clustersim_marg_varspatialsplinestop_clusterto_draws_arrayto_mcmctransform_dcvfacvreg

Dependencies:abindbackportscheckmateclidistributionalfansigenericsGIGrvggluelatticelifecycleloomagrittrMatrixmatrixStatsnumDerivpillarpkgconfigposteriorRcppRcppEigenrlangtensorAtibbleutf8vctrs

Basic area-level model

Rendered fromarea_level.Rmdusingknitr::rmarkdownon Feb 09 2025.

Last update: 2023-12-03
Started: 2020-09-01

Basic unit-level models

Rendered fromunit_level.Rmdusingknitr::rmarkdownon Feb 09 2025.

Last update: 2023-12-03
Started: 2020-09-01

Linear regression, prediction, and survey weighting

Rendered fromlinear_weighting.Rmdusingknitr::rmarkdownon Feb 09 2025.

Last update: 2023-10-10
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
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
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 spline
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
Functions for specifying a sampling distribution and link functionf_binomial f_gamma f_gaussian f_gaussian_gamma f_multinomial f_negbinomial f_poisson mcmcsae-family
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 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
Maximize 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-parametrized 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
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
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
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 Generalized Inverse Gaussian (GIG) prior distributionspr_gig
Create an object representing inverse chi-squared priors with possibly modeled degrees of freedom and scale parameterspr_invchisq
Create an object representing an inverse Wishart prior, possibly with modeled 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
Create a model component object for 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
Set computational options for the sampling algorithmssampler_control
Simulation based calibrationSBC_test
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
Select a subset of chains, samples and parameters from a draws component (dc) objectsubset.dc
Summarize a draws component (dc) objectsummary.dc
Summarize 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