compute_weight_gp {GPCERF} | R Documentation |
Calculates the weights of observed outcomes which is then used to estimate the posterior mean of CERF at a given exposure level.
compute_weight_gp(
w,
w_obs,
scaled_obs,
hyperparam,
inv_sigma_obs,
gps_m,
est_sd = FALSE,
kernel_fn = function(x) exp(-x^2)
)
w |
A scalar of exposure level of interest. |
w_obs |
A vector of observed exposure levels of all samples. |
scaled_obs |
A matrix of two columns.
|
hyperparam |
A vector of hyper-parameters for the GP.
|
inv_sigma_obs |
Inverse of the covariance matrix between observed samples. |
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 |
est_sd |
Should the posterior se be computed (default=FALSE) |
kernel_fn |
The covariance function of GP. |
A list of two elements, weight and standard deviation.