Skip to content

mathworks/skeweddistributions

Repository files navigation

Skewed & Heavy-Tailed Distributions for MATLAB

Open in MATLAB Online SkewDistributions CI coverage

Skewed and heavy-tailed parametric distributions are widely used to model asymmetric data and tail-risk behaviour, particularly in applications such as modeling asset returns, and are commonly employed in Bayesian statistical frameworks. This repository brings together these and related parametric distributions in a consistent, MATLAB-compatible framework for the wider statistics community.

Each distribution is designed to:

  • Integrate seamlessly with Statistics and Machine Learning Toolbox™
  • Support PDF, CDF, ICDF, random generation, and fitting
  • Be usable with standard MATLAB® functions such as:
    • makedist
    • fitdist
    • random
    • cdf, pdf, icdf
    • mean, var, std

The repository focuses on clarity, numerical stability, and compatibility with MATLAB's distribution framework. For detailed documentation please visit:

Documentation

or run

skewdoc 

Installation and setup

Requirements

  • MATLAB® R2022b or newer (recommended)
  • Statistics and Machine Learning Toolbox™

Get the latest version of the toolbox from releases.

Install by double-clicking on the file or:

matlab.addons.install("skewdists.mltbx") 

Once installed, run (once) the command below to refresh the Statistics and Machine Learning Toolbox with the new options:

makedist -reset 

Implemented Distributions

Distribution Class Name
Epsilon-Skew-Normal EpsilonSkewNormalDistribution
Inverse-Gamma InverseGammaDistribution
Log-Gamma LoggammaDistribution
Skew-Normal SkewNormalDistribution
Split-Normal SplitNormalDistribution
Skew-t SkewTDistribution

Example Usage

% Create a distribution object
pd = makedist("SkewNormal", 0, 1, 5);

% Evaluate the PDF
x = linspace(-5, 5, 200);
y = pdf(pd, x);

% Random sampling
r = random(pd, 10000, 1);

% Fit a distribution to data
pdHat = fitdist(r, 'skewnormal');

% plot the fitted results
figure(Color = "w");
histogram(r, 100, Normalization = "pdf")
hold on; 
x = linspace(-1, 5, 200);
y = pdf(pdHat, x);
line(x, y, LineWidth = 2)

FitResults

Repository Structure


├── README.md
├── SECURITY.md
├── License.txt
├── buildfile.m
├── tbx
│   ├── skewdist
|       ├── skewdoc
│       ├── +prob
│           ├── EpsilonSkewNormalDistribution.m
│           ├── InverseGammaDistribution.m
│           ├── LoggammaDistribution.m
│           ├── SkewNormalDistribution.m
│           ├── SplitNormalDistribution.m
│           └── SkewTDistribution.m
│   ├── doc
│      ├── EpsilonSkewNormalDistribution.md
│      ├── InverseGammaDistribution.md
│      ├── LoggammaDistribution.md
│      ├── SkewNormalDistribution.md
│      ├── SplitNormalDistribution.md
│      └── SkewTDistribution.md
  • tbx/skewdist/+prob/*.m files contain the distribution class implementations.
  • tbx/doc/ contains one Markdown file per distribution, documenting:
    • Mathematical definition
    • Parameters and constraints
    • Supported methods
    • Usage examples
    • Implementation notes

Contributing

Each new distribution should include:

  1. A .m class file implementing the distribution
  2. A corresponding documentation file in tbx/doc/
  3. Full support for pdf, cdf, icdf, mean, var, std, fitdist, makedist

About

This toolbox contains a collection of skewed, and split parametric probability distributions often used in tail-risk applications.

Topics

Resources

License

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors