
Fit all valid parametric probability distributions to data 1.0 File ID: 85287 


 Fit all valid parametric probability distributions to data 1.0 License: Shareware File Size: 10.0 KB Downloads: 13
Submit Rating: 



Fit all valid parametric probability distributions to data 1.0 Description 

Description: 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 BirnbaumSaunders Exponential Extreme value Gamma Generalized extreme value Generalized Pareto Inverse Gaussian Logistic Loglogistic Lognormal Nakagami Normal Rayleigh Rician t locationscale 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 kernelsmoothing, 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 
More Similar Code 

%function [pdffit,offset,A,B,resnorm,mode,medpdf,ndata,h] = distributionfit(data,distribution,nbins,figureWH) %PURPOSE jdc rev. 23Mar06 % Fit one of three probability distributions (normal, lognormal, weibull) % to input data vector. If the distribution is specified as 'best' the dis % tribution that best fits the data is selected automatically. %INPUT % If nargin==1, "distribution" is prompted for...
Binding ASP.NET Controls to Data is a simple tutorial in which the author gives details about data binding with the help of web controls in ASP.NET. The author gives explanation about Databound control, which helps in binding data source with web...
Returns the distribution of the function FUN applied to the set of distributions given in VARARGIN PDFFUN Apply a function to a set of probability distributions [S,P,C]=PDFFUN(FUN,VARARGIN) will return the distribution of the function...
Functions for Rice/Rician PDF: summary statistics (mean and variance), generating random samples, and simple momentmatching to fit the distribution to data.
Similar to e.g. normpdf, normstat, normrnd and normfit from the MATLAB...
The script allows to easily fit predefined complex analytical laws exploiting the potentiality of Genetic Algorithms. The script receives as input the handle to the analytic laws to be fitted to data. Such law may depend on multiple variables...
This script automatically expands the size of a textbox to fit all of the entered text.
POLYFIT can fit a polynomial of given ORDer to vectorial data, using as independent variable data index, rescaled between 1 and 1. Similarly, BIPFIT fits a bipolynomial of given orders (a matrix) to matrix data.
POLYVAL can calculate...
POLYFIT_ROOTS Leastsquares polynomial fit to data. [R,K] = POLYFIT_ROOTS(X, Y, N, TOL) finds the roots R and constant K so that the polynomial P(s) = K*(sR(1))*(sR(2))* ... *(sR(N)) is the best leastsquares fit to the data Y at points...
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database.
The frontend is completely PHP driven. Along with being able to maintain Graphs, Data...
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database.
The frontend is completely PHP driven. Along with being able to maintain Graphs, Data... 
User Review for Fit all valid parametric probability distributions to data 
