Logisdf: Difference between revisions
imported>Jeremy (Importing text file) |
imported>Bob |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Logistic distribution. | Logistic distribution. | ||
===Synopsis=== | ===Synopsis=== | ||
:prob = logisdf(function,x,a,b) | :prob = logisdf(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 Logistic distribution. | 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. | 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> | |||
* 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). | |||
::<math>F(x) = \frac {1} {2} \left \{1 + \tanh \left [ \frac {1} {2} \left (x-a \right ) /b \right ] \right \}</math> | |||
* a = mean parameter (real). | ====Inputs==== | ||
* b = standard deviation parameter (real and positive). | |||
* '''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''': 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 = logisdf('c',0.99,1,2) | >> prob = logisdf('c',0.99,1,2) | ||
prob = | prob = | ||
Line 24: | Line 44: | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,logisdf('c',x,1,2),'b-',x,logisdf('c',x,3,.5),'r-') | >> plot(x,logisdf('c',x,1,2),'b-',x,logisdf('c',x,3,.5),'r-') | ||
====Density | </pre> | ||
====Density==== | |||
<pre> | |||
>> prob = logisdf('d',0.99,1,2) | >> prob = logisdf('d',0.99,1,2) | ||
prob = | prob = | ||
Line 30: | Line 52: | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,logisdf('d',x,2,1),'b-',x,logisdf('d',x,0.5,1),'r-') | >> plot(x,logisdf('d',x,2,1),'b-',x,logisdf('d',x,0.5,1),'r-') | ||
====Quantile | </pre> | ||
====Quantile==== | |||
<pre> | |||
>> prob = logisdf('q',0.99,1,2) | >> prob = logisdf('q',0.99,1,2) | ||
prob = | prob = | ||
10.1902 | 10.1902 | ||
====Random | </pre> | ||
====Random==== | |||
<pre> | |||
>> prob = logisdf('r',[4 1],2,1) | >> prob = logisdf('r',[4 1],2,1) | ||
ans = | ans = | ||
Line 41: | Line 67: | ||
0.3426 | 0.3426 | ||
0.5011 | 0.5011 | ||
</pre> | |||
===See Also=== | ===See Also=== | ||
[[ | |||
[[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]] |
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