copula-core 0.2.0

Copula modelling, simulation, and dependence analysis (experimental, pre-1.0)
Documentation
//! Convenient imports for common copula operations.
//!
//! This module re-exports the most commonly used types and functions,
//! allowing users to get started quickly with a single `use` statement.
//!
//! # Examples
//!
//! ```rust
//! use copula_core::prelude::*;
//!
//! let copula = ClaytonCopula::new(2.0)?;
//! let data = DMatrix::from_row_slice(4, 2, &[1.2, 0.3, 0.7, 0.9, 2.5, 1.1, 1.9, 2.0]);
//! let pseudo_obs = to_pseudo_observations(&data)?;
//! let density = copula.pdf(&[pseudo_obs[(0, 0)], pseudo_obs[(0, 1)]])?;
//! assert!(density >= 0.0);
//! # Ok::<(), CopulaError>(())
//! ```

// Core error and result types
pub use crate::error::{CopulaError, Result};

// Main traits
pub use crate::traits::{ArchimedeanCopula, Copula};

#[cfg(feature = "estimation")]
pub use crate::model_selection::k_fold_cv;
#[cfg(feature = "estimation")]
pub use crate::traits::FittableCopula;

// Utility functions
pub use crate::utils::{
    empirical_copula_cdf, empirical_ranks, information_criteria, kendall_tau,
    multivariate_kendall_tau, multivariate_spearman_rho, remove_missing_values, spearman_rho,
    to_pseudo_observations, validate_correlation_matrix,
};
// Goodness-of-fit statistics
pub use crate::testing::{
    anderson_darling, cramer_von_mises, cvm_multiplier_bootstrap, kolmogorov_smirnov,
};

// Elliptical copulas
pub use crate::elliptical::{GaussianCopula, StudentTCopula};

// Archimedean copulas
pub use crate::archimedean::{AMHCopula, ClaytonCopula, FrankCopula, GumbelCopula, JoeCopula};

// Other copula families
pub use crate::other::{EmpiricalCopula, MarshallOlkinCopula};

// External types commonly used with copulas
pub use nalgebra::{DMatrix, DVector};

// Random number generation (commonly needed for sampling)
pub use rand::{rng, Rng, RngExt};

// Re-export some useful constants
/// Commonly used confidence levels for statistical tests
pub mod confidence_levels {
    /// 90% confidence level (α = 0.10)
    pub const LEVEL_90: f64 = 0.90;
    /// 95% confidence level (α = 0.05)  
    pub const LEVEL_95: f64 = 0.95;
    /// 99% confidence level (α = 0.01)
    pub const LEVEL_99: f64 = 0.99;
}

/// Common significance levels for hypothesis testing
pub mod significance_levels {
    /// α = 0.01 (very strong evidence)
    pub const ALPHA_001: f64 = 0.01;
    /// α = 0.05 (strong evidence)
    pub const ALPHA_005: f64 = 0.05;
    /// α = 0.10 (moderate evidence)
    pub const ALPHA_010: f64 = 0.10;
}