gfigpd1: Fiducial inference for the generalized Pareto model with...

Description Usage Arguments Value References Examples

View source: R/main1.R

Description

Runs the MCMC sampler of the fiducial distribution for the generalized Pareto model with known threshold.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
gfigpd1(
  X,
  beta,
  threshold,
  gamma.init = NA,
  sigma.init = NA,
  sd.gamma = NA,
  sd.sigma = NA,
  Jnumb = 50L,
  iter = 10000L,
  burnin = 2000L,
  thin = 6L,
  nchains = 4L,
  nthreads = parallel::detectCores(),
  seeds = NULL
)

Arguments

X

numeric vector of data

beta

vector of probabilities corresponding to the quantiles to be estimated

threshold

value of the known threshold, must be smaller than the maximum of X

gamma.init

starting value for gamma in the MCMC

sigma.init

starting value for sigma in the MCMC

sd.gamma

standard deviation for the proposed gamma in the MCMC

sd.sigma

standard deviation for the proposed sigma in the MCMC

Jnumb

number of subsamples that are taken from the Jacobian

iter

number of iterations per chain (burnin excluded)

burnin

number of the first MCMC iterations discarded

thin

thinning number for the MCMC chain. (e.g. if it is 1 no iteration is skipped)

nchains

number of MCMC chains to run

nthreads

number of threads to run the chains in parallel

seeds

the seeds used for the MCMC sampler; one seed per chain, or NULL to use random seeds

Value

An object of class mcmc if nchains=1, otherwise an object of class mcmc.list.

References

Damian V. Wandler & Jan Hannig. Generalized fiducial confidence intervals for extremes. Extremes (2012) 15:67–87. <doi:10.1007/s10687-011-0127-9>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(666L)
X <- rgpareto(200L, mu = 10, gamma = 0.5, sigma = 1)
gf <- gfigpd1(
  X, beta = c(0.98, 0.99), threshold = 10, 
  iter = 2000L, nchains = 2L, nthreads = 2L
) # note: 2*2000 iterations is not enough, I'm using these settings because 
  # of CRAN constraints (elapsed time must be < 5s)
summary(gf)
qgpareto(c(0.98, 0.99), mu = 10, gamma = 0.5, sigma = 1)
rejectionRate(gf)
HPDinterval(gf)
HPDinterval(joinMCMCchains(gf))

gfiExtremes documentation built on Nov. 26, 2020, 5:07 p.m.