Learn R Programming

MixStable (version 0.1.0)

Parameter Estimation for Stable Distributions and Their Mixtures

Description

Provides various functions for parameter estimation of one-dimensional stable distributions and their mixtures. It implements a diverse set of estimation methods, including quantile-based approaches, regression methods based on the empirical characteristic function (empirical, kernel, and recursive), and maximum likelihood estimation. For mixture models, it provides stochastic expectation–maximization (SEM) algorithms and Bayesian estimation methods using sampling and importance sampling to overcome the long burn-in period of Markov Chain Monte Carlo (MCMC) strategies. The package also includes tools and statistical tests for analyzing whether a dataset follows a stable distribution. Some of the implemented methods are described in Hajjaji, O., Manou-Abi, S. M., and Slaoui, Y. (2024) .

Copy Link

Version

Install

install.packages('MixStable')

Monthly Downloads

162

Version

0.1.0

License

GPL-3

Maintainer

Solym Manou-Abi

Last Published

November 3rd, 2025

Functions in MixStable (0.1.0)

N_uniform

Uniform kernel
RT

Compute effective reproduction number Rt
N_epanechnikov

Epanechnikov kernel
analyse_stable_distribution

Perform full stability analysis and export results
bayesian_mixture_model

Bayesian mixture model using normal components (simplified)
CDF

Estimate stable distribution parameters using classical ECF regression
Max_vrai

Maximum likelihood estimation using Nelder-Mead
Re

Real part of the ECF integral
compute_serial_interval

Compute serial interval from CSV file
aic

Akaike Information Criterion (AIC)
TableS2_serial_interval_mean_

Example transmission pair data with mean serial interval
bic

Bayesian Information Criterion (BIC)
build_mcculloch_interpolators

Build interpolation functions from McCulloch table
Im

Imaginary part of the ECF integral
Int_Im

Integrate imaginary component over \(\mathbb{R}\)
em_estimate_stable_recursive_ecf_with_gibbs

EM algorithm for alpha-stable mixture using recursive ECF and Gibbs M-step
ecf_fn

Empirical Characteristic Function
ecf_regression

Estimate stable parameters using weighted ECF regression
cosine_exp_ralpha

Cosine exponential function
cosine_log_weighted_exp_ralpha

Cosine-log-weighted exponential with r^(-alpha) term
em_estimate_stable_weighted_ols

EM algorithm for mixture of alpha-stable distributions using weighted OLS
estimate_stable_r

Estimate stable parameters using method of moments
calculate_log_likelihood

Calculate simplified log-likelihood
clip

Clip values between lower and upper bounds
estimate_alpha_gamma

Estimate alpha and gamma from ECF modulus
em_stable_mixture

EM algorithm for alpha-stable mixture using a custom estimator
evaluate_estimation_method

Evaluate estimation method using MSE over multiple trials
estimate_beta_delta

Estimate beta and delta from ECF phase
ecf_components

Extract magnitude and phase components from ECF
em_estimate_stable_kernel_ecf

EM algorithm for mixture of alpha-stable distributions using kernel ECF
eta_func

General eta function
em_fit_alpha_stable_mixture

EM algorithm for two-component alpha-stable mixture using MLE
em_estimate_stable_from_cdf_with_gibbs

EM algorithm for alpha-stable mixture using CDF-based ECF and Gibbs M-step
em_estimate_stable_recursive_ecf

EM algorithm for mixture of alpha-stable distributions using recursive ECF
em_estimate_stable_kernel_ecf_with_gibbs

EM algorithm for alpha-stable mixture using kernel ECF and Gibbs M-step
compute_model_metrics

Compute log-likelihood, AIC, and BIC for alpha-stable model
ensure_positive_scale

Ensure positive scale parameter
estimate_stable_kernel_ecf

Estimate stable parameters using kernel-based ECF method
empirical_r0

Empirical R0 estimation using growth model
generate_synthetic_data

Generate synthetic data from two alpha-stable components
gibbs_sampler

Gibbs sampler for Gaussian mixture model
ecf_estimate_all

Estimate all stable parameters from empirical characteristic function
em_estimate_stable_weighted_ols_with_gibbs

EM algorithm for alpha-stable mixture using weighted OLS and Gibbs M-step
compare_methods_with_gibbs

Compare estimation methods with and without Gibbs sampling
compare_methods_across_configs

Compare McCulloch, ECF, and MLE methods across parameter configurations
ecf_empirical

Compute empirical characteristic function
em_estimation_mixture

EM algorithm for two-component Gaussian mixture
fit_mle_mixture

Fit MLE Mixture of Two Stable Distributions
fit_alpha_stable_mle

Fit Alpha-Stable Distribution using MLE (L-BFGS-B)
estimate_stable_params

Estimate single stable distribution parameters
metropolis_hastings

Metropolis-Hastings MCMC for stable mixture clustering
plot_effective_reproduction_number

Plot effective reproduction number (Re) over time
estimate_stable_recursive_ecf

Estimate stable parameters using recursive ECF method
normalized_objective_delta

Normalized objective for delta parameter
compute_quantile_ratios

Compute McCulloch quantile ratios from sample data
normalized_objective_beta

Normalized objective for beta parameter
plot_distributions

Plot histogram with normal and stable PDF overlays
rstable

