Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/orfPublic

orf: R package

NotificationsYou must be signed in to change notification settings

okasag/orf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

CRAN checks

orf: ordered random forests

Welcome to the repository of theR packageorf for random forest estimation ofthe ordered choice models.

Introduction

TheR packageorf is an implementation of the Ordered Forest estimatoras developed in Lechner & Okasa (2019). The Ordered Forest flexibly estimatesthe conditional probabilities of models with ordered categorical outcomes(so-called ordered choice models). Additionally to common machine learningalgorithms theorf package provides functions for estimating marginal effectsas well as statistical inference thereof and thus provides similar output as instandard econometric models for ordered choice. The core forest algorithm relieson the fastC++ forest implementation from theranger package (Wright & Ziegler, 2017).

Installation

In order to install the latestCRAN released version use:

install.packages("orf",dependencies= c("Imports","Suggests"))

to make sure all the needed packages are installed as well. Note that if you installthe package directly from the source aC++ compiler is required. For WindowsusersRtools collection is required too.

Examples

The examples below demonstrate the basic functionality of theorf package.

## Ordered Forestrequire(orf)# load example datadata(odata)# specify response and covariatesY<- as.numeric(odata[,1])X<- as.matrix(odata[,-1])# estimate Ordered Forest with default settingsorf_fit<- orf(X,Y,num.trees=1000,mtry=2,min.node.size=5,replace=FALSE,sample.fraction=0.5,honesty=TRUE,honesty.fraction=0.5,inference=FALSE,importance=FALSE)# print output of the Ordered Forest estimationprint(orf_fit)# show summary of the Ordered Forest estimationsummary(orf_fit,latex=FALSE)# plot the estimated probability distributionsplot(orf_fit)# predict with the estimated Ordered Forestpredict(orf_fit,newdata=NULL,type="probs",inference=FALSE)# estimate marginal effects of the Ordered Forestmargins(orf_fit,newdata=NULL,eval="mean",window=0.1,inference=FALSE)

For a more detailed examples see the package vignette.

References

About

orf: R package

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp