How to block maxima for Stock losses
R is free software> library ( evir )
Warning messages:
1: package ‘fOptions’ was built under R version 3.5.2
2: package ‘timeDate’ was built under R version 3.5.1
3: package ‘timeSeries’ was built under R version 3.5.1
4: package ‘fBasics’ was built under R version 3.5.2
5: package ‘evir’ was built under R version 3.5.2
> data ( siemens )
> SieLoss <− −100.0 ∗ siemens
> SieGEV <− gev ( SieLoss , block = " semester " )
Error in gev(SieLoss, block = " semester ") : unknown time period
> library(evir)
> SieGEV <− gev ( SieLoss , block = " semester " )
Error in gev(SieLoss, block = " semester ") : unknown time period
> out <- gev(bmw, "month")
Error in gev(bmw, "month") : object 'bmw' not found
> require(graphics)
> fr <- function(x) { ## Rosenbrock Banana function
+ x1 <- x[1]
+ x2 <- x[2]
+ 100 * (x2 - x1 * x1)^2 + (1 - x1)^2
+ }
> grr <- function(x) { ## Gradient of 'fr'
+ x1 <- x[1]
+ x2 <- x[2]
+ c(-400 * x1 * (x2 - x1 * x1) - 2 * (1 - x1),
+ 200 * (x2 - x1 * x1))
+ }
> optim(c(-1.2,1), fr)
$`par`
[1] 1.000260 1.000506
$value
[1] 8.825241e-08
$counts
function gradient
195 NA
$convergence
[1] 0
$message
NULL
> (res <- optim(c(-1.2,1), fr, grr, method = "BFGS"))
$`par`
[1] 1 1
$value
[1] 9.594956e-18
$counts
function gradient
110 43
$convergence
[1] 0
$message
NULL
> optimHess(res$par, fr, grr)
[,1] [,2]
[1,] 802.0004 -400
[2,] -400.0000 200
> optim(c(-1.2,1), fr, NULL, method = "BFGS", hessian = TRUE)
$`par`
[1] 0.9998044 0.9996084
$value
[1] 3.827383e-08
$counts
function gradient
118 38
$convergence
[1] 0
$message
NULL
$hessian
[,1] [,2]
[1,] 801.6881 -399.9218
[2,] -399.9218 200.0000
> optim(c(-1.2,1), fr, grr, method = "CG")
$`par`
[1] -0.7648373 0.5927588
$value
[1] 3.106579
$counts
function gradient
402 101
$convergence
[1] 1
$message
NULL
> optim(c(-1.2,1), fr, grr, method = "CG", control = list(type = 2))
$`par`
[1] 0.9944093 0.9888229
$value
[1] 3.123777e-05
$counts
function gradient
385 101
$convergence
[1] 1
$message
NULL
> optim(c(-1.2,1), fr, grr, method = "L-BFGS-B")
$`par`
[1] 0.9999997 0.9999995
$value
[1] 2.267577e-13
$counts
function gradient
47 47
$convergence
[1] 0
$message
[1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"
> flb <- function(x)
+ { p <- length(x); sum(c(1, rep(4, p-1)) * (x - c(1, x[-p])^2)^2) }
> optim(rep(3, 25), flb, NULL, method = "L-BFGS-B",
+ lower = rep(2, 25), upper = rep(4, 25))
$`par`
[1] 2.000000 2.000000 2.000000 2.000000
[5] 2.000000 2.000000 2.000000 2.000000
[9] 2.000000 2.000000 2.000000 2.000000
[13] 2.000000 2.000000 2.000000 2.000000
[17] 2.000000 2.000000 2.000000 2.000000
[21] 2.000000 2.000000 2.000000 2.109093
[25] 4.000000
$value
[1] 368.1059
$counts
function gradient
6 6
$convergence
[1] 0
$message
[1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"
>
> fw <- function (x)
+ 10*sin(0.3*x)*sin(1.3*x^2) + 0.00001*x^4 + 0.2*x+80
>
> plot(fw, -50, 50, n = 1000, main = "optim() minimising 'wild function'")
>
> res <- optim(50, fw, method = "SANN",
+ control = list(maxit = 20000, temp = 20, parscale = 20))
> res
$`par`
[1] -15.8146
$value
[1] 67.4703
$counts
function gradient
20000 NA
$convergence
[1] 0
$message
NULL
> (r2 <- optim(res$par, fw, method = "BFGS"))
$`par`
[1] -15.81515
$value
[1] 67.46773
$counts
function gradient
16 3
$convergence
[1] 0
$message
NULL
> points(r2$par, r2$value, pch = 8, col = "red", cex = 2)
> library(stats)
> eurodistmat <- as.matrix(eurodist)
>
> distance <- function(sq) { # Target function
+ sq2 <- embed(sq, 2)
+ sum(eurodistmat[cbind(sq2[,2], sq2[,1])])
+ }
> genseq <- function(sq) { # Generate new candidate sequence
+ idx <- seq(2, NROW(eurodistmat)-1)
+ changepoints <- sample(idx, size = 2, replace = FALSE)
+ tmp <- sq[changepoints[1]]
+ sq[changepoints[1]] <- sq[changepoints[2]]
+ sq[changepoints[2]] <- tmp
+ sq
+ }
> sq <- c(1:nrow(eurodistmat), 1)
> loc <- -cmdscale(eurodist, add = TRUE)$points
> x <- loc[,1]; y <- loc[,2]
> s <- seq_len(nrow(eurodistmat))
> tspinit <- loc[sq,]
>
> plot(x, y, type = "n", asp = 1, xlab = "", ylab = "",
+ main = "initial solution of traveling salesman problem", axes = FALSE)
> arrows(tspinit[s,1], tspinit[s,2], tspinit[s+1,1], tspinit[s+1,2],
+ angle = 10, col = "green")
> text(x, y, labels(eurodist), cex = 0.8)
> set.seed(123)
> res <- optim(sq, distance, genseq, method = "SANN",
+ control = list(maxit = 30000, temp = 2000, trace = TRUE,
+ REPORT = 500))
sann objective function values
initial value 29625.000000
iter 5000 value 13585.000000
iter 10000 value 13092.000000
iter 15000 value 13063.000000
iter 20000 value 12919.000000
iter 25000 value 12907.000000
iter 29999 value 12842.000000
final value 12842.000000
sann stopped after 29999 iterations
> tspres <- loc[res$par,]
> plot(x, y, type = "n", asp = 1, xlab = "", ylab = "",
+ main = "optim() 'solving' traveling salesman problem", axes = FALSE)
> arrows(tspres[s,1], tspres[s,2], tspres[s+1,1], tspres[s+1,2],
+ angle = 10, col = "red")
> text(x, y, labels(eurodist), cex = 0.8)
> system.time(rO <- optimize(function(x) (x-pi)^2, c(0, 10)))
user system elapsed
0 0 0
> system.time(ro <- optim(1, function(x) (x-pi)^2, control=list(warn.1d.NelderMead = FALSE)))
user system elapsed
0 0 0
> rO$minimum - pi # 0 (perfect), on one platform
[1] 0
> ro$par - pi # ~= 1.9e-4 on one platform
[1] -0.0001864036
> utils::str(ro)
List of 5
$ par : num 3.14
$ value : num 3.47e-08
$ counts : Named int [1:2] 32 NA
..- attr(*, "names")= chr [1:2] "function" "gradient"
$ convergence: int 0
$ message : NULL
> library("evir", lib.loc="~/R/win-library/3.5")
> SieGEV <− gev ( SieLoss , block = " semester " )
Error in gev(SieLoss, block = " semester ") : unknown time period
> SieGEV <− gev ( SieLoss , block = " month " )
Error in gev(SieLoss, block = " month ") : unknown time period
> data(bmw)
> out <- gev(bmw, "month")
> out
$`n.all`
[1] 6146
$n
[1] 283
$data
[1] 0.047704097 0.040072550 0.057006818
[4] 0.042967868 0.022428128 0.040120865
[7] 0.030498439 0.025262456 0.057779537
[10] 0.039382379 0.031748698 0.021695014
[13] 0.085708790 0.017057713 0.073563768
[16] 0.018876364 0.033584741 0.058143393
[19] 0.042326924 0.009595910 0.032909034
[22] 0.051069736 0.043738236 0.050509198
[25] 0.066278121 0.040930359 0.036095789
[28] 0.029984390 0.020905075 0.032823886
[31] 0.026219918 0.047408878 0.047743616
[34] 0.018994386 0.027733998 0.031215494
[37] 0.027928237 0.011354940 0.040061610
[40] 0.015156798 0.016943433 0.015530942
[43] 0.022243069 0.012447720 0.010386600
[46] 0.029017005 0.015888185 0.012732589
[49] 0.010195424 0.018930242 0.027147614
[52] 0.017685602 0.011002997 0.026742729
[55] 0.023126669 0.010324201 0.016317671
[58] 0.022688656 0.018503749 0.029676230
[61] 0.017803681 0.028395043 0.011157337
[64] 0.020159906 0.008803704 0.027067868
[67] 0.013293438 0.020227519 0.028373642
[70] 0.017675785 0.017558952 0.015440693
[73] 0.020048081 0.010208282 0.038070120
[76] 0.029718365 0.015372579 0.010795260
[79] 0.008982199 0.030438497 0.068411993
[82] 0.010744914 0.033322322 0.011913702
[85] 0.013162712 0.027771744 0.019664256
[88] 0.040528019 0.018800955 0.033664422
[91] 0.024044674 0.027267717 0.016999328
[94] 0.069930216 0.025860543 0.022775877
[97] 0.035147558 0.029596241 0.023585409
[100] 0.012656443 0.020927520 0.040695897
[103] 0.019978081 0.031988439 0.025409997
[106] 0.021238736 0.045243354 0.039014446
[109] 0.013019157 0.044288785 0.027986842
[112] 0.028975106 0.015568407 0.014595571
[115] 0.017141573 0.014628069 0.028136965
[118] 0.022023821 0.022388485 0.017276267
[121] 0.018211336 0.028117197 0.029418132
[124] 0.017657790 0.038427474 0.032953268
[127] 0.015801683 0.037267309 0.034521814
[130] 0.030317974 0.015823230 0.040316266
[133] 0.021733491 0.020395699 0.021325364
[136] 0.018883156 0.021034092 0.016287900
[139] 0.026655237 0.025479085 0.016252641
[142] 0.030026651 0.029463070 0.054088773
[145] 0.030317974 0.050467667 0.090348294
[148] 0.028732294 0.016799955 0.011537384
[151] 0.029699096 0.066342789 0.019648619
[154] 0.051285118 0.041242959 0.033119684
[157] 0.088410957 0.030153038 0.034251807
[160] 0.011888294 0.055775683 0.046194152
[163] 0.028076501 0.034191365 0.044215223
[166] 0.066280459 0.044012805 0.027359104
[169] 0.035537302 0.043172876 0.117191789
[172] 0.053856606 0.043313442 0.046766994
[175] 0.029291783 0.033416901 0.036793770
[178] 0.029772202 0.016362673 0.071609532
[181] 0.085028505 0.028179646 0.013151022
[184] 0.016368476 0.018105128 0.024107501
[187] 0.040991244 0.026881436 0.024632454
[190] 0.012288641 0.024679312 0.028208721
[193] 0.018634561 0.021706789 0.024693705
[196] 0.057176834 0.015042360 0.012608702
[199] 0.017940725 0.029723723 0.036431458
[202] 0.026984661 0.017313206 0.057152069
[205] 0.051660609 0.041497805 0.033114946
[208] 0.026184444 0.013923817 0.026675428
[211] 0.029396614 0.019142057 0.021650150
[214] 0.059098050 0.039794958 0.067674756
[217] 0.088632045 0.062040653 0.041325860
[220] 0.016045377 0.042388410 0.040997961
[223] 0.018651503 0.018750425 0.019290632
[226] 0.044707716 0.005662407 0.009850060
[229] 0.023593976 0.014741345 0.018630817
[232] 0.018749337 0.016068787 0.018174172
[235] 0.035958313 0.007357140 0.024359967
[238] 0.025035790 0.055598597 0.035407724
[241] 0.020823390 0.011553667 0.017623795
[244] 0.023831384 0.020582821 0.029107995
[247] 0.012860773 0.021955587 0.068605893
[250] 0.016159641 0.014116384 0.037276749
[253] 0.079474594 0.066689116 0.016613801
[256] 0.017747906 0.024150295 0.018389544
[259] 0.016504432 0.019881371 0.035009410
[262] 0.018259789 0.009618542 0.030405515
[265] 0.013192803 0.030913346 0.021380795
[268] 0.011232361 0.019076147 0.022407876
[271] 0.031367270 0.025284978 0.024784416
[274] 0.016912398 0.009060769 0.022973983
[277] 0.033093688 0.015351852 0.016209831
[280] 0.026569373 0.017001017 0.015623468
[283] 0.019133955
$block
[1] "month"
$par.ests
xi sigma mu
0.22084471 0.01016219 0.02104994
$par.ses
xi sigma mu
0.0538218570 0.0005249399 0.0006934577
$varcov
[,1] [,2] [,3]
[1,] 2.896792e-03 -2.617132e-06 -1.249425e-05
[2,] -2.617132e-06 2.755619e-07 2.157608e-07
[3,] -1.249425e-05 2.157608e-07 4.808836e-07
$converged
[1] 0
$nllh.final
[1] -816.0357
attr(,"class")
[1] "gev"
>
>
>
> out<- gev(bmw,"month")
> out <- gev(bmw, 100)
> SieGEV <− gev( SieLoss,block ="month")
> plot (SieGEV$data,type = " h " , col = " blue ", xlab = " " ,
+ ylab = " Block Maxima" ,
+ main = "Maximum BiannualLossesof Siemens " )
Error in plot.xy(xy, type, ...) : invalid plot type ' '
In addition: Warning message:
In plot.xy(xy, type, ...) :
plot type ' h ' will be truncated to first character
> plot (SieGEV$data,type = " h ", col = " blue ", xlab = " " ,ylab = " Block Maxima" , main = "Maximum BiannualLossesof Siemens ")
Error in plot.xy(xy, type, ...) : invalid plot type ' '
In addition: Warning message:
In plot.xy(xy, type, ...) :
plot type ' h ' will be truncated to first character
> plot (SieGEV$data,type = "h", col = "blue", xlab = " ,ylab = " Block Maxima" , main = "Maximum Biannual Losses of Siemens")
Error: unexpected symbol in "plot (SieGEV$data,type = "h", col = "blue", xlab = " ,ylab = " Block"
> SieGEV
$`n.all`
[1] 6146
$n
[1] 283
$data
[1] 1.6536690 3.4026271 3.5896764
[4] 2.4363154 2.2190569 2.6621690
[7] 3.0927687 3.5197198 2.4184353
[10] 2.3467744 2.1210311 1.5029506
[13] 2.1874949 3.4257494 2.0331069
[16] 2.8475728 2.2709367 2.0191972
[19] 1.4117882 3.1748698 1.6491702
[22] 2.2267549 3.1872617 1.9841921
[25] 1.5604298 1.4921810 0.9151478
[28] 0.5331159 1.3761685 1.8930788
[31] 2.7684999 0.9991000 1.0722813
[34] 1.8397365 1.5435808 1.0640662
[37] 0.9368628 1.0730908 1.9506175
[40] 1.3471241 3.5896546 1.6234766
[43] 1.7286863 1.2846423 0.9982115
[46] 2.1193397 1.0924478 2.4508885
[49] 2.9427001 1.6106459 0.8926898
[52] 1.2969331 1.2121361 0.5624068
[55] 2.1739987 1.6633335 0.7278987
[58] 0.9950331 0.5942293 0.7528266
[61] 0.9508788 0.8940779 1.6221919
[64] 1.0400094 2.3063940 1.6047642
[67] 0.5065439 0.6480379 1.1514918
[70] 1.3880849 0.6595562 1.8634080
[73] 1.0929071 1.7669791 1.7094433
[76] 0.8688152 2.7912846 2.6773598
[79] 0.8360885 1.4056001 0.9356272
[82] 1.1575692 0.5542542 2.0636656
[85] 1.1870880 1.8915038 1.6469543
[88] 1.6116384 4.9999547 1.1622840
[91] 0.7788521 0.6306682 0.6920443
[94] 1.5674302 0.8240188 1.4173466
[97] 1.2407107 1.7079834 2.2397353
[100] 3.3175862 3.3228516 0.5922183
[103] 1.7978998 0.7527155 1.3144137
[106] 3.5107748 2.7424887 3.9298765
[109] 1.7241806 0.6972140 1.0398707
[112] 1.1096998 3.5335848 1.7425417
[115] 1.0779134 1.6385415 1.1560822
[118] 2.2122571 4.4886451 2.5135973
[121] 1.7623495 0.7214460 3.1989716
[124] 0.9447139 1.4484497 1.4198687
[127] 3.2918569 1.8343128 1.9322879
[130] 2.3835173 1.1528403 0.7318097
[133] 1.5378692 3.2633218 0.8741717
[136] 0.8289248 1.5479779 1.1374279
[139] 1.7396470 1.4001306 2.0545854
[142] 1.2002326 0.9077941 1.7542311
[145] 1.5805540 1.2834196 2.8254668
[148] 2.8259337 3.0883472 1.0949014
[151] 1.6965534 2.4391453 3.4268457
[154] 1.4953550 2.4938948 2.6579638
[157] 3.5718083 4.7905600 1.1379924
[160] 1.3513719 6.6021101 4.0637646
[163] 3.8652154 2.5001302 2.8358865
[166] 1.4556298 2.6126305 1.7518696
[169] 6.3867284 3.1010237 8.6568016
[172] 3.7944932 2.8393075 3.4635497
[175] 1.4144507 2.4259950 5.6995481
[178] 2.6472134 1.9652938 7.2320662
[181] 4.7829088 1.1770863 1.7784756
[184] 1.0294897 8.1770542 3.3198069
[187] 3.2595478 1.3297028 2.5196294
[190] 2.0831702 1.0382349 2.0367303
[193] 3.0934190 1.9465795 1.3685825
[196] 1.4377849 2.3776127 0.7466900
[199] 1.5325970 1.0976676 0.9890283
[202] 1.8210658 2.2436317 12.0111624
[205] 2.6916164 2.5308099 2.7487583
[208] 2.8735689 1.5320721 2.1862414
[211] 1.9762419 1.5716073 1.2565746
[214] 6.0060331 2.9175489 2.8963547
[217] 3.4198861 2.3000384 1.3762774
[220] 1.4864023 2.7354883 1.7335580
[223] 0.9072227 2.3636616 1.2646683
[226] 9.3806420 1.0966208 0.9709587
[229] 0.9623170 0.7572981 1.2196383
[232] 0.9762859 2.0181874 1.1351194
[235] 0.6193797 1.3728856 2.7488846
[238] 1.8836173 1.4787700 3.3931668
[241] 2.2802854 1.0756865 2.2783174
[244] 1.2495070 2.8341671 1.2006069
[247] 1.1539554 1.1361914 1.8208750
[250] 2.1920309 1.9187432 0.9584072
[253] 4.9052494 2.5863511 2.2497957
[256] 2.0670434 2.0282303 2.0100492
[259] 2.0702936 3.6473998 1.3965681
[262] 1.5479044 3.4507620 3.2426724
[265] 1.4998751 1.1565900 1.2561791
[268] 0.8417013 2.0926198 2.0305266
[271] 1.6009918 1.1278315 1.9391189
[274] 0.9086656 3.3403239 2.9323615
[277] 0.5704793 1.4510533 1.7931181
[280] 1.1174629 1.5387715 1.4401030
[283] 2.1357596
$block
[1] "month"
$par.ests
xi sigma mu
0.2591183 0.7181868 1.4309933
$par.ses
xi sigma mu
0.05438777 0.04055958 0.04922595
$varcov
[,1] [,2] [,3]
[1,] 0.0029580294 -0.000196826 -0.0008900357
[2,] -0.0001968260 0.001645080 0.0012402593
[3,] -0.0008900357 0.001240259 0.0024231940
$converged
[1] 0
$nllh.final
[1] 394.6513
attr(,"class")
[1] "gev"
> plot (SieGEV$data,type = "h", col = "blue", xlab = " ,ylab = " Block Maxima" , main = "Maximum Biannual Losses of Siemens")
Error: unexpected symbol in "plot (SieGEV$data,type = "h", col = "blue", xlab = " ,ylab = " Block"
> plot ( SieGEV$data , type = " h " , col = " blue " , xlab = " " ,
+ ylab = " Block Maxima" ,
+ main = "Maximum Biannual Losses of Siemens " )
Error in plot.xy(xy, type, ...) : invalid plot type ' '
In addition: Warning message:
In plot.xy(xy, type, ...) :
plot type ' h ' will be truncated to first character
> plot(out)
Make a plot selection (or 0 to exit):
1: plot: Scatterplot of Residuals
2: plot: QQplot of Residuals
Selection:
Enter an item from the menu, or 0 to exit
Selection:
Enter an item from the menu, or 0 to exit
Selection: 1
Make a plot selection (or 0 to exit):
1: plot: Scatterplot of Residuals
2: plot: QQplot of Residuals
Selection: 2
Make a plot selection (or 0 to exit):
1: plot: Scatterplot of Residuals
2: plot: QQplot of Residuals
Selection: 3
Enter an item from the menu, or 0 to exit
Selection: 0
> data(danish)
> qplot(danish)
> plot(out)
Make a plot selection (or 0 to exit):
1: plot: Scatterplot of Residuals
2: plot: QQplot of Residuals
Selection: 1
Make a plot selection (or 0 to exit):
1: plot: Scatterplot of Residuals
2: plot: QQplot of Residuals
Selection: 2
Make a plot selection (or 0 to exit):
1: plot: Scatterplot of Residuals
2: plot: QQplot of Residuals
Selection: 3
Enter an item from the menu, or 0 to exit
Selection: 4
Enter an item from the menu, or 0 to exit
Selection: 0
> data(bmw)
> out <- pot(-bmw, ne = 200)
> decluster(out$data, 30)
Declustering picture...
Data reduced from 200 to 70
[1] 0.05525992 0.05084288 0.06689143
[4] 0.06887800 0.04688708 0.10617520
[7] 0.05865478 0.04071008 0.02896766
[10] 0.02913723 0.04122546 0.03094040
[13] 0.02659780 0.03465775 0.02606819
[16] 0.02710781 0.06955422 0.03859640
[19] 0.03845126 0.06807869 0.02732490
[22] 0.04194781 0.02563799 0.04957226
[25] 0.03744841 0.02652559 0.03021099
[28] 0.04541566 0.02695412 0.03051167
[31] 0.03984488 0.02648610 0.04525858
[34] 0.03938106 0.03236528 0.05561317
[37] 0.03191673 0.04609111 0.06519183
[40] 0.03668970 0.03540193 0.04491698
[43] 0.04880244 0.04565154 0.04148352
[46] 0.02619353 0.10852160 0.02954286
[49] 0.03225168 0.14061565 0.02895132
[52] 0.02834847 0.03360120 0.07529138
[55] 0.04328683 0.03405556 0.02677080
[58] 0.03221330 0.10577463 0.02764203
[61] 0.05806183 0.03004121 0.03973532
[64] 0.02892858 0.02688352 0.04001846
[67] 0.03412405 0.03232889 0.03123302
[70] 0.03490287
attr(,"times")
[1] "1973-02-05 05:30:00 IST"
[2] "1973-07-26 05:30:00 IST"
[3] "1973-11-14 05:30:00 IST"
[4] "1973-12-31 05:30:00 IST"
[5] "1974-05-09 05:30:00 IST"
[6] "1974-07-05 05:30:00 IST"
[7] "1974-09-30 05:30:00 IST"
[8] "1975-05-27 05:30:00 IST"
[9] "1976-04-06 05:30:00 IST"
[10] "1976-07-28 05:30:00 IST"
[11] "1976-10-12 05:30:00 IST"
[12] "1976-11-15 05:30:00 IST"
[13] "1977-02-18 05:30:00 IST"
[14] "1977-07-08 05:30:00 IST"
[15] "1977-12-06 05:30:00 IST"
[16] "1978-06-21 05:30:00 IST"
[17] "1979-07-11 05:30:00 IST"
[18] "1980-01-21 05:30:00 IST"
[19] "1980-03-18 05:30:00 IST"
[20] "1980-06-20 05:30:00 IST"
[21] "1980-09-08 05:30:00 IST"
[22] "1981-01-27 05:30:00 IST"
[23] "1981-04-29 05:30:00 IST"
[24] "1981-06-26 05:30:00 IST"
[25] "1981-08-25 05:30:00 IST"
[26] "1982-04-27 05:30:00 IST"
[27] "1982-08-17 05:30:00 IST"
[28] "1982-09-27 05:30:00 IST"
[29] "1983-01-24 05:30:00 IST"
[30] "1983-07-12 05:30:00 IST"
[31] "1984-02-09 05:30:00 IST"
[32] "1984-03-12 05:30:00 IST"
[33] "1984-07-05 05:30:00 IST"
[34] "1984-10-19 05:30:00 IST"
[35] "1985-03-25 05:30:00 IST"
[36] "1985-07-10 05:30:00 IST"
[37] "1985-09-13 05:30:00 IST"
[38] "1985-11-05 05:30:00 IST"
[39] "1986-02-27 05:30:00 IST"
[40] "1986-04-28 05:30:00 IST"
[41] "1986-06-03 05:30:00 IST"
[42] "1986-07-04 05:30:00 IST"
[43] "1986-09-05 05:30:00 IST"
[44] "1987-02-04 05:30:00 IST"
[45] "1987-04-27 05:30:00 IST"
[46] "1987-06-02 05:30:00 IST"
[47] "1987-11-09 05:30:00 IST"
[48] "1988-03-25 05:30:00 IST"
[49] "1988-05-11 05:30:00 IST"
[50] "1989-10-16 05:30:00 IST"
[51] "1990-01-04 05:30:00 IST"
[52] "1990-02-26 05:30:00 IST"
[53] "1990-04-23 05:30:00 IST"
[54] "1990-09-25 05:30:00 IST"
[55] "1991-01-14 05:30:00 IST"
[56] "1991-02-26 05:30:00 IST"
[57] "1991-05-17 05:30:00 IST"
[58] "1991-06-28 05:30:00 IST"
[59] "1991-08-19 05:30:00 IST"
[60] "1992-05-13 05:30:00 IST"
[61] "1992-09-24 05:30:00 IST"
[62] "1993-01-25 05:30:00 IST"
[63] "1993-05-14 05:30:00 IST"
[64] "1993-07-27 05:30:00 IST"
[65] "1993-11-22 05:30:00 IST"
[66] "1994-06-20 05:30:00 IST"
[67] "1994-11-23 05:30:00 IST"
[68] "1995-03-09 05:30:00 IST"
[69] "1995-09-22 05:30:00 IST"
[70] "1995-10-23 05:30:00 IST"
> out <- pot(-bmw, ne = 200)
> decluster(out$data, 30)
Declustering picture...
Data reduced from 200 to 70
[1] 0.05525992 0.05084288 0.06689143
[4] 0.06887800 0.04688708 0.10617520
[7] 0.05865478 0.04071008 0.02896766
[10] 0.02913723 0.04122546 0.03094040
[13] 0.02659780 0.03465775 0.02606819
[16] 0.02710781 0.06955422 0.03859640
[19] 0.03845126 0.06807869 0.02732490
[22] 0.04194781 0.02563799 0.04957226
[25] 0.03744841 0.02652559 0.03021099
[28] 0.04541566 0.02695412 0.03051167
[31] 0.03984488 0.02648610 0.04525858
[34] 0.03938106 0.03236528 0.05561317
[37] 0.03191673 0.04609111 0.06519183
[40] 0.03668970 0.03540193 0.04491698
[43] 0.04880244 0.04565154 0.04148352
[46] 0.02619353 0.10852160 0.02954286
[49] 0.03225168 0.14061565 0.02895132
[52] 0.02834847 0.03360120 0.07529138
[55] 0.04328683 0.03405556 0.02677080
[58] 0.03221330 0.10577463 0.02764203
[61] 0.05806183 0.03004121 0.03973532
[64] 0.02892858 0.02688352 0.04001846
[67] 0.03412405 0.03232889 0.03123302
[70] 0.03490287
attr(,"times")
[1] "1973-02-05 05:30:00 IST"
[2] "1973-07-26 05:30:00 IST"
[3] "1973-11-14 05:30:00 IST"
[4] "1973-12-31 05:30:00 IST"
[5] "1974-05-09 05:30:00 IST"
[6] "1974-07-05 05:30:00 IST"
[7] "1974-09-30 05:30:00 IST"
[8] "1975-05-27 05:30:00 IST"
[9] "1976-04-06 05:30:00 IST"
[10] "1976-07-28 05:30:00 IST"
[11] "1976-10-12 05:30:00 IST"
[12] "1976-11-15 05:30:00 IST"
[13] "1977-02-18 05:30:00 IST"
[14] "1977-07-08 05:30:00 IST"
[15] "1977-12-06 05:30:00 IST"
[16] "1978-06-21 05:30:00 IST"
[17] "1979-07-11 05:30:00 IST"
[18] "1980-01-21 05:30:00 IST"
[19] "1980-03-18 05:30:00 IST"
[20] "1980-06-20 05:30:00 IST"
[21] "1980-09-08 05:30:00 IST"
[22] "1981-01-27 05:30:00 IST"
[23] "1981-04-29 05:30:00 IST"
[24] "1981-06-26 05:30:00 IST"
[25] "1981-08-25 05:30:00 IST"
[26] "1982-04-27 05:30:00 IST"
[27] "1982-08-17 05:30:00 IST"
[28] "1982-09-27 05:30:00 IST"
[29] "1983-01-24 05:30:00 IST"
[30] "1983-07-12 05:30:00 IST"
[31] "1984-02-09 05:30:00 IST"
[32] "1984-03-12 05:30:00 IST"
[33] "1984-07-05 05:30:00 IST"
[34] "1984-10-19 05:30:00 IST"
[35] "1985-03-25 05:30:00 IST"
[36] "1985-07-10 05:30:00 IST"
[37] "1985-09-13 05:30:00 IST"
[38] "1985-11-05 05:30:00 IST"
[39] "1986-02-27 05:30:00 IST"
[40] "1986-04-28 05:30:00 IST"
[41] "1986-06-03 05:30:00 IST"
[42] "1986-07-04 05:30:00 IST"
[43] "1986-09-05 05:30:00 IST"
[44] "1987-02-04 05:30:00 IST"
[45] "1987-04-27 05:30:00 IST"
[46] "1987-06-02 05:30:00 IST"
[47] "1987-11-09 05:30:00 IST"
[48] "1988-03-25 05:30:00 IST"
[49] "1988-05-11 05:30:00 IST"
[50] "1989-10-16 05:30:00 IST"
[51] "1990-01-04 05:30:00 IST"
[52] "1990-02-26 05:30:00 IST"
[53] "1990-04-23 05:30:00 IST"
[54] "1990-09-25 05:30:00 IST"
[55] "1991-01-14 05:30:00 IST"
[56] "1991-02-26 05:30:00 IST"
[57] "1991-05-17 05:30:00 IST"
[58] "1991-06-28 05:30:00 IST"
[59] "1991-08-19 05:30:00 IST"
[60] "1992-05-13 05:30:00 IST"
[61] "1992-09-24 05:30:00 IST"
[62] "1993-01-25 05:30:00 IST"
[63] "1993-05-14 05:30:00 IST"
[64] "1993-07-27 05:30:00 IST"
[65] "1993-11-22 05:30:00 IST"
[66] "1994-06-20 05:30:00 IST"
[67] "1994-11-23 05:30:00 IST"
[68] "1995-03-09 05:30:00 IST"
[69] "1995-09-22 05:30:00 IST"
[70] "1995-10-23 05:30:00 IST"
> out <- pot(danish,10)
> plot(out)
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 1
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 2
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 3
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 4
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 5
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 6
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 7
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 8
Make a plot selection (or 0 to exit):
1: plot: Excess Distribution
2: plot: Tail of Underlying Distribution
3: plot: Scatterplot of Residuals
4: plot: QQplot of Residuals
Selection: 0
Make a plot selection (or 0 to exit):
1: plot: Point Process of Exceedances
2: plot: Scatterplot of Gaps
3: plot: Qplot of Gaps
4: plot: ACF of Gaps
5: plot: Scatterplot of Residuals
6: plot: Qplot of Residuals
7: plot: ACF of Residuals
8: plot: Go to GPD Plots
Selection: 0
> out <- gpd(danish, 10)
> shape(danish)
> hill(danish)
> hill(danish, option = "quantile", end = 500, p = 0.999)
> quant(danish, 0.999)
> out <- gpd(danish, 10)
> tp <- tailplot(out)
> gpd.q(tp, 0.999)
Lower CI Estimate Upper CI
64.66184 94.28956 188.91752
> gpd.sfall(tp, 0.999)
Lower CI Estimate Upper CI
96.64625 191.36972 394.87555
0 Comments