View source: R/extrapol.return.level.R
extrapol.return.level | R Documentation |
Predictive distribution of a T-years return level at ungauged positions (targets), given the output from the MCMC procedures hkevp.fit
or latent.fit
.
extrapol.return.level(period, fit, targets, targets.covariates)
period |
An integer indicating the wished return period T. |
fit |
Output from the |
targets |
A matrix of real values giving the spatial coordinates of the ungauged positions. Each row corresponds to an ungauged position. |
targets.covariates |
A matrix of real values giving the spatial covariates of the ungauged positions. Must match with the covariates used in |
Spatial extrapolation of the return level at target positions (s^*_1, ..., s^*_k)
is a two-step procedure:
Estimation of the predictive distribution for GEV parameters at (s^*_1, ..., s^*_k)
, by using {extrapol.gev}
.
Computation of the associated return level for each state of the predictive distribution.
A matrix of predictive sample. Each column corresponds to a target position and each row to a predictive draw.
Quentin Sebille
extrapol.gev
# Simulation of HKEVP:
sites <- as.matrix(expand.grid(1:3,1:3))
knots <- sites
loc <- sites[,1]*10
scale <- 1
shape <- .2
alpha <- .4
tau <- 1
ysim <- hkevp.rand(10, sites, knots, loc, scale, shape, alpha, tau)
# HKEVP fit:
fit <- hkevp.fit(ysim, sites, niter = 1000)
## Extrapolation of the 100-years return level (may need more iterations and burn-in/nthin):
targets <- as.matrix(expand.grid(1.5:2.5,1.5:2.5))
pred.sample <- extrapol.return.level(100, fit, targets)
pred.mean <- apply(pred.sample, 2, mean)
pred.sd <- apply(pred.sample, 2, sd)
true <- return.level(100, targets[,1]*10, scale, shape)
# cbind(true, pred.mean, pred.sd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.