Lognormdf: Difference between revisions
imported>Jeremy (Importing text file) |
imported>Jeremy No edit summary |
||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Line 21: | Line 20: | ||
* '''x''' = matrix in which the sample data is stored, in the interval (-inf,inf). | * '''x''' = matrix in which the sample data is stored, in the interval (-inf,inf). | ||
:: for function=quantile - matrix with values in the interval (0,1). | |||
:: for function=random - vector indicating the size of the random matrix to create. | |||
* '''a''' = mean parameter (real and positive). | * '''a''' = mean parameter (real and positive). | ||
Line 36: | Line 33: | ||
===Examples=== | ===Examples=== | ||
====Cumulative | ====Cumulative==== | ||
<pre> | |||
>> prob = lognormdf('c',0.99,1,2) | >> prob = lognormdf('c',0.99,1,2) | ||
prob = | prob = | ||
0.3068 | 0.3068 | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,lognormdf('c',x,1,2),'b-',x,lognormdf('c',x,3,7),'r-') | >> plot(x,lognormdf('c',x,1,2),'b-',x,lognormdf('c',x,3,7),'r-') | ||
</pre> | |||
====Density | ====Density==== | ||
<pre> | |||
>> prob = lognormdf('d',0.99,1,1) | >> prob = lognormdf('d',0.99,1,1) | ||
prob = | prob = | ||
0.2420 | 0.2420 | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,lognormdf('d',x,2,1),'b-',x,lognormdf('d',x,0.5,1),'r-') | >> plot(x,lognormdf('d',x,2,1),'b-',x,lognormdf('d',x,0.5,1),'r-') | ||
</pre> | |||
====Quantile | ====Quantile==== | ||
<pre> | |||
>> prob = lognormdf('q',0.99,0.5,1) | >> prob = lognormdf('q',0.99,0.5,1) | ||
prob = | prob = | ||
16.8837 | 16.8837 | ||
</pre> | |||
====Random | ====Random==== | ||
<pre> | |||
>> prob = lognormdf('r',[4 1],2,1) | >> prob = lognormdf('r',[4 1],2,1) | ||
ans = | ans = | ||
13.5191 | 13.5191 | ||
4.4913 | 4.4913 | ||
19.8518 | 19.8518 | ||
8.7712 | 8.7712 | ||
</pre> | |||
===See Also=== | ===See Also=== | ||
[[ | [[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]] |
Revision as of 12:09, 9 October 2008
Purpose
Lognormal distribution.
Synopsis
- prob = lognormdf(function,x,a,b)
Description
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Lognormal distribution.
This distribution may be used to characterize data that are themselves products or attribute data (square footage, acreage, etc.). The distribution is skewed to the right, but for very large means, may look nearly symmetric. Negative values in the sample are ignored.
Inputs
- function = [ {'cumulative'} | 'density' | 'quantile' | 'random' ], defines the functionality to be used. Note that the function recognizes the first letter of each string so that the string could be: [ 'c' | 'd' | 'q' | 'r' ].
- x = matrix in which the sample data is stored, in the interval (-inf,inf).
- for function=quantile - matrix with values in the interval (0,1).
- for function=random - vector indicating the size of the random matrix to create.
- a = mean parameter (real and positive).
- b = standard deviation parameter (real and positive).
Note: If inputs (x, a, and b) are not equal in size, the function will attempt to resize all inputs to the largest input using the RESIZE function.
Note: Functions will typically allow input values outside of the acceptable range to be passed but such values will return NaN in the results.
Examples
Cumulative
>> prob = lognormdf('c',0.99,1,2) prob = 0.3068 >> x = [0:0.1:10]; >> plot(x,lognormdf('c',x,1,2),'b-',x,lognormdf('c',x,3,7),'r-')
Density
>> prob = lognormdf('d',0.99,1,1) prob = 0.2420 >> x = [0:0.1:10]; >> plot(x,lognormdf('d',x,2,1),'b-',x,lognormdf('d',x,0.5,1),'r-')
Quantile
>> prob = lognormdf('q',0.99,0.5,1) prob = 16.8837
Random
>> prob = lognormdf('r',[4 1],2,1) ans = 13.5191 4.4913 19.8518 8.7712
See Also
betadf, cauchydf, chidf, expdf, gammadf, gumbeldf, laplacedf, logisdf, normdf, paretodf, raydf, triangledf, unifdf, weibulldf