Logisdf: Difference between revisions
imported>Jeremy No edit summary |
imported>Bob |
||
(One intermediate revision by the same user not shown) | |||
Line 13: | Line 13: | ||
This distribution is a common alternative to the normal distribution. It is symmetric and many times used when data represents midpoints of interval data (data collected in such a way that a range instead or an exact value is collected). The variance may be smaller, equal, or larger than the mean for this distribution. | This distribution is a common alternative to the normal distribution. It is symmetric and many times used when data represents midpoints of interval data (data collected in such a way that a range instead or an exact value is collected). The variance may be smaller, equal, or larger than the mean for this distribution. | ||
::<math>f(x) = \frac {\exp \left [ - \left (x-a \right ) /b \right ]} {b \left \{1 + \exp \left [ - \left (x-a \right )/b \right ] \right \} ^2}</math> | |||
::<math>F(x) = \frac {1} {2} \left \{1 + \tanh \left [ \frac {1} {2} \left (x-a \right ) /b \right ] \right \}</math> | |||
====Inputs==== | ====Inputs==== | ||
Line 31: | Line 33: | ||
'''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=== |
Latest revision as of 08:36, 10 October 2008
Purpose
Logistic distribution.
Synopsis
- prob = logisdf(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 Logistic distribution.
This distribution is a common alternative to the normal distribution. It is symmetric and many times used when data represents midpoints of interval data (data collected in such a way that a range instead or an exact value is collected). The variance may be smaller, equal, or larger than the mean for this distribution.
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).
- 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 = logisdf('c',0.99,1,2) prob = 0.4988 >> x = [0:0.1:10]; >> plot(x,logisdf('c',x,1,2),'b-',x,logisdf('c',x,3,.5),'r-')
Density
>> prob = logisdf('d',0.99,1,2) prob = 0.1250 >> x = [0:0.1:10]; >> plot(x,logisdf('d',x,2,1),'b-',x,logisdf('d',x,0.5,1),'r-')
Quantile
>> prob = logisdf('q',0.99,1,2) prob = 10.1902
Random
>> prob = logisdf('r',[4 1],2,1) ans = 0.4549 0.4638 0.3426 0.5011
See Also
betadf, cauchydf, chidf, expdf, gammadf, gumbeldf, laplacedf, lognormdf, normdf, paretodf, raydf, triangledf, unifdf, weibulldf