paramci

Class: prob.ToolboxFittableParametricDistribution
Package: prob

Confidence intervals for probability distribution parameters

Syntax

ci = paramci(pd)
ci = paramci(pd,Name,Value)

Description

ci = paramci(pd) returns the array ci containing the lower and upper boundaries of the 95% confidence interval for each parameter in probability distribution pd.

ci = paramci(pd,Name,Value) returns confidence intervals with additional options specified by one or more name-value pair arguments. For example, you can specify a different percentage for the confidence interval, or compute confidence intervals only for selected parameters.

Input Arguments

expand all

pd — Probability distributionprobability distribution object

Probability distribution, specified as a probability distribution object. Create a probability distribution object with specified parameter values using makedist. Alternatively, create a probability distribution object by fitting it to data using fitdist or the Distribution Fitting app.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Alpha',0.01 specifies a 99% confidence interval.

'Alpha' — Alpha level0.05 (default) | scalar value in the range (0,1)

Alpha level for the confidence interval, specified as the comma-separated pair consisting of 'Alpha' and a scalar value in the range (0,1). The default value 0.05 corresponds to a 95% confidence interval.

Example: 'Alpha',0.01

Data Types: single | double

'Parameter' — Parameter listvector | cell array of strings

Parameter list for which to compute confidence intervals, specified as the comma-separated pair consisting of 'Parameter' and a vector or a cell array of strings containing the parameter names. By default, paramci computes confidence intervals for all distribution parameters.

Example: 'Parameter','mu'

Data Types: char

'Type' — Computation method'exact' | 'Wald' | 'lr'

Computation method for the confidence intervals, specified as the comma-separated pair consisting of 'Type' and 'exact', 'Wald', or 'lr'.

'exact' computes the confidence intervals using an exact method, and is available for the following distributions.

BinomialCompute using the Clopper-Pearson method based on exact probability calculations. This method does not provide exact coverage probabilities.
ExponentialCompute using a method based on a chi-square distribution. This method provides exact coverage for complete and Type 2 censored samples.
NormalComputation method based on t and chi-square distributions for uncensored samples provides exact coverage for uncensored samples. For censored samples, paramci uses the Wald method if Type is exact.
LognormalComputation method based on t and chi-square distributions for uncensored samples provides exact coverage. For censored samples, paramci uses the Wald method if Type is exact.
PoissonComputation method based on a chi-square distribution provides exact coverage. For large degrees of freedom, the chi-square is approximated by a normal distribution for numerical efficiency.
RayleighComputation method based on a chi-square distribution provides exact coverage probabilities.

'exact' is the default when it is available. Alternatively, you can specify 'Wald' to compute the confidence intervals using the Wald method, or 'lr' to compute the confidence intervals using the likelihood radio method.

Example: 'Type','Wald'

'LogFlag' — Boolean flag for log scalevector

Boolean flag for the log scale, specified as the comma-separated pair consisting of 'LogFlag' and a vector containing Boolean values corresponding to each distribution parameter. The flag specifies which Wald intervals to compute on a log scale. The default values depend on the distribution.

Example: 'LogFlag',[0,1]

Data Types: logical

Output Arguments

expand all

ci — Confidence intervalarray

Confidence interval, returned as a p-by-2 array containing the lower and upper bounds of the (1 - Alpha)% confidence interval for each distribution parameter. p is the number of distribution parameters.

Examples

expand all

Parameter Confidence Intervals

Load the sample data. Create a vector containing the first column of students' exam grade data.

load examgrades;
x = grades(:,1);

Fit a normal distribution object to the data.

pd = fitdist(x,'Normal')
pd = 

  NormalDistribution

  Normal distribution
       mu = 75.0083   [73.4321, 76.5846]
    sigma =  8.7202   [7.7391, 9.98843]

Compute the 95% confidence interval for the distribution parameters.

ci = paramci(pd)
ci =

   73.4321    7.7391
   76.5846    9.9884

Column 1 of ci contains the lower and upper 95% confidence interval boundaries for the mu parameter, and column 2 contains the boundaries for the sigma parameter.

Change Parameter Confidence Intervals

Load the sample data. Create a vector containing the first column of students' exam grade data.

load examgrades;
x = grades(:,1);

Fit a normal distribution object to the data.

pd = fitdist(x,'Normal')
pd = 

  NormalDistribution

  Normal distribution
       mu = 75.0083   [73.4321, 76.5846]
    sigma =  8.7202   [7.7391, 9.98843]

Compute the 99% confidence interval for the distribution parameters.

ci = paramci(pd,'Alpha',.01)
ci =

   72.9245    7.4627
   77.0922   10.4403

Column 1 of ci contains the lower and upper 99% confidence interval boundaries for the mu parameter, and column 2 contains the boundaries for the sigma parameter.

See Also

| |

Was this topic helpful?