Generate random samples from stable distribution
robust_mle_estimate

Robust MLE estimation with multiple starting points
wasserstein_distance_mixture

Wasserstein distance between two mixture distributions
mcculloch_quantile_init

Initialization using McCulloch quantile method
compare_em_vs_em_gibbs

Compare standard EM and EM with Gibbs sampling using kernel ECF
est_r0_ml

Estimate R0 using maximum likelihood
compare_estimators_on_simulations

Compare MLE, ECF, and McCulloch estimators on simulated data
est_r0_mle

MLE estimation of R0 using generation time
estimate_stable_weighted_ols

Estimate stable parameters using weighted OLS on recursive ECF
em_alpha_stable

EM algorithm for alpha-stable mixture
false_position_update

False position method update step
grad_loglik_alpha

Log-likelihood gradient with respect to alpha
grad_loglik_beta

Log-likelihood gradient with respect to beta
integrate_function

Robust integration helper function
integrate_sine

Integrate sin exponential
plot_fit_vs_true

Plot true vs estimated mixture density
recursive_weight

Recursive weight function
plot_final_mixture_fit

Plot final fitted mixture of alpha-stable distributions
integrate_sine_r_weighted

Integrate sine-r-weighted exponential
generate_mcculloch_table

Generate McCulloch lookup table from simulated stable samples
fast_integrate

Fast numerical integration using trapezoidal rule
integrate_sine_log_weighted

Integrate sine-log-weighted exponential
generate_mixture_data

Simulates a mixture of alpha-stable distributions with randomly sampled parameters.
plot_method_comparison

Plot RMSE and Log-Likelihood comparison across methods
mock_gibbs_sampling

Mock Gibbs sampling for alpha-stable mixture estimation
mock_lookup_alpha_beta

Mock lookup for alpha and beta (fallback)
plot_fit_vs_true_methods

Compare estimated mixture densities from two methods against the true density
robust_ecf_regression

Estimate stable parameters using robust ECF regression
simulate_mixture

Simulate mixture data from alpha-stable components
estimate_mixture_params

Estimate mixture of two stable distributions
estimate_stable_from_cdf

Estimate stable parameters using CDF-based ECF regression
run_all_estimations

Run all EM-based estimations without Gibbs sampling (CRAN-safe)
test_normality

Test normality using multiple statistical tests
stable_fit_init

Initialize stable distribution parameters
run_estimations_with_gibbs

Run all EM-based estimations with Gibbs sampling (CRAN-safe)
grad_loglik_delta

Log-likelihood gradient with respect to delta (scale)
evaluate_fit

Evaluate fit quality using RMSE and log-likelihood
integrate_sine_weighted

Integration wrappers for specific integrands
grad_loglik_omega

Log-likelihood gradient with respect to omega (location)
export_analysis_report

Export analysis report to JSON and Excel
sine_exp_ralpha

Sine exponential function
eta0

Helper function for eta0 computation
plot_mixture_fit

Plot mixture fit with individual components
plot_comparison

Compare EM-estimated mixture with a non-optimized reference model
kde_bandwidth_plugin

KDE bandwidth selection using plugin method
plot_trace

Plot trace of a parameter across MCMC iterations
plot_mixture

Plot mixture of two alpha-stable distributions
skew_kurtosis

Calculate skewness and kurtosis
plot_vs_normal_stable

Plot comparison between normal and stable distributions
normalized_objective_omega

Normalized objective for omega parameter
sine_weighted_exp_ralpha

Sine-weighted exponential with r^alpha term
em_estimate_stable_from_cdf

EM algorithm for mixture of alpha-stable distributions using CDF-based ECF
fit_stable_ecf

Estimate stable parameters using filtered and weighted ECF regression
sine_r_weighted_exp_ralpha

Sine-r-weighted exponential function
unpack_params

Helper function to unpack parameters
mixture_stable_pdf

Mixture of two stable PDFs
sine_log_weighted_exp_ralpha

Sine-log-weighted exponential with r^(-alpha) term
plot_results

Plot posterior mixture density from MCMC samples
mle_estimate

Simple MLE estimation with default starting values
plot_real_mixture_fit

Plot fitted mixture on real dataset
generate_alpha_stable_mixture

Generate samples from a predefined alpha-stable mixture
integrate_cosine

Integrate cosine exponential
validate_params

Validate and clip parameters for stable distribution
integrate_cosine_log_weighted

Integrate cosine-log-weighted exponential
log_likelihood_mixture

Log-likelihood for mixture of stable distributions
negative_log_likelihood

Negative log-likelihood for single stable distribution
qcv_stat

QCV statistic for tail heaviness
safe_integrate

Safe integration wrapper with multiple fallback strategies
normalized_grad_alpha

Normalized gradient for alpha parameter Computes the normalized gradient of the log-likelihood with respect to the alpha parameter over a set of observations. This is useful for optimization routines where scale-invariant updates are preferred.
r_stable_pdf

Robust stable PDF computation
mcculloch_lookup_estimate

Estimate stable parameters using McCulloch lookup
simple_em_real

Simple 2-component EM using ECF initialization
DONNEE_with_serial_interval

Example serial interval data
L_stable

Negative log-likelihood for stable distribution using dstable
Int_Re

Integrate real component over \(\mathbb{R}\)
N_gaussian

Gaussian kernel