Skip to contents

Generalized Residuals for a TVGEV model.

Usage

# S3 method for pgpTList
residuals(object, type = c("exp", "unif"), ...)

Arguments

object

A TVGEV object.

type

The approximate distribution wanted. The choices c("unif", "exp") correspond to the standard uniform, the standard exponential and the standard Gumbel distributions. Partial matching is allowed.

...

Not used yet.

Value

A vector of generalized residuals which should

approximately be independent and approximately

follow the standard exponential or the uniform distribution, depending on the value of type.

References

Cox, D.R. and Snell E.J. (1968) "A General Definition of Residuals". JRSS Ser. B, 30(2), pp. 248-275.

Examples

if (require("NSGEV")) {
## build thresholds then fit
Rq <- rqTList(dailyMet = Rennes, tau = c(0.94, 0.95, 0.96, 0.97, 0.98, 0.99))
Pgp <- pgpTList(dailyMet = Rennes, thresholds = Rq, declust = TRUE,
                extraDesign  = list(splines = list("what" = "NSGEV::breaksX",
                                                   "args" = list(breaks = "1980-01-01"))),
                scale.fun = ~Cst + sinjPhi1 + sinjPhi2 + sinjPhi3 + t1_1980 - 1,
                fitLambda = TRUE, logLambda.fun = ~ t1_1980 - 1)

res <- resid(Pgp)
autoplot(res)
autoplot(res, seas = TRUE)
}
#> o Using meteorological variable : "TX"
#> o Adding new variables 
#> o Using K = 3 and the following phases
#> sinjPhi1 sinjPhi2 sinjPhi3 
#>   105.94     8.53    84.21 
#>    o evaluation of `NSGEV::breaksX`. Date is added in 1-st arg `date`
#> o Sampling rate : 365.26/year
#> o Looping on 6 thresholds
#> 
#> o Fit the temporal Poisson process:  non-homogeneous
#> 
#> Number of observations  not used in the estimation process:  0
#> Total number of time observations:  28366
#> Number of events:  772
#> 
#> Convergence code:  0
#> Convergence attained
#> Loglikelihood:  -3528.563
#> 
#> Estimated coefficients: 
#>     b0     b1 
#> -3.841  0.017 
#> Full coefficients: 
#>     b0     b1 
#> -3.841  0.017 
#> attr(,"TypeCoeff")
#> [1] "Fixed: No  fixed parameters"
#> 
#> 
#> o Fit the temporal Poisson process:  non-homogeneous
#> 
#> Number of observations  not used in the estimation process:  0
#> Total number of time observations:  28366
#> Number of events:  671
#> 
#> Convergence code:  0
#> Convergence attained
#> Loglikelihood:  -3157.518
#> 
#> Estimated coefficients: 
#>     b0     b1 
#> -4.000  0.019 
#> Full coefficients: 
#>     b0     b1 
#> -4.000  0.019 
#> attr(,"TypeCoeff")
#> [1] "Fixed: No  fixed parameters"
#> 
#> 
#> o Fit the temporal Poisson process:  non-homogeneous
#> 
#> Number of observations  not used in the estimation process:  0
#> Total number of time observations:  28366
#> Number of events:  565
#> 
#> Convergence code:  0
#> Convergence attained
#> Loglikelihood:  -2753.763
#> 
#> Estimated coefficients: 
#>     b0     b1 
#> -4.186  0.020 
#> Full coefficients: 
#>     b0     b1 
#> -4.186  0.020 
#> attr(,"TypeCoeff")
#> [1] "Fixed: No  fixed parameters"
#> 
#> 
#> o Fit the temporal Poisson process:  non-homogeneous
#> 
#> Number of observations  not used in the estimation process:  0
#> Total number of time observations:  28366
#> Number of events:  450
#> 
#> Convergence code:  0
#> Convergence attained
#> Loglikelihood:  -2292.492
#> 
#> Estimated coefficients: 
#>     b0     b1 
#> -4.438  0.021 
#> Full coefficients: 
#>     b0     b1 
#> -4.438  0.021 
#> attr(,"TypeCoeff")
#> [1] "Fixed: No  fixed parameters"
#> 
#> 
#> o Fit the temporal Poisson process:  non-homogeneous
#> 
#> Number of observations  not used in the estimation process:  0
#> Total number of time observations:  28366
#> Number of events:  323
#> 
#> Convergence code:  0
#> Convergence attained
#> Loglikelihood:  -1743.484
#> 
#> Estimated coefficients: 
#>     b0     b1 
#> -4.856  0.026 
#> Full coefficients: 
#>     b0     b1 
#> -4.856  0.026 
#> attr(,"TypeCoeff")
#> [1] "Fixed: No  fixed parameters"
#> 
#> 
#> o Fit the temporal Poisson process:  non-homogeneous
#> 
#> Number of observations  not used in the estimation process:  0
#> Total number of time observations:  28366
#> Number of events:  179
#> 
#> Convergence code:  0
#> Convergence attained
#> Loglikelihood:  -1068.854
#> 
#> Estimated coefficients: 
#>     b0     b1 
#> -5.492  0.029 
#> Full coefficients: 
#>     b0     b1 
#> -5.492  0.029 
#> attr(,"TypeCoeff")
#> [1] "Fixed: No  fixed parameters"
#>