tcG.fit: Fitting meta-Gaussian model(s)

View source: R/fit_tcG.R

tcG.fitR Documentation

Fitting meta-Gaussian model(s)

Description

This function allows fitting 4 meta-Gaussian models. The data should only contain positive values and have a discrete component in zero.

Usage

tcG.fit(
  y,
  name,
  init,
  ym = 0,
  step = 0,
  plots = TRUE,
  bootstrap = TRUE,
  R = 500,
  filename = NULL,
  ncpus = parallel::detectCores(),
  ym.param = FALSE
)

Arguments

y

vector of data

name

name of the anamorphosis that will be fitted, a subset of c('gp', 'power', 'power-exp', 'quadratic-power')

init

initialisation parameters, a list named with the name argument

ym

minimal value that can be observed

step

discretization step

plots

boolean, should plots be drawn?

bootstrap

boolean, should boostrap replicates be fitted?

R

number of bootstrap replicates

filename

if you want to save the plots, a character for your file's name

ncpus

number of cores

ym.param

boolean, should ym be a parameter?

Details

A meta-Gaussian model is a variable Y defined as

Y = 0 * I_{X<0} + \psi(X) * I_{X\ge0}

with X~N(\mu,1) and where I is the indicator function, equals to 1 if the condition is true and 0 else.

The available fun are the following:

  • "gp" for GP meta-Gaussian as in \insertCiteboutigny2021modelling;textualtcG: \psi(x) = ym+ \sigma x^(1/\alpha) exp(\xi x^2/2)

  • "power" as in \insertCitebardossy1992space;textualtcG: \psi(x) = ym + \sigma x^(1/\alpha)

  • "power-exp" as in \insertCiteallard2015disaggregating;textualtcG: \psi(x) = ym + \sigma1 (exp(\sigma2 * x^(1/\alpha))-1)

  • "quadratic-power" as in \insertCiteallcroft2003latent;textualtcG: \psi(x) = ym + \sigma1 * x^(1/\alpha) + \sigma2 * x^(2/\alpha)

Value

A list of four elements containing the results of the fitted model(s). The first three elements are lists named by the fitted model(s) (argument name). par gives the fitted parameters. AIC gives the Akaike criterion. fit.boot gives the parameters fitted with the bootstrap replicates. Finally for.plots is a list that is used by the function res.plot.

References

\insertAllCited

Examples

## Not run: 
data(rain, package = "ismev")

# The histogram is not very revelant due to the fact \code{rain} are daily observations
res=tcG.fit(rain, name=c("power", "gp"),
            init=list("power"=c(0,2,2), "gp"=c(0,2,0.5,0.5)),
            ym=0.3, step=0.1, R=50)

## End(Not run)

mbtgy/tcG documentation built on Oct. 19, 2023, 3:10 p.m.