parDA_GIBBS: Gibbs sampling with Metropolis-Hastings algorithm for the...

Description Usage Arguments Value Author(s) See Also

View source: R/parDA_GIBBS.R

Description

This function implements Gibbs sampling with Metropolis-Hasting algorithm to sample from posterior distributions for the proposed Bayesian statistical model. This function is used in parallel computing of MCMC algorithm

Usage

1
2
parDA_GIBBS(outW, theta, prior_theta, ADtheta, N, Lj, niter = 20000,
  start_adapting = 500)

Arguments

outW

a 7 by 1 list containing precomputed quantities associated with W from the output of function computeW(...)

theta

a list of 3 elements contained in parameters in the MCMC algorithm

prior_theta

a list of 2 elements, each of whcih is the quantity in the prior distribution of lambda

ADtheta

a list of 6 elements, each of which is the parameter in the corresponding proposal distribution

N

an integer representing the number of ensemble members

Lj

an m by 1 vector containing the number of runs for each forcing scenario

niter

an integer specifying the total number of MCMC iterations

start_adapting

an integer specifiying when to adapt proposal in the MCMC algorithm

Value

a list of 6 elements containing posterior quantities of parameters, log-likelihood, chisq statistics, and prior:

beta: a matrix holds the posterior samples for the parameter beta with each row corresponding to each beta

logsigma: a vector holds the posterior samples for the parameter log of sigma

lambda: a vector holds the posterior samples for the parameter lambda

loglik: a vector holds the log-likelihood evaluated with updated parameters

chisq: a vector holds chisquare statistics for residual consistency test

prior: a vector holds the prior density evaluated with updated parameters

Author(s)

Pulong Ma <mpulong@gmail.com>

See Also

DA_GIBBS


mapn/DAbayes documentation built on May 21, 2019, 11:26 a.m.