Lognormdf: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Bob
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Lognormal distribution.
Lognormal distribution.
===Synopsis===
===Synopsis===
:prob = lognormdf(function,x,a,b)
:prob = lognormdf(function,x,a,b)
===Description===
===Description===
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Lognormal distribution.
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.
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====
 
::<math>f(x)= \frac {1} {xb \left ( 2 \pi \right ) ^ {1/2}} \exp \left \{ \frac {- \left ( \log x -a \right )^2} {2b^2} \right \}</math>
 
 
====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' ].
* '''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).  
* '''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=quantile - matrix with values in the interval (0,1).
*  '''for''' function=random - vector indicating the size of the random matrix to create.
:: 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).
*  '''b''' = standard deviation 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''': 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.  
 
'''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===
===Examples===
====Cumulative:====
 
====Cumulative====
<pre>
>> prob = lognormdf('c',0.99,1,2)
>> prob = lognormdf('c',0.99,1,2)
prob =
prob =
Line 23: Line 42:
>> 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-')
====Density:====
</pre>
====Density====
<pre>
>> prob = lognormdf('d',0.99,1,1)
>> prob = lognormdf('d',0.99,1,1)
prob =
prob =
Line 29: Line 50:
>> 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-')
====Quantile:====
</pre>
====Quantile====
<pre>
>> prob = lognormdf('q',0.99,0.5,1)
>> prob = lognormdf('q',0.99,0.5,1)
prob =
prob =
   16.8837
   16.8837
====Random:====
</pre>
====Random====
<pre>
>> prob = lognormdf('r',[4 1],2,1)
>> prob = lognormdf('r',[4 1],2,1)
ans =
ans =
Line 40: Line 65:
   19.8518
   19.8518
     8.7712
     8.7712
</pre>
===See Also===
===See Also===
[[betadr]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]
 
[[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]

Latest revision as of 08:39, 10 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