Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.

Custom Distributions Using the Distribution Fitter App

You can use the Distribution Fitter app to fit distributions not supported by the Statistics and Machine Learning Toolbox™ by defining a custom distribution.

Opening the Distribution Fitter App

To open the Distribution Fitter app, enter the command


Alternatively, click Distribution Fitter on the Apps tab.

Defining Custom Distributions

To define a custom distribution, select Define 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 +prob on 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 Fitter app reads it in automatically when you start the tool. You can also save the template under a different name, such as Laplace.m, and then import the custom distribution as described in the following section.

Importing Custom Distributions

To import a custom distribution, select Import 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 Laplace.m, as described in the preceding section, the New Parametric Distribution List dialog that launches when you select Import Custom Distributions now includes Laplace. In addition, the Distribution field of the New Fit window also contains the option Laplace.