主要内容

logncdf

Lognormal cumulative distribution function

描述

p= logncdf(x)返回标准对数正态分布的累积分布函数(CDF),在值中评估x。在标准对数正态分布中,对数值的平均值和标准偏差分别为0和1。

p= logncdf(x,mu)用分布参数返回对数正态分布的CDFmu(mean of logarithmic values) and 1 (standard deviation of logarithmic values), evaluated at the values inx

example

p= logncdf(x,mu,sigma)用分布参数返回对数正态分布的CDFmu(mean of logarithmic values) andsigma(standard deviation of logarithmic values), evaluated at the values inx

example

[p,PLO,小狗] = logncdf(x,mu,sigma,PCOV)还返回95%的置信度范围[PLO,小狗] ofp使用估计参数(muandsigma) and their covariance matrixPCOV

[p,PLO,小狗] = logncdf(x,mu,sigma,PCOV,alpha)specifies the confidence level for the confidence interval[pLo,pUp]成为100(1-α)%.

example

___= logncdf(___,'上')returns the complement of the cdf, evaluated at the values inx,使用了一个算法,计算更准确the extreme upper-tail probabilities.'上'可以遵循以前语法中的任何输入参数组合。

例子

collapse all

Compute the cdf values evaluated at the values inxfor the lognormal distribution with meanmu和标准偏差sigma

x = 0:0.2:10; mu = 0; sigma = 1; p = logncdf(x,mu,sigma);

Plot the cdf.

plot(x,p) gridonXlabel('x') ylabel('p')

找到对数正态分布参数的最大似然估计(MLE),然后找到相应的CDF值的置信区间。

使用参数5和2从对数正态分布中生成1000个随机数。

rng('default')%可再现性n = 1000;样品数量的%x = lognrnd(5,2,n,1);

Find the MLEs for the distribution parameters (mean and standard deviation of logarithmic values) by usingmle

phat = mle(x,'distribution','LogNormal')
phat =1×24.9347 1.9969
muhat = phat(1);sigmahat = phat(2);

通过使用日志nlike。The function日志nlikereturns an approximation to the asymptotic covariance matrix if you pass the MLEs and the samples used to estimate the MLEs.

[~,pCov] = lognlike(phat,x)
PCOV =2×20。0040 -0.0000 -0.0000 0.0020

Find the cdf value at 0.5 and its 95% confidence interval.

[P,PLO,PUP] = Logncdf(0.5,Muhat,Sigmahat,PCOV)
p = 0.0024
PLO= 0.0016
小狗= 0.0037

pis the cdf value of the lognormal distribution with the parametersmuHatandsigmaHat。间隔[pLo,pUp]考虑到0.5时评估的CDF的95%置信区间muHatandsigmaHat使用PCOV。The 95% confidence interval means the probability that[pLo,pUp]包含真正的CDF值为0.95。

Determine the probability that an observation from a standard lognormal distribution will fall on the interval[exp(10),Inf]

p1 = 1 -logncdf(exp(10))
p1 = 0

logncdf(exp(10))快1,所以p1变为0。指定'上'以便logncdf更准确地计算极端上尾概率。

p2 = logncdf(exp(10),,'上')
P2 = 7.6199E-24

您也可以使用'上'to compute a right-tailedp-value.

Input Arguments

collapse all

评估CDF的值,指定为正标量值或正标量表值数组。

If you specifyPCOVto compute the confidence interval[PLO,小狗], thenxmust be a scalar value.

要以多个值评估CDF,请指定x使用an array. To evaluate the cdfs of multiple distributions, specifymuandsigma使用数组。如果一个或多个输入参数x,mu, andsigmaare arrays, then the array sizes must be the same. In this case,logncdf将每个标量输入扩展到与数组输入相同的常数数组。Each element inpis the cdf value of the distribution specified by the corresponding elements inmuandsigma, evaluated at the corresponding element inx

例子:[-1,0,3,4]

数据类型:单身的|双倍的

对数正态分布的对数值的平均值,该分布指定为标量值或标量值数组。

If you specifyPCOVto compute the confidence interval[PLO,小狗], thenmumust be a scalar value.

