CausalMixGPD
  • Home
  • Roadmaps
    • Website roadmap
    • Package roadmap
  • Start
    • Start Hub
    • Roadmap
    • Usage Diagrams
    • Start Here
    • Basic Compile and Run
    • Backends and Workflow
    • Troubleshooting
  • Tracks
    • Quickstart
    • Modeling (1-arm)
    • Causal
    • Clustering
    • Kernels & tails
    • Customization
  • Examples
  • Kernels
  • Advanced
  • Developers
  • Reference
    • Reference hub
    • Function reference by job
  • News
  • Cite
  • Coverage
  • API Reference

Mathematical definitions and conventions

Mathematical definitions and conventions

This vignette documents the probability distributions exported by CausalMixGPD and the corresponding d/p/q/r functions used throughout the package. For a continuous random variable (Y) with parameter scalars (), we use the standard quartet:

  • Density (PDF): (f(y)), implemented by d*().
  • Distribution (CDF): (F(y)=(Yy)), implemented by p*().
  • Quantile: (Q(p) = {y: F(y)p}), implemented by q*().
  • Random generation: (Y = Q(U)) with (U(0,1)), implemented by r*().

All d*() functions optionally return log-densities via log = TRUE, i.e., (f(y)). This is numerically convenient because likelihoods multiply densities but add log-densities: [ {{i=1}^n f(y_i)}={i=1}^n f(y_i). ]

All p*() functions support lower.tail and log.p: [ (Y>y)=1-F(y),F(y)  {1-F(y)}. ]

The exported uppercase NIMBLE kernels are scalar in their first argument, and r*() kernels are implemented for n = 1. For vectorized R usage (including n > 1), use the lowercase wrapper families documented in the *_lowercase help topics.

Code
w <- c(0.60, 0.40)
shape <- c(2.0, 5.0)
scale <- c(1.0, 2.0)

dGammaMix(seq(0.5, 2.0, length.out = 5), w = w, shape = shape, scale = scale)
[1] 0.1819845 0.2190497 0.2155592 0.1936004 0.1654680
Code
qGammaMix(c(0.1, 0.5, 0.9), w = w, shape = shape, scale = scale)
[1]  0.7309733  3.1258068 12.5500460
Code
rGammaMix(5, w = w, shape = shape, scale = scale)
[1] 0

Finite mixtures

Several kernels are available as finite mixtures. Let (f_j(j)) denote the (j)th component density and let (=(w_1,,w_J)) be mixture weights with (w_j) and ({j=1}^J w_j=1). The mixture density and CDF are

[ f(y)=_{j=1}^J w_j f_j(yj), F(y)={j=1}^J w_j F_j(y_j). ]

Random generation proceeds by sampling a latent component index (Z()), then sampling (YZ=jf_j(_j)). Mixture quantiles typically require numerical inversion of the mixture CDF.

GPD tails and splicing

The Generalized Pareto Distribution (GPD) is used for tail modeling relative to a threshold (u). In the spliced kernels (the *Gpd functions), a bulk kernel is used below (u) and a GPD tail is attached above (u), with parameters ((u,,)). In code, these are represented by threshold = u, tail_scale = \sigma, and tail_shape = \xi (the standalone GPD functions use scale and shape for () and ()).

Prereqs

  • Required packages and data for this page are listed in the setup chunks above.

Outputs

  • This page renders model fits, diagnostics, and summary artifacts generated by package APIs.

Interpretation

  • Canonical concept page: Introduction With Gpd Kernel
  • Treat this page as an application/example view and use the canonical page for core definitions.

Next

  • Continue to the linked canonical concept page, then return for implementation-specific details.
(c) CausalMixGPD - Bayesian semiparametric modeling for heavy-tailed data
- - Cite - API - GitHub