predict: Prediction of the marginal parameters for various models

Description Usage Arguments Value Author(s) Examples

Description

This function predicts the marginal GEV parameters from a fitted max-stable process, copula, penalized spline or spatial GEV model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'maxstab'
predict(object, newdata, ret.per = NULL, std.err =
TRUE, ...)
## S3 method for class 'copula'
predict(object, newdata, ret.per = NULL, std.err =
TRUE, ...)
## S3 method for class 'pspline2'
predict(object, newdata, ...)
## S3 method for class 'spatgev'
predict(object, newdata, ret.per = NULL, ...)

Arguments

object

An object of class 'maxstab', 'copula', 'pspline' or 'spatgev'. Most often, it will be the output of one of the following functions: rbpspline, fitmaxstab, fitcopula or fitspatgev.

newdata

An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.

ret.per

Numeric vector giving the return periods for which return levels are computed. If NULL (default), no return levels are computed.

std.err

Logical. If TRUE (default), standard erros will be computed if possible.

...

further arguments passed to or from other methods.

Value

Print several information on screen.

Author(s)

Mathieu Ribatet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## 1- Simulate a max-stable random field
n.site <- 35
locations <- matrix(runif(2*n.site, 0, 10), ncol = 2)
colnames(locations) <- c("lon", "lat")

data <- rmaxstab(50, locations, cov.mod = "whitmat", nugget = 0, range = 30,
smooth = 0.5)

## 2- Transformation to non unit Frechet margins
param.loc <- -10 + 2 * locations[,2]
param.scale <- 5 + 2 * locations[,1]
param.shape <- rep(0.2, n.site)

for (i in 1:n.site)
  data[,i] <- frech2gev(data[,i], param.loc[i], param.scale[i],
param.shape[i])

## 3- Fit a max-stable process with the following model for
##    the GEV parameters
form.loc <- loc ~ lat
form.scale <- scale ~ lon
form.shape <- shape ~ 1

schlather <- fitmaxstab(data, locations, "whitmat", loc.form = form.loc,
                        scale.form = form.scale, shape.form =
                        form.shape)

## 4- GEV parameters estimates at each locations or at ungauged locations
predict(schlather)
ungauged <- data.frame(lon = runif(10, 0, 10), lat = runif(10, 0, 10))
predict(schlather, ungauged)

Example output

Computing appropriate starting values
Starting values are defined
Starting values are:
       nugget         range        smooth     locCoeff1     locCoeff2 
  0.002908808  65.540491656   0.390639296 -10.705610175   2.009072539 
  scaleCoeff1   scaleCoeff2   shapeCoeff1 
  5.272238450   1.847172211   0.246049060 
         lon       lat        loc     scale     shape loc.std.err scale.std.err
1  2.8774053 5.7649977  1.3355118 10.864517 0.2276012   0.6562579     1.0814767
2  4.0774157 9.0052171  7.7849232 13.115536 0.2276012   0.7210206     1.2980379
3  8.6863300 5.4756715  0.7596300 21.761090 0.2276012   0.6534219     2.1528266
4  6.9621408 4.3048413 -1.5708190 18.526799 0.2276012   0.6473368     1.8305316
5  6.2341626 3.3318003 -3.5075833 17.161233 0.2276012   0.6489600     1.6951447
6  1.2989609 6.7510905  3.2982548  7.903619 0.2276012   0.6697523     0.8067003
7  1.7988093 2.7972677 -4.5715301  8.841251 0.2276012   0.6524255     0.8919180
8  7.4149735 0.2340512 -9.6734183 19.376237 0.2276012   0.6930605     1.9149804
9  6.2211072 9.9929180  9.7508669 17.136743 0.2276012   0.7512925     1.6927214
10 1.1781603 8.9742502  7.7232859  7.677017 0.2276012   0.7201421     0.7864480
11 2.2873050 6.3134150  2.4270949  9.757587 0.2276012   0.6630438     0.9769777
12 6.3476578 9.6919829  9.1518785 17.374131 0.2276012   0.7416203     1.7162183
13 9.1413056 7.8881363  5.5614584 22.614548 0.2276012   0.6922779     2.2381637
14 2.4269655 9.8232180  9.4130919 10.019567 0.2276012   0.7457916     1.0015561
15 0.8202037 5.4247389  0.6582524  7.005550 0.2276012   0.6529766     0.7273966
16 1.8603651 8.3005633  6.3823630  8.956719 0.2276012   0.7021658     0.9025501
17 1.0365130 0.7684503 -8.6097373  7.411310 0.2276012   0.6814848     0.7628993
18 3.0893735 4.9851183 -0.2167792 11.262134 0.2276012   0.6498115     1.1193851
19 4.0910993 5.0577529 -0.0722055 13.141204 0.2276012   0.6502502     1.3005309
20 4.9031309 2.7841074 -4.5977246 14.664440 0.2276012   0.6525336     1.4491797
21 6.4672485 3.6642250 -2.8459172 17.598463 0.2276012   0.6477221     1.7384379
22 2.3296109 7.3357171  4.4619098  9.836946 0.2276012   0.6804401     0.9844119
23 5.6089020 6.0442626  1.8913674 15.988349 0.2276012   0.6594850     1.5793070
24 8.5913013 5.7749266  1.3552746 21.582832 0.2276012   0.6563645     2.1350158
25 9.1280265 5.6374017  1.0815417 22.589639 0.2276012   0.6549432     2.2356717
26 5.3696750 8.0138576  5.8116972 15.539599 0.2276012   0.6951991     1.5351172
27 1.9198036 3.9367462 -2.3034844  9.068216 0.2276012   0.6472358     0.9128418
28 0.3207060 2.9842610 -4.1993339  6.068576 0.2276012   0.6510076     0.6479894
29 1.1316398 4.0511694 -2.0757337  7.589752 0.2276012   0.6471738     0.7786895
30 8.6355584 9.8057639  9.3783509 21.665851 0.2276012   0.7452326     2.1433101
31 0.1660605 8.8877893  7.5511919  5.778487 0.2276012   0.7177130     0.6242950
32 8.3034460 3.6298900 -2.9142585 21.042863 0.2276012   0.6478172     2.0810940
33 5.4394543 4.4954734 -1.1913801 15.670493 0.2276012   0.6477314     1.5479986
34 0.2504531 1.8160690 -6.5245317  5.936793 0.2276012   0.6634211     0.6371660
35 1.3650421 4.3087142 -1.5631103  8.027576 0.2276012   0.6473425     0.8178404
   shape.std.err
1     0.07908092
2     0.07908092
3     0.07908092
4     0.07908092
5     0.07908092
6     0.07908092
7     0.07908092
8     0.07908092
9     0.07908092
10    0.07908092
11    0.07908092
12    0.07908092
13    0.07908092
14    0.07908092
15    0.07908092
16    0.07908092
17    0.07908092
18    0.07908092
19    0.07908092
20    0.07908092
21    0.07908092
22    0.07908092
23    0.07908092
24    0.07908092
25    0.07908092
26    0.07908092
27    0.07908092
28    0.07908092
29    0.07908092
30    0.07908092
31    0.07908092
32    0.07908092
33    0.07908092
34    0.07908092
35    0.07908092
         lon      lat        loc     scale     shape loc.std.err scale.std.err
1  6.6224114 8.575994  6.9305860 17.889523 0.2276012   0.7092485     1.7672877
2  4.8221624 1.293454 -7.5647582 14.512557 0.2276012   0.6716434     1.4343011
3  3.2670662 4.671890 -0.8402362 11.595456 0.2276012   0.6483043     1.1512921
4  9.7942342 8.380200  6.5408737 23.839333 0.2276012   0.7041749     2.3607941
5  4.8658111 5.075501 -0.0368790 14.594434 0.2276012   0.6503625     1.4423205
6  2.1756995 7.288199  4.3673285  9.548234 0.2276012   0.6794996     0.9574140
7  9.0365486 9.769500  9.3061704 22.418041 0.2276012   0.7440754     2.2185062
8  9.4952200 2.433143 -5.2962927 23.278432 0.2276012   0.6558149     2.3046120
9  1.0499908 1.360880 -7.4305513  7.436592 0.2276012   0.6704930     0.7651302
10 0.9251576 3.148782 -3.8718669  7.202426 0.2276012   0.6499427     0.7445495
   shape.std.err
1     0.07908092
2     0.07908092
3     0.07908092
4     0.07908092
5     0.07908092
6     0.07908092
7     0.07908092
8     0.07908092
9     0.07908092
10    0.07908092

SpatialExtremes documentation built on Sept. 1, 2020, 3:01 a.m.