get_mcmc: Markov chain Monte Carlo (Gibbs) method to sample from the...

Description Usage Arguments Value Examples

View source: R/algorithms.R

Description

Markov chain Monte Carlo (Gibbs) method to sample from the conditional distributions of gamma and tau

Usage

1
2
get_mcmc(s, dpc_grid, y, nburn = 10, nsample = 10000, priors = NULL,
  printEvery = 1000, seed = NULL)

Arguments

s

Observation locations

dpc_grid

Discrete Process Convolution grid

y

Observation values

nburn

Number of EM iterations (burn-in) use dto estimate kernel parameters (rho)

nsample

Number of MCMC iterations

priors

Priors for gamma and tau

printEvery

Console notifications every X iterations

seed

Seed for reproducible chains

Value

List with sampled values of gamma and tau, as well as optimal estimates for rho

Examples

1
2
3
4
5
6
7
s = data.frame(lat = rep(0, 3), lon = c(-1:1))
y = c(1,1,0)
dpc_grid = get_grid(c(-1,1), c(0,0), spacing = 2)
priors = get_priors(dpc_grid)
iso_kernel_matrix = get_kernel_matrix(s, dpc_grid)
fit = get_mcmc(s, dpc_grid, y, 10, 1000, priors, 100, 1)
cbind(get_estimates(s, dpc_grid, fit), obs = y)

rtlemos/scallops documentation built on May 4, 2019, 7:43 p.m.