Learn R Programming

Modified Ordered Random Forest

R package to implement modified ordered random forests (MORF), a nonparametric estimator of the ordered choice model. Additionally, the package implements a nonparametric estimator of the marginal effects.

MORF modifies a standard random forest splitting criterion to build a collection of forests, each estimating the conditional probabilities of a single class. The estimator inherits the asymptotic properties of random forests. Thus, under an honesty condition (i.e., that different observations are used to place the splits and compute leaf predictions) the predicted conditional probabilities are asymptotically normal and consistent. The particular honesty implementation used by MORF allows for a weight-based estimation of the variance of both predicted probabilities and marginal effects.

To get started, please check the online vignette for a short tutorial.

Installation

The current development version of the package can be installed using the devtools package:

devtools::install_github("riccardo-df/morf")
library(morf)

References

  • Athey, S., Tibshirani, J., & Wager, S. (2019).

Generalized Random Forests. Annals of Statistics, 47(2). [paper]

  • Lechner, M., & Mareckova, J. (2022).

Modified Causal Forest. arXiv preprint arXiv:2209.03744. [paper]

  • Lechner, M., & Okasa, G. (2019).

Random Forest Estimation of the Ordered Choice Model. arXiv preprint arXiv:1907.02436. [paper]

  • Wager, S., & Athey, S. (2018).

Estimation and Inference of Heterogeneous Treatment Effects using Random Forests. Journal of the American Statistical Association, 113(523). [paper]

  • Wright, M. N. & Ziegler, A. (2017).

ranger: A fast implementation of random forests for high dimensional data in C++ and R. Journal of Statistical Software, 77(1). [paper]

Copy Link

Version

Install

install.packages('morf')

Monthly Downloads

1

Version

1.0.0

License

GPL-3

Maintainer

Riccardo Di Francesco

Last Published

March 22nd, 2023

Functions in morf (1.0.0)

print.morf.marginal

Print Method for morf.marginal Objects
print.morf

Print Method for morf Objects
predict.morf.forest

Prediction Method for morf.forest Objects
predict_forest_weights

Forest Out-of-Sample Weights
honest_predictions

Honest Out-of-Sample Predictions
check_ntrees

Check Argument n.trees
honest_predictions_cpp

Honest Out-of-Sample Predictions
marginal_effects

Marginal Effects for Modified Ordered Random Forests
mean_squared_error

Accuracy Measures for Ordered Probability Predictions
rename_latex

Renaming Variables for LATEX Usage
summary.morf

Summary Method for morf Objects
summary.morf.marginal

Summary Method for morf.marginal Objects
forest_weights_predicted_cpp

Forest Out-of-Sample Honest Weights
tree_info

Tree Information in Readable Format
forest_weights_fitted_cpp

Forest In-Sample Honest Weights
check_alpha

Check Argument alpha
check_mtry

Check Argument mtry
check_samplefraction

Check Argument sample.fraction
check_honesty_inference

Check Arguments honesty, honesty.fraction and inference
check_maxdepth

Check Argument max.depth
check_minnodesize

Check Argument min.node.size
class_honest_split

Honest Sample Split
forest_weights_fitted

Forest In-Sample Honest Weights
honest_fitted

Honest In-Sample Predictions
honest_fitted_cpp

Honest In-Sample Predictions
check_x_y

Check Arguments x and y
morf

Modified Ordered Random Forest
predict.morf

Prediction Method for morf Objects