gevcdn.bootstrap: Bootstrapped confidence intervals for GEV CDN parameters and...

Description Usage Arguments Details Value References See Also Examples

View source: R/gevcdn.bootstrap.R

Description

Used to assist in the calculation of bootstrapped confidence intervals for GEV location, scale, and shape parameters, as well as for specified quantiles. Residual and parametric bootstrap estimates are supported.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gevcdn.bootstrap(n.bootstrap, x, y, iter.max = 1000, n.hidden = 2,
                 Th = gevcdn.logistic, fixed = NULL,
                 init.range = c(-0.25, 0.25),
                 scale.min = .Machine$double.eps,
                 beta.p = 3.3, beta.q = 2, sd.norm = Inf,
                 n.trials = 5, method = c("BFGS", "Nelder-Mead"),
                 boot.method = c("residual", "parametric"),
                 init.from.prev = TRUE, max.fails = 100,
                 probs = c(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9,
                 0.95, 0.99), ...)

Arguments

n.bootstrap

number of bootstrap trials used to calculate confidence intervals.

x

covariate matrix with number of rows equal to the number of samples and number of columns equal to the number of variables.

y

column matrix of target values with number of rows equal to the number of samples.

iter.max

maximum number of iterations of optimization algorithm.

n.hidden

number of hidden nodes in each GEV CDN ensemble member.

Th

hidden layer transfer function; defaults to gevcdn.logistic.

fixed

vector indicating GEV parameters to be held constant; elements chosen from c("location", "scale", "shape")

init.range

range for random weights on [min(init.range), max(init.range)]

scale.min

minimum allowable value for the GEV scale parameter.

beta.p

shape1 parameter for shifted beta distribution prior for GEV shape parameter

beta.q

shape2 parameter for shifted beta distribution prior for GEV shape parameter

sd.norm

sd parameter for normal distribution prior for the magnitude of input-hidden layer weights; equivalent to weight penalty regularization.

n.trials

number of repeated trials used to avoid shallow local minima during optimization

method

optimization method for optim function; must be chosen from c("BFGS", "Nelder-Mead").

boot.method

bootstrap method; must be chosen from c("residual", "parametric").

init.from.prev

logical value indicating whether or not optimization runs should be initialized from the final weights of the previous run.

max.fails

maximum number of repeated exceptions allowed during optimization

probs

vector of cumulative probabilities for which quantile confidence intervals are desired.

...

additional arguments passed to the control list of optim function

Details

Note: the boot package provides a more comprehensive suit of methods for estimating bootstrap-based confidence intervals.

Value

a list consisting of

weights.bootstrap

a list of length n.bootstrap consisting of weights following the format returned by gevcdn.fit

parms.bootstrap

a list of length n.bootstrap consisting of GEV parameters following the format returned by gevcdn.evaluate

location.bootstrap

a matrix of GEV location parameters with number of rows equal to that of x and number of columns equal to n.bootstrap

scale.bootstrap

a matrix of GEV scale parameters with number of rows equal to that of x and number of columns equal to n.bootstrap

shape.bootstrap

a matrix of GEV shape parameters with number of rows equal to that of x and number of columns equal to n.bootstrap

quantiles.bootstrap

a list of length n.bootstrap with each consisting of a matrix with number of rows equal to that of x and columns corresponding to probs

References

Cannon, A.J., 2010. A flexible nonlinear modelling framework for nonstationary generalized extreme value analysis in hydroclimatology. Hydrological Processes, 24: 673-685. DOI: 10.1002/hyp.7506

See Also

gevcdn.cost, gevcdn.evaluate, gevcdn.fit, gevcdn.bag, dgev, optim

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
## Generate synthetic data

x <- as.matrix(seq(0.1, 1, length = 50))

loc <- x^2
scl <- x/2
shp <- seq(-0.1, 0.3, length = length(x))

set.seed(100)
y <- as.matrix(rgev(length(x), location = loc, scale = scl,
               shape = shp))

## Not run: 
## Fit 30 bootstrapped models

CI <- gevcdn.bootstrap(n.bootstrap = 30, x = x, y = y,
                       iter.max = 100, n.hidden = 2,
                       Th = gevcdn.logistic, n.trials = 1,
                       boot.method = "residual",
                       probs = c(0.1, 0.5, 0.9))

## Plot data and percentile confidence intervals for GEV parameters

par(mfrow = c(2, 2))
matplot(x, y, type = "b", pch = 19, col = "red", xlab = "x",
        ylab = "y", main = "gevcdn.bootstrap")
matplot(x, cbind(loc, t(apply(CI$location.bootstrap, 1, quantile,
        p = c(0.025, 0.975)))), type = c("l", "b", "b"), pch = 20,
        lwd = 3, col = c("black", rep("green", 2)), xlab = "x",
        ylab = "location", main = "location CI")
matplot(x, cbind(scl, t(apply(CI$scale.bootstrap, 1, quantile,
        p = c(0.025, 0.975)))), type = c("l", "b", "b"), pch = 20,
        lwd = 3, col = c("black", rep("orange", 2)), xlab = "x",
        ylab = "scale", main = "scale CI")
matplot(x, cbind(shp, t(apply(CI$shape.bootstrap, 1, quantile,
        p = c(0.025, 0.975)))), type = c("l", "b", "b"), pch = 20,
        lwd = 3, col = c("black", rep("brown", 2)), xlab = "x",
        ylab = "shape", main = "shape CI")

## End(Not run)

GEVcdn documentation built on Dec. 5, 2017, 9:03 a.m.