Logisdf: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Jeremy
No edit summary
Line 1: Line 1:
===Purpose===
===Purpose===


Line 23: Line 22:


* '''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).
* '''a''' = mean parameter (real).
Line 38: Line 35:
===Examples===
===Examples===


====Cumulative:====
====Cumulative====
 
<pre>
>> prob = logisdf('c',0.99,1,2)
>> prob = logisdf('c',0.99,1,2)
prob =
prob =
     0.4988
     0.4988
>> 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-')
 
</pre>
====Density:====
====Density====
 
<pre>
>> prob = logisdf('d',0.99,1,2)
>> prob = logisdf('d',0.99,1,2)
prob =
prob =
     0.1250
     0.1250
>> 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-')
 
</pre>
====Quantile:====
====Quantile====
 
<pre>
>> prob = logisdf('q',0.99,1,2)
>> prob = logisdf('q',0.99,1,2)
prob =
prob =
   10.1902
   10.1902
 
</pre>
====Random:====
====Random====
 
<pre>
>> prob = logisdf('r',[4 1],2,1)
>> prob = logisdf('r',[4 1],2,1)
ans =
ans =
     0.4549
     0.4549
     0.4638
     0.4638
     0.3426
     0.3426
     0.5011
     0.5011
 
</pre>
===See Also===
===See Also===


[[betadr]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]
[[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]

Revision as of 13:10, 9 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