ComputePostmeanHnew.exact {bkmr}R Documentation

Compute the posterior mean and variance of h at a new predictor values

Description

Function to estimate the posterior mean and variance by obtaining the posterior mean and variance at particular iterations and then using the iterated mean and variance formulas

Usage

ComputePostmeanHnew.exact(fit, y = NULL, Z = NULL, X = NULL,
  Znew = NULL, sel = NULL)

Arguments

fit

An object containing the results returned by a the kmbayes function

y

a vector of outcome data of length n.

Z

an n-by-M matrix of predictor variables to be included in the h function. Each row represents an observation and each column represents an predictor.

X

an n-by-K matrix of covariate data where each row represents an observation and each column represents a covariate. Should not contain an intercept column.

Znew

optional matrix of new predictor values at which to predict h, where each row represents a new observation. This will slow down the model fitting, and can be done as a post-processing step using SamplePred

sel

A vector selecting which iterations of the BKMR fit should be retained for inference. If not specified, will default to keeping every 10 iterations after dropping the first 50% of samples, or if this results in fewer than 100 iterations, than 100 iterations are kept


[Package bkmr version 0.2.0 Index]