mcmc_freundlichNLM {adsoRptionMCMC}R Documentation

MCMC Analysis for Freundlich Isotherm Non-linear Model

Description

Performs Bayesian parameter estimation using Markov Chain Monte Carlo (MCMC) for the non-linear Freundlich isotherm model: Qe = Kf * Ce^(1/n) This approach is applied to obtain a probabilistic distribution of the model parameters, capturing uncertainties and potential correlations between them.

Arguments

Ce

Numeric vector of equilibrium concentrations.

Qe

Numeric vector of adsorbed amounts.

burnin

Integer specifying the number of burn-in iterations (default is 1000).

mcmc

Integer specifying the total number of MCMC iterations (default is 5000).

thin

Integer specifying the thinning interval (default is 10).

verbose

Integer controlling the frequency of progress updates (default is 100).

plot

Logical; if TRUE, trace and density plots of the MCMC chains are shown (default is FALSE).

n_chains

Number of independent MCMC chains (default = 2).

seed

Optional integer for reproducibility.

Value

A list containing:

Kf_mean

Posterior mean estimate of Freundlich constant (Kf).

n_mean

Posterior mean estimate of Freundlich exponent (n).

logKf_mean

Posterior mean of (log(K_f)).

inv_n_mean

Posterior mean of (1/n).

logKf_sd

Posterior standard deviation for (log(Kf)).

inv_n_sd

Posterior standard deviation for (1/n).

logKf_ci

95% credible interval for (log(Kf)).

inv_n_ci

95% credible interval for (1/n).

gelman_diag

Gelman-Rubin diagnostics (only if multiple chains).

mcmc_summary

Summary statistics for each parameter.

Author(s)

Paul Angelo C. Manlapaz

References

Gilks, W. R., Richardson, S., & Spiegelhalter, D. J. (1995). Markov Chain Monte Carlo in Practice. Chapman and Hall/CRC.

Examples

Ce <- c(0.01353, 0.04648, 0.13239, 0.27714, 0.41600, 0.63607, 0.80435, 1.10327, 1.58223)
Qe <- c(0.03409, 0.06025, 0.10622, 0.12842, 0.15299, 0.15379, 0.15735, 0.15735, 0.16607)
mcmc_freundlichNLM(Ce, Qe, burnin = 1000, mcmc = 5000, thin = 10,
                   verbose = 100, plot = TRUE, n_chains = 2, seed = 123)

[Package adsoRptionMCMC version 0.1.0 Index]