gev_fit: Fit a time serie with a GEV distribution .

Description Usage Arguments Details Value Examples

View source: R/model_fit.R

Description

gev_fit fits a time serie with a GEV distribution a where the location and scale parameters depend linearly on a set of covariates.

Usage

1
2
gev_fit(y, data, mu_mod = ~1, sig_mod = ~1, sig_link = "log", time_var,
  init = NULL)

Arguments

y

the time serie to be fitted.

data

a data.frame object with where the function looks first for the variables y, time_var and the covariates specified in the mu_mod and sig_mod arguments.

mu_mod

a formula defining the covariates the location parameter of the GEV depends linearly on.

sig_mod

a formula defining the covariates the scale parameter of the GEV depends linearly on.

sig_link

a link function name for the parameter sigma: sig_link(sigma) is a linear function of the covariates.

time_var

a variable used to define the time in the time serie. It can also be a string giving the variable name.

init

vector of initialization parameter for the minimization of the negative log-likelihood. if NULL, the initialisation is done using the function fevd from the extRemes packages.

Details

MLE fit of a time serie y using a GEV distribution where the location and the scale parameters depend linearly on a set of covariates. The optimization of the negative log-likelihood is done with the nlminb function in R.

Value

returns an object of class gev_fit. It contains the nlminb output which provides the estimated parameters as well the minimum of the negative log-likelihood. The arguments use to call gev_fit are included in the list as well.

Examples

1
2
3
4
5
6
7
data(tas)
#Example with the same covariate for the mean and variance parameter
ge_fit <- gev_fit(eur_tas, data=tas, mu_mod=~gbl_tas, sig_mod=~gbl_tas, time_var="year")
# get the values of the mean and variance parameters of the GEV at each time
compute_par(ge_fit, tas)
# plot diagnostic plot of the fit : standardized residuals plots, qqplot, density of fitted vs theorical density, times series ans return levels
plot(ge_fit)

thaos/FARg documentation built on May 25, 2019, 8:18 a.m.