Paretodf: Difference between revisions
imported>Jeremy (Importing text file) |
imported>Jeremy No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Line 14: | Line 13: | ||
This distribution is commonly used to model financial data (especially insurance data). It is skewed to the right and the variance may be smaller, equal, or larger than the mean. Negative values in the sample are ignored. | This distribution is commonly used to model financial data (especially insurance data). It is skewed to the right and the variance may be smaller, equal, or larger than the mean. Negative values in the sample are ignored. | ||
::<math>f(x) = \left (ba^b/x^{b+1}\right )</math> | |||
::<math>F(x) = 1 - \left (a/x \right )^b</math> | |||
====Inputs==== | ====Inputs==== | ||
Line 23: | Line 24: | ||
* '''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=random - vector indicating the size of the random matrix to create. | |||
* '''a''' = scale parameter (real and positive). | * '''a''' = scale parameter (real and positive). | ||
Line 34: | 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=== | ||
====Cumulative | ====Cumulative==== | ||
<pre> | |||
>> prob = paretodf('c',2,1,2) | >> prob = paretodf('c',2,1,2) | ||
prob = | prob = | ||
0.7500 | 0.7500 | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,paretodf('c',x,1,2),'b-',x,paretodf('c',x,3,7),'r-') | >> plot(x,paretodf('c',x,1,2),'b-',x,paretodf('c',x,3,7),'r-') | ||
</pre> | |||
====Density | ====Density==== | ||
<pre> | |||
>> prob = paretodf('d',2,1,1) | >> prob = paretodf('d',2,1,1) | ||
prob = | prob = | ||
0.2500 | 0.2500 | ||
>> x = [0:0.1:10]; | >> x = [0:0.1:10]; | ||
>> plot(x,paretodf('d',x,2,1),'b-',x,paretodf('d',x,0.5,1),'r-') | >> plot(x,paretodf('d',x,2,1),'b-',x,paretodf('d',x,0.5,1),'r-') | ||
</pre> | |||
====Quantile | ====Quantile==== | ||
<pre> | |||
>> prob = paretodf('q',0.5,1,2) | >> prob = paretodf('q',0.5,1,2) | ||
prob = | prob = | ||
1.4142 | 1.4142 | ||
</pre> | |||
====Random | ====Random==== | ||
<pre> | |||
>> prob = paretodf('r',[4 1],2,1) | >> prob = paretodf('r',[4 1],2,1) | ||
ans = | ans = | ||
40.1037 | 40.1037 | ||
2.6012 | 2.6012 | ||
5.0870 | 5.0870 | ||
3.8909 | 3.8909 | ||
</pre> | |||
===See Also=== | ===See Also=== | ||
[[ | [[betadf]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[normdf]], [[raydf]], [[triangledf]], [[unifdf]], [[weibulldf]] |
Latest revision as of 09:13, 10 October 2008
Purpose
Pareto distribution.
Synopsis
- prob = paretodf(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 Pareto distribution.
This distribution is commonly used to model financial data (especially insurance data). It is skewed to the right and the variance may be smaller, equal, or larger than the mean. Negative values in the sample are ignored.
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 = scale parameter (real and positive).
- b = shape 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 = paretodf('c',2,1,2) prob = 0.7500 >> x = [0:0.1:10]; >> plot(x,paretodf('c',x,1,2),'b-',x,paretodf('c',x,3,7),'r-')
Density
>> prob = paretodf('d',2,1,1) prob = 0.2500 >> x = [0:0.1:10]; >> plot(x,paretodf('d',x,2,1),'b-',x,paretodf('d',x,0.5,1),'r-')
Quantile
>> prob = paretodf('q',0.5,1,2) prob = 1.4142
Random
>> prob = paretodf('r',[4 1],2,1) ans = 40.1037 2.6012 5.0870 3.8909
See Also
betadf, cauchydf, chidf, expdf, gammadf, gumbeldf, laplacedf, logisdf, lognormdf, normdf, raydf, triangledf, unifdf, weibulldf