# mcmc.fun: Point estimates of HKEVP fit In hkevp: Spatial Extreme Value Analysis with the Hierarchical Model of Reich and Shaby (2012)

## Description

Application of a function to the main Markov chains resulting from the procedure `hkevp.fit`. May be used to obtain point estimates on posterior distribution (e.g. the mean, the median). See details.

## Usage

 `1` ```mcmc.fun(fit, FUN, ...) ```

## Arguments

 `fit` A named list. Output from the `hkevp.fit` procedure. `FUN` The function applied to the Markov chains in `fit`. The median by default. The output from FUN must be a single value. `...` Optional arguments of the function to be applied on the Markov chains (e.g. `na.rm = FALSE`).

## Details

A function is applied to the main Markov chains resulting from the MCMC procedures `hkevp.fit` or `latent.fit`. These chains correspond to the three GEV parameters, the dependence parameter α and the bandwidth τ.

The value returned by `FUN` must be a single value.

## Value

If fitted model is the HKEVP, a named list with three elements:

• `GEV`: A numerical matrix. Result of the function `FUN` for each GEV parameter (columns) and each site position (rows).

• `alpha`: A numerical value. Result of the function `FUN` on the Markov chain associated to the dependence parameter α.

• `tau`: A numerical value. Result of the function `FUN` on the Markov chain associated to the bandwidth parameter τ.

If fitted model is the latent variable model, the functions returns the `GEV` matrix only.

Quentin Sebille

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```# Simulation of HKEVP: sites <- as.matrix(expand.grid(1:3,1:3)) knots <- sites loc <- sites[,1]*10 scale <- 3 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) # Posterior median and standard deviation: # mcmc.fun(fit, median) # mcmc.fun(fit, sd) ```

hkevp documentation built on May 30, 2017, 5:21 a.m.