Fits \(Y_i \sim \mathrm{GEV}(\mu_i, \sigma, \xi)\) with \(\mu_i = x_i^\top \beta\) by maximum likelihood, using the analytic gradient and several starting values for the shape parameter.
Usage
gevreg.fit(X, y, xi_start = c(-0.2, -0.05, 0.05, 0.2))Value
A list with the estimates, the log-likelihood, the observed information (Hessian of the negative log-likelihood) and the convergence code.
Details
Centring the covariates is strongly recommended: the GEV likelihood is poorly conditioned when covariates are far from the origin, and an uncentred fit may fail to converge without any warning.
Examples
data(itajai)
X <- cbind(1, itajai$pressure - mean(itajai$pressure))
gevreg.fit(X, itajai$wind)
#> $beta
#> [1] 13.3089724 -0.2620223
#>
#> $sigma
#> [1] 2.427901
#>
#> $xi
#> [1] 0.01291573
#>
#> $loglik
#> [1] -305.9101
#>
#> $hessian
#> [,1] [,2] [,3] [,4]
#> [1,] 21.2774039 0.1261344 -23.30733 21.09948
#> [2,] 0.1261344 588.8791067 12.92187 -53.24170
#> [3,] -23.3073268 12.9218712 226.17792 39.32934
#> [4,] 21.0994822 -53.2416966 39.32934 325.87899
#>
#> $par
#> [1] 13.30897237 -0.26202231 0.88702724 0.01291573
#>
#> $convergence
#> [1] 0
#>
#> $X
#> [,1] [,2]
#> [1,] 1 8.56983871
#> [2,] 1 2.04983871
#> [3,] 1 4.36983871
#> [4,] 1 -1.66016129
#> [5,] 1 -3.00016129
#> [6,] 1 -8.57016129
#> [7,] 1 -5.25016129
#> [8,] 1 -3.32016129
#> [9,] 1 -0.34016129
#> [10,] 1 -1.68016129
#> [11,] 1 -1.93016129
#> [12,] 1 -0.56016129
#> [13,] 1 3.20983871
#> [14,] 1 -5.86016129
#> [15,] 1 14.00983871
#> [16,] 1 -5.49016129
#> [17,] 1 -6.57016129
#> [18,] 1 -6.83016129
#> [19,] 1 2.25983871
#> [20,] 1 -1.88016129
#> [21,] 1 3.97983871
#> [22,] 1 6.01983871
#> [23,] 1 -1.14016129
#> [24,] 1 1.61983871
#> [25,] 1 0.02983871
#> [26,] 1 9.89983871
#> [27,] 1 16.82983871
#> [28,] 1 -7.48016129
#> [29,] 1 -2.80016129
#> [30,] 1 -8.68016129
#> [31,] 1 -6.83016129
#> [32,] 1 -2.94016129
#> [33,] 1 2.97983871
#> [34,] 1 -6.99016129
#> [35,] 1 4.27983871
#> [36,] 1 0.14983871
#> [37,] 1 11.61983871
#> [38,] 1 5.04983871
#> [39,] 1 3.93983871
#> [40,] 1 -2.80016129
#> [41,] 1 -6.74016129
#> [42,] 1 -5.06016129
#> [43,] 1 1.37983871
#> [44,] 1 -3.53016129
#> [45,] 1 -0.65016129
#> [46,] 1 -1.34016129
#> [47,] 1 3.46983871
#> [48,] 1 -1.36016129
#> [49,] 1 3.97983871
#> [50,] 1 1.24983871
#> [51,] 1 2.90983871
#> [52,] 1 -0.46016129
#> [53,] 1 0.22983871
#> [54,] 1 -2.20016129
#> [55,] 1 -0.12016129
#> [56,] 1 -5.04016129
#> [57,] 1 1.26983871
#> [58,] 1 -3.84016129
#> [59,] 1 -1.80016129
#> [60,] 1 4.22983871
#> [61,] 1 0.21983871
#> [62,] 1 2.87983871
#> [63,] 1 -0.40016129
#> [64,] 1 -2.94016129
#> [65,] 1 5.51983871
#> [66,] 1 -1.89016129
#> [67,] 1 -4.16016129
#> [68,] 1 0.73983871
#> [69,] 1 -4.53016129
#> [70,] 1 -1.57016129
#> [71,] 1 -1.04016129
#> [72,] 1 8.04983871
#> [73,] 1 4.91983871
#> [74,] 1 -0.83016129
#> [75,] 1 -6.04016129
#> [76,] 1 -8.60016129
#> [77,] 1 2.29983871
#> [78,] 1 -2.35016129
#> [79,] 1 -6.87016129
#> [80,] 1 0.75983871
#> [81,] 1 -0.93016129
#> [82,] 1 -6.60016129
#> [83,] 1 -5.12016129
#> [84,] 1 1.68983871
#> [85,] 1 19.14983871
#> [86,] 1 2.18983871
#> [87,] 1 7.14983871
#> [88,] 1 -8.24016129
#> [89,] 1 -2.63016129
#> [90,] 1 -4.39016129
#> [91,] 1 -2.39016129
#> [92,] 1 -2.28016129
#> [93,] 1 -3.29016129
#> [94,] 1 12.26983871
#> [95,] 1 -4.23016129
#> [96,] 1 4.61983871
#> [97,] 1 7.40983871
#> [98,] 1 2.80983871
#> [99,] 1 3.96983871
#> [100,] 1 -7.42016129
#> [101,] 1 -1.86016129
#> [102,] 1 1.10983871
#> [103,] 1 0.53983871
#> [104,] 1 -3.05016129
#> [105,] 1 -0.35016129
#> [106,] 1 -2.85016129
#> [107,] 1 4.89983871
#> [108,] 1 7.89983871
#> [109,] 1 7.32983871
#> [110,] 1 3.43983871
#> [111,] 1 7.26983871
#> [112,] 1 -2.66016129
#> [113,] 1 5.98983871
#> [114,] 1 -4.90016129
#> [115,] 1 -2.33016129
#> [116,] 1 2.82983871
#> [117,] 1 8.53983871
#> [118,] 1 -4.16016129
#> [119,] 1 -0.76016129
#> [120,] 1 -3.26016129
#> [121,] 1 -3.83016129
#> [122,] 1 -2.83016129
#> [123,] 1 -2.17016129
#> [124,] 1 -7.58016129
#>
#> $y
#> [1] 11.7 16.4 10.5 17.2 11.2 12.3 14.0 17.1 13.7 14.8 13.1 16.0 11.8 17.9 12.2
#> [16] 16.3 13.9 18.8 11.7 15.3 18.1 11.4 11.5 9.6 10.9 11.0 11.9 17.2 11.1 20.2
#> [31] 14.6 20.2 14.1 12.8 17.0 17.5 12.7 16.1 14.9 16.3 17.1 19.6 21.7 23.5 15.6
#> [46] 17.2 9.3 15.1 13.5 12.7 18.3 16.4 17.9 18.2 17.8 18.5 11.4 11.7 15.1 13.4
#> [61] 14.2 13.2 12.7 15.1 13.2 17.9 14.5 16.9 15.8 13.1 11.3 10.0 11.9 19.1 17.4
#> [76] 17.9 12.0 13.1 14.9 13.8 17.7 33.9 13.3 15.0 10.0 14.2 9.0 13.5 14.4 21.0
#> [91] 14.5 11.0 13.7 9.6 15.6 11.1 10.1 15.0 14.2 13.9 11.2 14.4 16.5 17.4 15.1
#> [106] 15.0 11.2 8.2 14.0 9.0 10.2 17.1 12.3 13.8 14.9 14.2 9.5 14.6 14.2 23.4
#> [121] 22.3 20.7 16.4 13.3
#>
#> attr(,"class")
#> [1] "gevreg"
