make_agfh_sampler | R Documentation |
A maker function that returns a function. The returned function is a sampler for the agnostic Fay-Herriot model.
X |
observed independent data to be analyzed |
Y |
observed dependent data to be analyzed |
D |
known precisions of response |
var_gamma_a |
latent variance prior parameter, |
var_gamma_b |
latent variance prior parameter, |
S |
vector of starting support values for |
kern.a0 |
scalar variance parameter of GP kernel |
kern.a1 |
scalar lengthscale parameter of GP kernel |
kern.fuzz |
scalar noise variance of kernel |
Creates a Metropolis-within-Gibbs sampler of the agnostic Fay-Herriot model (AGFH).
Returns a sampler, itself a function of initial parameter values (a list with values for \beta, \theta
, the latent variance of \theta
, and starting values for g(.)
, typically zeros), number of samples, thinning rate, and scale of Metropolis-Hastings jumps for \theta
sampling.
Marten Thompson thom7058@umn.edu
n <- 10
X <- matrix(1:n, ncol=1)
Y <- 2*X + rnorm(n, sd=1.1)
D <- rep(1, n)
ag <- make_agfh_sampler(X, Y, D)
params.init <- list(
beta=1,
theta=rep(0,n),
theta.var=1,
gamma=rep(0,n)
)
ag.out <- ag(params.init, 5, 1, 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.