Documentation

dfittool

Open Distribution Fitting app

This page contains programmatic syntax information for the Distribution Fitting app. For general usage information, see Distribution Fitting.

Syntax

  • dfittool
  • dfittool(y)
  • dfittool(y,cens)
  • dfittool(y,cens,freq)
  • dfittool(y,cens,freq,dsname)

Description

dfittool opens the Distribution Fitting app, or brings focus to the app if it is already open.

dfittool(y) opens the Distribution Fitting app populated with the data specified by the vector y.

dfittool(y,cens) uses the vector cens to specify whether each observation in y is censored.

dfittool(y,cens,freq) uses the vector freq to specify the frequency of each element of y.

dfittool(y,cens,freq,dsname) creates a data set with the name dsname, using the data vector, y, censoring indicator, cens, and frequency vector, freq.

Examples

collapse all

Open Distribution Fitting App with Existing Data

Load the carsmall sample data.

load carsmall

Open the Distribution Fitting app using the MPG miles per gallon data.

dfittool(MPG)

The Distribution Fitting app opens, populated with the MPG data, and displays the density (PDF) plot. You can use the app to display different plots and fit distributions to this data.

Open Distribution Fitting App with Censoring Data

Load the sample data.

load(fullfile(matlabroot,'examples','stats','lightbulb.mat'))

The first column of the data contains the lifetime (in hours) of two types of light bulbs. The second column contains information about the type of light bulb. 1 indicates fluorescent bulbs, and 0 indicates the incandescent bulb. The third column contains censoring information. 1 indicates censored data, and 0 indicates the exact failure time. This is simulated data.

Open the Distribution Fitting app using the first column of lightbulb as the input data, and the third column as the censoring data. Name the data lifetime.

dfittool(lightbulb(:,1),lightbulb(:,3),[],'lifetime')

To open the Data dialog box, click Data. In the Manage data sets pane, click to highlight the lifetime data set row. Finally, to open the View Data Set dialog, click View. The lifetime data appears in the second column and the corresponding censoring indicator appears in the third column.

Related Examples

Input Arguments

collapse all

y — Input dataarray of scalar values | variable representing an array of scalar values

Input data, specified as an array of scalar values or a variable representing an array of such values.

Data Types: single | double

cens — Censoring indicatorzeros(n) (default) | vector of 0 and 1 values

Censoring indicator, specified as a vector of 0 and 1 values. The length of cens must be equal to the length of y. If y(j) is censored, then (cens(j)==1). If y(j) is not censored, then (cens(j)==0). If cens is omitted or empty, then no y values are censored.

If you have frequency data (freq) but not censoring data (cens), then you must specify empty brackets ([]) for cens.

Data Types: single | double

freq — Frequency dataones(n) (default) | vector of scalar values

Frequency data, specified as a vector of scalar values. The length of freq must be equal to the length of y. If freq is omitted or empty, then all y values have a frequency of 1.

If you have frequency data (freq) but not censoring data (cens), then you must specify empty brackets ([]) for cens.

Data Types: single | double

dsname — Data set namestring

Data set name, specified as a string enclosed in single quotes.

If you want to specify a data set name, but do not have censoring data (cens) or frequency data (freq), then you must specify empty brackets ([]) for both freq and cens.

Example: 'MyData'

Data Types: char

See Also

|

Introduced before R2006a

Was this topic helpful?