estimate_mean_sd_nn {GPCERF}R Documentation

Estimate the CERF with the nnGP model

Description

Estimates the posterior mean of the conditional exposure response function at specified exposure levels with nnGP.

Usage

estimate_mean_sd_nn(
  hyperparam,
  sigma2,
  w_obs,
  w,
  y_obs,
  gps_m,
  kernel_fn = function(x) exp(-x^2),
  n_neighbor = 50,
  block_size = 2000,
  nthread = 1
)

Arguments

hyperparam

A set of hyperparameters for the nnGP.

sigma2

A scaler representing sigma^2.

w_obs

A vector of observed exposure levels.

w

A vector of exposure levels at which the CERF is estimated.

y_obs

A vector of observed outcome values.

gps_m

An S3 gps object including: gps: A data.frame of GPS vectors. - Column 1: GPS - Column 2: Prediction of exposure for covariate of each data sample (e_gps_pred). - Column 3: Standard deviation of e_gps (e_gps_std) used_params: - dnorm_log: TRUE or FLASE

kernel_fn

The covariance function of the GP.

n_neighbor

The number of nearest neighbors on one side.

block_size

The number of samples included in a computation block. Mainly used to balance the speed and memory requirement. Larger block_size is faster, but requires more memory.

nthread

An integer value that represents the number of threads to be used by internal packages.

Value

A vector of returned value from compute_posterior_sd_nn.


[Package GPCERF version 0.2.4 Index]