You can use the Distribution Fitting app to fit distributions not supported by the Statistics and Machine Learning Toolbox™ by defining a custom distribution.
To open the Distribution Fitting app, enter the command
Alternatively, click Distribution Fitting on the Apps tab.
To define a custom distribution, select
Custom Distribution from the File menu.
This opens a file template in the MATLAB® editor. You then edit
this file so that it computes the distribution you want.
The template includes example code that computes the Laplace distribution. Follow the instructions in the template to define your own custom distribution.
To save your custom distribution, create a directory called
your path. Save the file in this directory using a name that matches
your distribution name. If you save the template in a folder on the MATLAB path,
under its default name
dfittooldists.m, the Distribution
Fitting app reads it in automatically when you start the tool. You
can also save the template under a different name, such as
and then import the custom distribution as described in the following
To import a custom distribution, select
Custom Distributions from the File menu.
This opens a dialog box in which you can select the file that defines
the distribution. For example, if you created the file
as described in the preceding section, the New Parametric Distribution
List dialog that launches when you select
Distributions now includes
In addition, the Distribution field of
the New Fit window also contains the option