paramci
R2026bConfidence intervals for probability distribution parameters
Description
returns confidence intervals with additional options specified by one or more
name-value arguments. For example, you can specify a different percentage for the
confidence interval, or compute confidence intervals only for selected
parameters.ci = paramci(pd,Name=Value)
Examples
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]
The intervals next to the parameter estimates are the 95% confidence intervals for the distribution parameters.
You can also obtain these intervals by using the function paramci.
ci = paramci(pd)
ci = 2×2
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.
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=0.01)
ci = 2×2
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.
Input Arguments
Probability distribution, specified as one of the probability distribution objects in the following table.
| Distribution Object | Function or App Used to Create Probability Distribution Object |
|---|---|
BetaDistribution | makedist, fitdist, Distribution Fitter |
BinomialDistribution | makedist, fitdist,
Distribution Fitter |
BirnbaumSaundersDistribution | makedist, fitdist,
Distribution Fitter |
BurrDistribution | makedist, fitdist,
Distribution Fitter |
EmpiricalDistribution | fitdist |
ExponentialDistribution | makedist, fitdist,
Distribution Fitter |
ExtremeValueDistribution | makedist, fitdist,
Distribution Fitter |
GammaDistribution | makedist, fitdist,
Distribution Fitter |
GeneralizedExtremeValueDistribution | makedist, fitdist,
Distribution Fitter |
GeneralizedParetoDistribution | makedist, fitdist,
Distribution Fitter |
HalfNormalDistribution | makedist, fitdist,
Distribution Fitter |
InverseGaussianDistribution | makedist, fitdist,
Distribution Fitter |
KernelDistribution | fitdist, Distribution Fitter |
LogisticDistribution | makedist, fitdist,
Distribution Fitter |
LoglogisticDistribution | makedist, fitdist,
Distribution Fitter |
LognormalDistribution | makedist, fitdist,
Distribution Fitter |
LoguniformDistribution | makedist |
MultinomialDistribution | makedist |
NakagamiDistribution | makedist, fitdist,
Distribution Fitter |
NegativeBinomialDistribution | makedist, fitdist,
Distribution Fitter |
NormalDistribution | makedist, fitdist,
Distribution Fitter |
PearsonDistribution | makedist |
PiecewiseLinearDistribution | makedist |
PoissonDistribution | makedist, fitdist,
Distribution Fitter |
RayleighDistribution | makedist, fitdist,
Distribution Fitter |
RicianDistribution | makedist, fitdist,
Distribution Fitter |
ShiftedExponentialDistribution | makedist, fitdist,
Distribution Fitter |
ShiftedGammaDistribution | makedist, fitdist,
Distribution Fitter |
ShiftedWeibullDistribution | makedist, fitdist,
Distribution Fitter |
StableDistribution | makedist, fitdist,
Distribution Fitter |
tLocationScaleDistribution | makedist, fitdist,
Distribution Fitter |
TriangularDistribution | makedist |
UniformDistribution | makedist |
WeibullDistribution | makedist, fitdist,
Distribution Fitter |
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: paramci(pd,Alpha=0.01) specifies a 99% confidence
interval.
Significance level for the confidence interval, specified as a scalar
value in the range (0,1). The confidence level of
ci is 100(1–Alpha)%. The
default value 0.05 corresponds to a 95% confidence
interval.
Example: Alpha=0.01
Data Types: single | double
Parameter list for which to compute confidence intervals, specified as a character vector,
string array, or cell array of character vectors containing the
parameter names. By default, paramci computes
confidence intervals for all distribution parameters.
Example: Parameter="mu"
Data Types: char | string | cell
Computation method for the confidence intervals, specified as
"exact", "wald", or
"lr".
"exact" computes the confidence intervals using an
exact method, and is available for the following distributions.
| Distribution | Computation Method |
|---|---|
| Binomial | Compute using the Clopper-Pearson method based on exact probability calculations. This method does not provide exact coverage probabilities. |
| Exponential | Compute using a method based on a chi-square distribution. This method provides exact coverage for complete and Type 2 censored samples. |
| Normal | Computation 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. |
| Lognormal | Computation 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. |
| Poisson | Computation 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. |
| Rayleigh | Computation method based on a chi-square distribution provides exact coverage probabilities. |
| Shifted exponential | For uncensored samples, paramci
uses a computation method based on the
F-distribution to provide exact
coverage. For right-censored samples,
paramci uses the likelihood
ratio method if Type is
"exact". |
Alternatively, you can specify "wald" to compute
the confidence intervals using the Wald method, or
"lr" to compute the confidence intervals using
the likelihood ratio method. The Wald method is not supported for
shifted exponential distributions. It is supported for shifted gamma and
shifted Weibull distributions, but the software issues a warning if the
fitted shape parameter is less than 1. In this case,
the likelihood surface can be irregular, leading the Wald interval to be
unreliable.
"exact" is the default when it is available.
"lr" is the default for shifted gamma and shifted
Weibull distributions. Otherwise, the default is
"wald".
Example: Type="wald"
Data Types: char | string
Boolean flag for the log scale, specified as 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
Confidence interval, returned as a p-by-2 array containing the lower and
upper bounds of the 100(1–Alpha)% confidence interval for
each distribution parameter. p is the number of
distribution parameters.
If you create pd by using makedist and specifying the
distribution parameters, the lower and upper bounds are equal to the
specified parameters.
Extended Capabilities
Usage notes and limitations:
The function supports GPU arrays except when the specified probability distribution is a shifted exponential, shifted gamma, or shifted Weibull distribution.
For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced in R2013aYou can create three new shifted probability distribution objects by using makedist, or by fitting data with fitdist or the Distribution Fitter app:
ShiftedExponentialDistribution— Two-parameter Exponential DistributionShiftedGammaDistribution— Three-parameter Gamma DistributionShiftedWeibullDistribution— Three-parameter Weibull Distribution
Each object includes a location parameter theta such that the distribution starts at x=theta instead of 0. You can use the objects with generic functions such as pdf, cdf, and random.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)