Betadf: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Bob
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Beta distribution.
Beta distribution.
===Synopsis===
===Synopsis===
:prob = betadf(function,x,a,b,''options'')
:prob = betadf(function,x,a,b,''options'')
===Description===
===Description===
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Beta distribution.   
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Beta distribution.   
This distribution is commonly used to model activity time. In its usual form, the data must be in (0,1), but this toolbox will allow both a location and scale parameter (in addition to the a and b above). This may be symmetric or asymmetric.
This distribution is commonly used to model activity time. In its usual form, the data must be in (0,1), but this toolbox will allow both a location and scale parameter (in addition to the a and b above). This may be symmetric or asymmetric.
 
::<math>B(a,b) = \int_0 ^1 u^{a-1} (1-u)^{b-1} du</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' ].
 
* x = matrix in which the sample data is stored, in the interval (0,1).  
 
for function=quantile - matrix with values in the interval (0,1).
::<math>f(x) = \frac {x^{a-1}(1-x)^{b-1}} {B(a,b)}</math>
for function=random - vector indicating the size of the random matrix to create.
 
* a = scale parameter (real and nonnegative).
====Inputs====
*  b = shape parameter (real and nonnegative).
 
* '''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 (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.
 
* '''a''' = scale parameter (real and nonnegative).
 
'''b''' = shape parameter (real and nonnegative).
 
'''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.
===Options===
===Options===
''options'' is a structure array with the following fields:
''options'' is a structure array with the following fields:
* name: 'options', name indicating that this is an options structure,
 
* scale: {1}, scale for the ordinate, and
* '''name''': 'options', name indicating that this is an options structure,
* offset: {0}, offset for the ordinate.
 
* '''scale''': {1}, scale for the ordinate, and
 
* '''offset''': {0}, offset for the ordinate.
 
The default options structure can be retrieved using: options = betadf('options').
The default options structure can be retrieved using: options = betadf('options').
===Examples===
===Examples===
===Cumulative''':==='''
 
====Cumulative====
<pre>
>> prob = betadf('c', [0.85 0.9],1,2)
>> prob = betadf('c', [0.85 0.9],1,2)
prob =
prob =
## 0.9900
0.9900
>> x    = [0:0.01:1];
>> x    = [0:0.01:1];
>> plot(x,betadf('c',x,1,2),'b-',x,betadf('c',x,0.5,0.5),'r-')
>> plot(x,betadf('c',x,1,2),'b-',x,betadf('c',x,0.5,0.5),'r-')
====Density:====
</pre>
====Density====
<pre>
>> prob = betadf('d', 0.9, 1, 2)
>> prob = betadf('d', 0.9, 1, 2)
prob =
prob =
0.2000
  0.2000
>> x    = [0:0.01:1];
>> x    = [0:0.01:1];
>> plot(x,betadf('d',x,1,2),'b-',x,betadf('d',x,0.5,0.5),'r-')
>> plot(x,betadf('d',x,1,2),'b-',x,betadf('d',x,0.5,0.5),'r-')
====Quantile:====
</pre>
====Quantile====
<pre>
>> prob = betadf('q',[0.9775 0.9900]',1,2)
>> prob = betadf('q',[0.9775 0.9900]',1,2)
prob =
prob =
     0.8500
     0.8500
     0.9000
     0.9000
====Random:====
</pre>
====Random====
<pre>
>> prob = betadf('r',[5 1],1,2)
>> prob = betadf('r',[5 1],1,2)
prob =
prob =
Line 49: Line 83:
     0.0216
     0.0216
     0.1516
     0.1516
</pre>
===See Also===
===See Also===
[[betadr]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]
 
[[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]

Latest revision as of 04:51, 10 October 2008

Purpose

Beta distribution.

Synopsis

prob = betadf(function,x,a,b,options)

Description

Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Beta distribution.

This distribution is commonly used to model activity time. In its usual form, the data must be in (0,1), but this toolbox will allow both a location and scale parameter (in addition to the a and b above). This may be symmetric or asymmetric.


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 (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.
  • a = scale parameter (real and nonnegative).
  • b = shape parameter (real and nonnegative).

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.

Options

options is a structure array with the following fields:

  • name: 'options', name indicating that this is an options structure,
  • scale: {1}, scale for the ordinate, and
  • offset: {0}, offset for the ordinate.

The default options structure can be retrieved using: options = betadf('options').

Examples

Cumulative

>> prob = betadf('c', [0.85 0.9],1,2)
prob =
 0.9900
>> x    = [0:0.01:1];
>> plot(x,betadf('c',x,1,2),'b-',x,betadf('c',x,0.5,0.5),'r-')

Density

>> prob = betadf('d', 0.9, 1, 2)
prob =
  0.2000
>> x    = [0:0.01:1];
>> plot(x,betadf('d',x,1,2),'b-',x,betadf('d',x,0.5,0.5),'r-')

Quantile

>> prob = betadf('q',[0.9775 0.9900]',1,2)
prob =
    0.8500
    0.9000

Random

>> prob = betadf('r',[5 1],1,2)
prob =
    0.3791
    0.2549
    0.8169
    0.0216
    0.1516

See Also

cauchydf, chidf, expdf, gammadf, gumbeldf, laplacedf, logisdf, lognormdf, normdf, paretodf, raydf, triangledf, unifdf, weibulldf