agfh_theta_new_pred {agfh}R Documentation

Agnostic Fay-Herriot Hierarchical Bayesian Model Predictions at Latent Level

Description

Find predictions of \theta using posterior samples from the AGFH model

Usage

  agfh_theta_new_pred(X_new, beta_samples, theta_var_samples)

Arguments

X_new

single new independent data to be analyzed

beta_samples

posterior samples of latent regression parameter

theta_var_samples

posterior samples of latent variance parameter

Details

X_new should be 1 x p shaped.

beta_samples and theta_var_samples should contain the same number of samples (columns for the former, length of the latter).

Value

Vector containing n samples-many estimates of \theta at X_new.

Source

Marten Thompson thom7058@umn.edu

Examples

  p <- 3
  n.post.samp <- 10
  X.new <- matrix(rep(1,p), nrow=1)
  beta.samp <- matrix(rnorm(n.post.samp*p, mean=2, sd=0.1), ncol=n.post.samp)
  thvar.samp <- runif(n.post.samp, 0.1, 1)

  th.preds <- agfh_theta_new_pred(X.new, beta.samp, thvar.samp)

[Package agfh version 0.2.1 Index]