要以多个值评估CDF,请指定x使用an array. To evaluate the cdfs of multiple distributions, specifymuandsigma使用数组。如果一个或多个输入参数x,mu, andsigmaare arrays, then the array sizes must be the same. In this case,logncdf将每个标量输入扩展到与数组输入相同的常数数组。Each element inpis the cdf value of the distribution specified by the corresponding elements inmuandsigma, evaluated at the corresponding element inx

例子:[0 1 2;0 1 2]

数据类型:单身的|双倍的

对数正态分布的对数值的标准偏差,该分布指定为正标量值或正标量表值数组。

If you specifyPCOVto compute the confidence interval[PLO,小狗], thensigmamust be a scalar value.

要以多个值评估CDF,请指定x使用an array. To evaluate the cdfs of multiple distributions, specifymuandsigma使用数组。如果一个或多个输入参数x,mu, andsigmaare arrays, then the array sizes must be the same. In this case,logncdf将每个标量输入扩展到与数组输入相同的常数数组。Each element inpis the cdf value of the distribution specified by the corresponding elements inmuandsigma, evaluated at the corresponding element inx

例子:[1 1 1; 2 2 2]

数据类型:单身的|双倍的

估计的协方差muandsigma, specified as a 2-by-2 matrix.

If you specifyPCOVto compute the confidence interval[PLO,小狗], thenx,mu, andsigmamust be scalar values.

You can estimate the maximum likelihood estimates ofmuandsigmaby usingmle, and estimate the covariance ofmuandsigmaby using日志nlike。For an example, seelog normal cdf值的置信区间

数据类型:单身的|双倍的

显着性水平for the confidence interval, specified as a scalar in the range (0,1). The confidence level is100(1-α)%, wherealphais the probability that the confidence interval does not contain the true value.

例子:0。01

数据类型:单身的|双倍的

输出参数

collapse all

cdf values, evaluated at the values inx, returned as a scalar value or an array of scalar values.p大小与x,mu, andsigmaafter any necessary scalar expansion.Each element inpis the cdf value of the distribution specified by the corresponding elements inmuandsigma, evaluated at the corresponding element inx

降低信心限制p, returned as a scalar value or an array of scalar values.PLO具有与p

Upper confidence bound forp, returned as a scalar value or an array of scalar values.小狗具有与p

More About

collapse all

Lognormal Distribution

The lognormal distribution is a probability distribution whose logarithm has a normal distribution.

The cumulative distribution function (cdf) of the lognormal distribution is

p = F ( x | μ , σ ) = 1 σ 2 π 0 x 1 t 经验 { - ( 日志 t - μ ) 2 2 σ 2 } d t , for x > 0。

Algorithms

  • Thelogncdf功能使用互补错误函数ERFC。The relationship betweenlogncdfandERFCis

    logncdf ( x , 0 , 1 ) = 1 2 ERFC ( - 日志 x 2 )

    互补错误函数ERFC(x)被定义为

    ERFC ( x ) = 1 - erf ( x ) = 2 π x e - t 2 d t

  • Thelogncdf功能计算置信度范围p通过使用Delta方法。正态分布CDF值为日志(x)with the parametersmuandsigma等同于CDF值的(log(x)–mu)/sigmawith the parameters 0 and 1. Therefore, thelogncdf功能估计(log(x)–mu)/sigma使用协方差矩阵muandsigma通过三角洲方法,发现(log(x)–mu)/sigma使用the estimates of this variance. Then, the function transforms the bounds to the scale ofp。The computed bounds give approximately the desired confidence level when you estimatemu,sigma, andPCOV来自大型样品。

Alternative Functionality

  • logncdf是特定于对数正态分布的函数。统计和机器学习工具箱™还提供通用功能cdf,支持各种概率分金宝app布。使用cdf, 创建一个lognormaldistributionprobability distribution object and pass the object as an input argument or specify the probability distribution name and its parameters. Note that the distribution-specific functionlogncdf比通用功能快cdf

  • Use theProbability Distribution Function为概率分布创建累积分布函数(CDF)或概率密度函数(PDF)的交互式图。

References

[1] Abramowitz,M。和I. A. Stegun。数学功能手册。纽约:多佛,1964年。

[2] Evans, M., N. Hastings, and B. Peacock.Statistical Distributions。第二版,新泽西州霍博肯:John Wiley&Sons,Inc.,1993年。

扩展功能

C/C ++代码生成
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a