| tidy_mcmc_sampling {TidyDensity} | R Documentation |
Tidy MCMC Sampling
Description
This function performs Markov Chain Monte Carlo (MCMC) sampling on the input data and returns tidy data and a plot representing the results.
Usage
tidy_mcmc_sampling(.x, .fns = "mean", .cum_fns = "cmean", .num_sims = 2000)
Arguments
.x |
The data vector for MCMC sampling. |
.fns |
The function(s) to apply to each MCMC sample. Default is "mean". |
.cum_fns |
The function(s) to apply to the cumulative MCMC samples. Default is "cmean". |
.num_sims |
The number of simulations. Default is 2000. |
Details
Perform MCMC sampling and return tidy data and a plot.
The function takes a data vector as input and performs MCMC sampling with the specified number of simulations. It applies user-defined functions to each MCMC sample and to the cumulative MCMC samples. The resulting data is formatted in a tidy format, suitable for further analysis. Additionally, a plot is generated to visualize the MCMC samples and cumulative statistics.
Value
A list containing tidy data and a plot.
Author(s)
Steven P. Sanderson II, MPH
See Also
Other Utility:
check_duplicate_rows(),
convert_to_ts(),
quantile_normalize(),
util_beta_aic(),
util_binomial_aic(),
util_cauchy_aic(),
util_chisq_aic(),
util_exponential_aic(),
util_f_aic(),
util_gamma_aic(),
util_generalized_beta_aic(),
util_generalized_pareto_aic(),
util_geometric_aic(),
util_hypergeometric_aic(),
util_inverse_burr_aic(),
util_inverse_pareto_aic(),
util_inverse_weibull_aic(),
util_logistic_aic(),
util_lognormal_aic(),
util_negative_binomial_aic(),
util_normal_aic(),
util_paralogistic_aic(),
util_pareto1_aic(),
util_pareto_aic(),
util_poisson_aic(),
util_t_aic(),
util_triangular_aic(),
util_uniform_aic(),
util_weibull_aic(),
util_zero_truncated_binomial_aic(),
util_zero_truncated_geometric_aic(),
util_zero_truncated_negative_binomial_aic(),
util_zero_truncated_poisson_aic()
Examples
# Generate MCMC samples
set.seed(123)
data <- rnorm(100)
result <- tidy_mcmc_sampling(data, "median", "cmedian", 500)
result