# Fit all valid parametric probability distributions to data (Scripts) 1.0

Average Rating
User Rating:
Visitors Rating:
My rating:

See full specifications

## Fit all valid parametric probability distributions to data (Scripts) Publisher's description

### ALLFITDIST Fit all valid parametric probability distributions to data.

ALLFITDIST Fit all valid parametric probability distributions to data.

[D PD] = ALLFITDIST(X) fits all valid parametric probability distributions to the data in column vector X, and returns a struct D of fitted distributions and parameters and a struct of objects PD representing the fitted distributions. PD is an object in a class derived from the ProbDist class.

[...] = ALLFITDIST(X,SORTBY) returns the struct of valid distributions sorted by the parameter SORTBY
NLogL - Negative of the log likelihood
BIC - Bayesian information criterion (default)
AIC - Akaike information criterion
AICc - AIC with a correction for finite sample sizes

[...] = ALLFITDIST(X,SORTBY,'NAME1',VALUE1,'NAME2',VALUE2,...) follows the same input format as FITDIST, specifying optional argument name/value pairs.

[...] = ALLFITDIST(...,'DISCRETE') specifies it is a discrete distribution and do not attempt to fit a continuous distribution to the data

[...] = ALLFITDIST(...,'PDF') or (...,'CDF') plots either the PDF or CDF of a subset of the fitted distribution. The distributions are plotted in order of fit, according to SORTBY.

List of distributions it will try to fit
Continuous (default)
Beta
Birnbaum-Saunders
Exponential
Extreme value
Gamma
Generalized extreme value
Generalized Pareto
Inverse Gaussian
Logistic
Log-logistic
Lognormal
Nakagami
Normal
Rayleigh
Rician
t location-scale
Weibull

Discrete ('DISCRETE')
Binomial
Negative binomial
Poisson

Note: If 'n' for binomial data is not given, as per FITDIST notation, then the Method of Moments estimate will be calculated. Additionally, ALLFITDIST does not handle nonparametric kernel-smoothing, use FITDIST directly instead.

EXAMPLE 1
Given random data from an unknown continuous distribution, find the best distribution which fits that data, and plot the PDFs to compare graphically.

x = normrnd(5,3,1e4,1); %Assumed from unknown distribution
[D PD] = allfitdist(x,'PDF'); %Compute and plot results
D(1) %Show output from best fit

EXAMPLE 2
Given random data from a discrete unknown distribution, with frequency data, find the best discrete distribution which would fit that data, sorted by 'NLogL', and plot the CDFs to compare graphically.

x = nbinrnd(20,.3,1e4,1);
values=unique(x); freq=histc(x,values);
[D PD] = allfitdist(values,'NLogL','frequency',freq,'CDF','DISCRETE');
PD{1}

EXAMPLE 3
Although the Geometric Distribution is not listed, it is a special case of fitting the more general Negative Binomial Distribution. The parameter 'r' should be close to 1. Show by example.

r=geornd(.7,1e4,1); %Random from Geometric
[D PD]= allfitdist(r,'PDF','DISCRETE');
PD{1}

EXAMPLE 4
Compare the resulting distributions under two different assumptions of discrete data. The first, that it is known to be derived from a Binomial Distribution with known 'n'. The second, that it may be Binomial but 'n' is unknown and should be estimated. Note the second scenario may not yield a Binomial Distribution as the best fit, if 'n' is estimated incorrectly. (Best to run example a couple times to see effect)

r = binornd(10,.3,1e2,1);
[D1 PD1] = allfitdist(r,'n',10,'DISCRETE','PDF'); %Force binomial
[D2 PD2] = allfitdist(r,'DISCRETE','PDF'); %May be binomial
PD1{1}, PD2{1} %Compare distributions

#### System Requirements:

No special requirements.
Program Release Status: New Release
Program Install Support: Install and Uninstall

#### Fit all valid parametric probability distributions to data (Scripts) Tags:

Click on a tag to find related softwares

## Most Popular

ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation