GEVparameters_from_models: Calculate GEV parameters according to given linear models

Description Usage Arguments Value See Also Examples

View source: R/GEVparameters_from_models.R

Description

this function calculates the GEV parameters according to the linear models
specified by coefficients

Usage

1

Arguments

covariables

a named matrix or vector with the covariables. each row corresponds to one location, columns are the corresponding covariables (names of the coefficients) from the linear models; the intercept is added seperately and thus doesn't have to be included

coefficients

a list with the named coefficients of the linear models including
loccoeff (coefficients of location parameter) – must be named
scalecoeff (coefficients of scale parameter) – must be named
shapecoeff (coefficients of shape parameter) – must be named

Value

GEVparam

a matrix or vector with the GEV parameters. each row corresponds to one location, columns are loc, scale and shape

See Also

GEVparameters_map, returnlevels, cond_returnlevels, returnlevel_plot,
cond_returnlevel_plot

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
32
33
34
35
36
37
38
39
40
41
42
43
# get covariables
lon = get(data(lon.at))
lon = as.vector(t(lon))
lat = get(data(lat.at))
lat = as.vector(t(lat))
alt = get(data(alt.at))
alt = as.vector(t(alt))

x = get(data(sample_grid_data))

mdday    = x$mdday
sd_mmax  = x$mmsd
swe_mmax = x$mmswe

# take only locations of the (Austrian) domain
lon = lon[which(!is.na(mdday))]
lat = lat[which(!is.na(mdday))]
alt = alt[which(!is.na(mdday))]
mdday    = mdday[which(!is.na(mdday))]
sd_mmax  = sd_mmax[which(!is.na(sd_mmax))]
swe_mmax = swe_mmax[which(!is.na(swe_mmax))]

# define matrix 'covariables'
covariables = cbind("lon" = lon, "lat" = lat, "alt" = alt,
                    "mdday" = mdday, "sd_mmax" = sd_mmax,
                    "swe_mmax" = swe_mmax)

# load function output from optimizer_biv_hr_model
data("optim_hr")

# define coefficients
sd_coeff  = optim_hr$coefficients$sd_coeff
swe_coeff = optim_hr$coefficients$swe_coeff
cor_coeff = optim_hr$coefficients$cor_coeff

# Calculate the GEV parameters from linear models
sd_GEVparam =
  GEVparameters_from_models(covariables = covariables,
                            coefficients = sd_coeff)

swe_GEVparam =
  GEVparameters_from_models(covariables = covariables,
                            coefficients = swe_coeff)

SpatialModelsZAMG documentation built on Nov. 11, 2019, 3 p.m.