Usage: |
xtremes(x,estimator{,extr,function{,display}})
|
Input: |
| x | n x 1 vector of data
|
| estimator | m x 1 vector, defining the type of estimator:
1: Hill (GP1)
2: Pickands (GP)
3: Drees-Pickands (GP)
4: Moment (GP)
5: MLE (GP)
6: MLE (GP0)
7: Empirical Mean Excess
8: Empirical DF
9: Empirical Quantile Function
10: Kernel Density
When estimator == 7,8,9,10 neither extr nor function is necessary.
|
| extr | optional m x 1 vector, number of extremes. If extr == 0 (default) a
diagram will be displayed (not possible for estimator == 6). extr
has no effect whenever estimator == 7,8,9,10.
|
| function | optional m x 1 vector, determines which function should be displayed
1: Mean Excess Function
2: Distribution Function
3: Quantile Function
4: Density
5: QQ-Plot
function has no effect whenever estimator == 7,8,9,10.
|
| display | optional text, if "no" is specified no graph will be displayed
|
- Example:
library("finance")
xtremes(randx("gp", 100, 1))
- Result:
Several interactive menus are invoked allowing the extreme
value analysis of your data.
- Example:
library("finance")
randomize(123)
; a vector of pseudo random variables with extreme value
; and generalized Pareto distribution
x = randx("gp", 100, 2)
estimator = 1:5
xtremes(x, estimator)
- Result:
Contents of outtext
[1,] "---------------------------------------------------------------"
[2,] " Estimator | extr. | shape | mu | sigma "
[3,] "---------------------------------------------------------------"
[4,] " There is no text output when (extr == 0) "
[5,] " There is no text output when (extr == 0) "
[6,] " There is no text output when (extr == 0) "
[7,] " There is no text output when (extr == 0) "
[8,] " There is no text output when (extr == 0) "
A graphic of five different estimators is displayed as well.
- Example:
library("finance")
randomize(123)
; a vector of pseudo random variables with extreme value
; and generalized Pareto distribution
x = randx("gp", 100, 2)
estimator = 1
extr = aseq(10,8,10)
function = 5
xtremes(x, estimator, extr, function)
- Result:
Contents of outtext
[ 1,] "---------------------------------------------------------------"
[ 2,] " Estimator | extr. | shape | mu | sigma "
[ 3,] "---------------------------------------------------------------"
[ 4,] "Hill (GP1) 10 0.3031 0 0.04783 (GP1 parametrization)"
[ 5,] "Hill (GP1) 20 0.3072 0 0.05438 (GP1 parametrization)"
[ 6,] "Hill (GP1) 30 0.3394 0 0.1036 (GP1 parametrization)"
[ 7,] "Hill (GP1) 40 0.3625 0 0.1493 (GP1 parametrization)"
[ 8,] "Hill (GP1) 50 0.3783 0 0.1828 (GP1 parametrization)"
[ 9,] "Hill (GP1) 60 0.3576 0 0.142 (GP1 parametrization)"
[10,] "Hill (GP1) 70 0.3416 0 0.1177 (GP1 parametrization)"
[11,] "Hill (GP1) 80 0.3067 0 0.0761 (GP1 parametrization)"
Additionally a QQ-plot for the Hill estimator with different numbers
of extremes is displayed.
- Example:
library("finance")
randomize(123)
x = randx("gp", 100, 2)
estimator = 1:6
extr = 20
function = 2
xtremes(x, estimator, extr, function,"no")
- Result:
Contents of outtext
[1,] "---------------------------------------------------------------"
[2,] " Estimator | extr. | shape | mu | sigma "
[3,] "---------------------------------------------------------------"
[4,] "Hill (GP1) 20 0.3072 0 0.05438 (GP1 parametrization)"
[5,] "Pickands (GP) 20 3.458 1.641 0.1144"
[6,] "Drees-Pickands (GP) 20 3.966 4.986 0.03534"
[7,] "Moment (GP) 20 3.152 -3.141 0.2661"
[8,] "MLE (GP) 20 3.009 -3.77 0.3353"
[9,] "MLE (GP0) 20 0 -1.57e+05 9.753e+04"