Evaluate the MSE_hat objective function over the cells for the sample

eval_mse_hat(
  y_tr,
  X_tr,
  d_tr,
  y_te = NULL,
  X_te = NULL,
  d_te = NULL,
  N_est,
  partition = NULL,
  cell_factor_tr = NULL,
  cell_factor_te = NULL,
  est_plan = NULL,
  estimator = NULL,
  debug = FALSE,
  warn_on_error = FALSE,
  sample = "trtr",
  ...
)

Arguments

y_tr

y_tr

X_tr

X_tr

d_tr

d_tr

y_te

y_te

X_te

X_te

d_te

d_te

N_est

Size of estimation sample. Unused for this objective function.

partition

Grid partition. Pass in this or cell_factor.

cell_factor_tr

Factor for cells for each observation. Pass in this or partition.

est_plan

Estimation plan. If this and estimator are null, then one is created as gen_simple_est_plan(has_d=!is.null(d))

estimator

If not passing in est_plan, can pass in this estimation routine and one is created using simple_est.

debug

T/F whether we are in debug mode (and print out more info)

warn_on_error

T/F for whether to display a warning when estimation fails (NA values returned)

sample

Passed to est_params

Value

c(val, N_cell_empty, N_cell_error)