Description Usage Arguments Value Author(s) Examples
Compute the ggplots for each parameter of interest in a single page.
1 2 3 4 5 6 |
data |
numeric vector containing the GEV block-maxima |
vline.red |
draws a dashed red line in red representing the starting of the iterations , thus removing the burn-in period. |
post.mean.green |
draws a green dashed line representing the posterior mean of the parameter's chain |
... |
Other parameters from |
title |
Global title for the plot |
a grid.arrange() of ggplots.
Antoine Pissoort, antoine.pissoort@student.uclouvain.be
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 | data("max_years")
fn <- function(par, data) -log_post0(par[1], par[2], par[3], data)
param <- c(mean(max_years$df$Max),log(sd(max_years$df$Max)), 0.1 )
# opt <- optim(param, fn, data = max_years$data,
# method="BFGS", hessian = TRUE)
opt <- nlm(fn, param, data = max_years$data,
hessian=T, iterlim = 1e5)
start <- opt$estimate
Sig <- solve(opt$hessian)
ev <- eigen( (2.4/sqrt(2))^2 * Sig)
varmat <- ev$vectors %*% diag(sqrt(ev$values)) %*% t(ev$vectors)
# (MH)
set.seed(100)
mh.mcmc1 <- MH_mcmc.own(start, varmat %*% c(.1,.3,.4))
mh.mcmc1$mean.acc_rates
chains.plotOwn(mh.mcmc1$out.chain)
# (GIBBS)
# k chains with k different starting values
set.seed(100)
gibbs.trend <- gibbs.trend.own(start, propsd = c(.5, 1.9, .15, .12),
iter = 1000)
## TracePlots
chain.mix <- cbind.data.frame(gibbs.trend$out.chain,
iter.chain = rep(1:500, 4))
mixchains.Own(chain.mix)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.