This repository contains the results of a simulation study focused on estimating the dependence parameter of the FGM copula. The corresponding density function is:
where
This repository presents a simulation study on the estimation of the dependence parameter of the FGM copula. Classical estimation methods, such as maximum likelihood and moment-based estimators using Kendall's Tau, Spearman's Rho, and Blomqvist’s Beta, are compared with informative Bayesian approaches employing Triangular, four-parameter Beta, and Uniform prior distributions.
Since the resulting posterior distributions—such as the one induced by the four-parameter Beta prior—do not have a closed form, the Metropolis-Hastings algorithm was applied in two variants: the standard form (using a uniform instrumental distribution) and the random walk version (using the four-parameter Beta distribution as instrumental). For example, the posterior is given by:
Convergence monitoring for this algorithm was conducted using graphical tools such as the histogram overlaid with the fitted density, trace plots, cumulative averages, and autocorrelation functions. An example of these results, based on a Beta prior and a chain of 5,000 iterations, is available here: Beta Prior Results.
To run the code, you need to have R installed with the following packages:
copulaxlsxreadxlggplot2gridExtracorrelationbetafunctionsparallel
You can install the required packages using the following command:
install.packages(c("copula","xlsx","readxl","ggplot2", "gridExtra", "correlation","betafunctions","parallel"))To run the designed algorithms, follow these steps:
- Clone this repository:
git clone https://github.com/LLerzy/FGM_Estimates.git- Open the scripts in an R-compatible development environment. The main files are:
FunctionsRequired.R: main functions for parameter estimation.SimulationStudy.R: simulation study scheme.DengueDataSet.R: application using dengue data.
- To load the functions and run the scripts:
Rscript FunctionsRequired.R
Rscript SimulationStudy.R
Rscript DengueData/DengueDataSet.RThe functions defined in the FunctionsRequired.R script include:
Density_FGM: FGM copula density function.Der_log_lik_FGM: Derivatives of the log-likelihood function.rfgm / rnfgm: Generation of FGM random samples (1 or n observations).me: Moment-based estimators (Pearson, Kendall, Spearman).metropolis_hastings: MCMC sampling with flexible priors/instrumentals.Graphs: MCMC convergence diagnostics.Est_A_Samp: Estimation from a single sample (point, interval, credibility).Sim_Est_A_Samp: Parameter estimation with filtering of invalid samples.Sim_Est_N_Samp: Repeated simulations for performance evaluation.Mtovar: Prior elicitation for the beta distribution (Tovar’s method).GeneralGraph: Aggregated plot generation for simulation results.Marginal: Empirical marginal distribution estimation.
Note: It is recommended to review and adapt each function to the specific needs of your analysis. Understanding each routine is essential to avoid misinterpretation of the results.
The graphical results from the simulation study can be found in the Graphics folder.
Numerical results from the simulations are available in the Results folder.
The results of the method applied to the dengue dataset can be found in the DengueData folder, particularly in the DengueData6.RData file, which stores all the results obtained.
Contributions are welcome! Please submit a pull request or open an issue if you have any suggestions or improvements.