Normdf: 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 one other user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Normal / Gaussian distribution.
Normal / Gaussian distribution.
===Synopsis===
===Synopsis===
:prob = normdf(function,x,a,b)
:prob = normdf(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 Normal distribution.  
Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Normal distribution.  
This distribution is used for many data types including physical attributes and sums of quantities. It is a symmetric distribution and the variance can be smaller, equal, or larger than the mean.
This distribution is used for many data types including physical attributes and sums of quantities. It is a symmetric distribution and the variance can be smaller, equal, or larger than the mean.
 
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' ].
::<math>f(x)= \frac {1} {b \left ( 2 \pi \right ) ^ {1/2}} \exp \left [ \frac {- \left ( x -a \right )^2} {2b^2} \right ]</math>
* 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.
====Inputs====
* a = mode/location parameter (real).
 
*  b = scale 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''' = mode/location parameter (real).
 
'''b''' = scale 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:====
 
>> prob = normdf('c',[1.9600 2.5758])
====Cumulative====
 
<pre>>> prob = normdf('c',[1.9600 2.5758])
ans =
ans =
     0.9750    0.9950
     0.9750    0.9950
>> x = -5:.1:5;
>> x = -5:.1:5;
>> plot(x,normdf('c',x,0,1)), vline([ 0 ; normdf('q',[0.975; 0.995],0,1)])
>> plot(x,normdf('c',x,0,1)), vline([ 0 ; normdf('q',[0.975; 0.995],0,1)])
====Density:====
</pre>
====Density====
<pre>
>> prob = normdf('d',[1.9600 2.5758],0,1)
>> prob = normdf('d',[1.9600 2.5758],0,1)
ans =
ans =
Line 29: Line 50:
>> x = -5:.1:5;
>> x = -5:.1:5;
>> plot(x,normdf('d',x,0,1)), vline([0; normdf('q',[0.975; 0.995],0,1)])
>> plot(x,normdf('d',x,0,1)), vline([0; normdf('q',[0.975; 0.995],0,1)])
====Quantile:====
</pre>
>>
====Quantile====
<pre>
>> prob = normdf('q',[.975 .995],0,1)
ans =
ans =
     1.9600    2.5758
     1.9600    2.5758
====Random:====
</pre>
====Random====
<pre>
>> prob = normdf('r',[4 1],0,1)
>> prob = normdf('r',[4 1],0,1)
ans =
ans =
Line 40: Line 65:
     0.1253
     0.1253
     0.2877
     0.2877
</pre>
===See Also===
===See Also===
[[betadr]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]
 
[[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]]

Latest revision as of 08:41, 10 October 2008

Purpose

Normal / Gaussian distribution.

Synopsis

prob = normdf(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 Normal distribution.

This distribution is used for many data types including physical attributes and sums of quantities. It is a symmetric distribution and the variance can be smaller, equal, or larger than the mean.



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 = mode/location parameter (real).
  • b = scale 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 = normdf('c',[1.9600 2.5758])
ans =
    0.9750    0.9950
>> x = -5:.1:5;
>> plot(x,normdf('c',x,0,1)), vline([ 0 ; normdf('q',[0.975; 0.995],0,1)])

Density

>> prob = normdf('d',[1.9600 2.5758],0,1)
ans =
    0.0584    0.0145
>> x = -5:.1:5;
>> plot(x,normdf('d',x,0,1)), vline([0; normdf('q',[0.975; 0.995],0,1)])

Quantile

>> prob = normdf('q',[.975 .995],0,1)
ans =
    1.9600    2.5758

Random

>> prob = normdf('r',[4 1],0,1)
ans =
   -0.4326
   -1.6656
    0.1253
    0.2877

See Also

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