Nonparametric estimation of marginal effects using an ocf
object.
marginal_effects(
object,
data = NULL,
which_covariates = c(),
eval = "atmean",
bandwitdh = 0.1,
inference = FALSE
)
An ocf
object.
Data set of class data.frame
to estimate marginal effects. It must contain at least the same covariates used to train the forests. If NULL
, marginal effects are estimated on object$full_data
.
Character vector storing the names of the covariates for which marginal effect estimation is desired. If empty (the default), marginal effects are estimated for all covariates.
Evaluation point for marginal effects. Either "mean"
, "atmean"
or "atmedian"
.
How many standard deviations x_up
and x_down
differ from x
.
Whether to extract weights and compute standard errors. The weights extraction considerably slows down the program.
Object of class ocf.marginal
.
marginal_effects
can estimate mean marginal effects, marginal effects at the mean, or marginal effects at the
median, according to the eval
argument.
The routine assumes that covariates with more than ten unique values are continuous. Otherwise, covariates are assumed to
be discrete.
Di Francesco, R. (2023). Ordered Correlation Forest. arXiv preprint arXiv:2309.08755.