Movatterモバイル変換


[0]ホーム

URL:


ess:Efficient Stepwise Selection in Decomposable Models

R build status

About ess

Theess package is anRimplementation of the algorithm presented inthis paper and latercorrected slightlyinthis paper. The ESS algorithm is used for model selection indiscrete decomposable graphical models. It is fast compared to othermodel selection procedures inR, especially when datais high-dimensional.

Decomposable GraphicalModels

The class of graphical models is a family of probabilitydistributions for which conditional dependencies can be read off from agraph. If the graph is decomposable, the maximum likelihood estimates ofthe parameters in the model can be shown to be on exact form. This iswhat enables ESS to be fast and efficient.

Installation

You can install the current stable release of the package by usingthedevtools package:

devtools::install_github("mlindsk/ess",build_vignettes =FALSE)

Getting Started

The main function iness isfit_graphwhich fits a decomposable graph. An object returned fromfit_graph is agengraph object.fit_graph has four types; forward selection(fwd), backward selection (bwd), tree(tree) and a combination of tree and forward(tfwd). Usingadj_lst on an object returned byfit_graph gives the adjacency list corresponding to thegraph. Similarly one can useadj_mat to obtain an adjacencymatrix.

A neat usecase ofess is that of variable selection.Consider the built-in dataderma (dermatitis) with classvariableES. We can fit a graph structure to this data, andinspect the graph to see which variablesES directlydepends upon:

library(ess)g<-fit_graph(derma)plot(g,vertex.size =1)

Instead of inspecting the graph (it can be difficult if there aremany variables) we can simply extract the neighbors ofES

adj<-adj_lst(g)adj$ES#>  [1] "h21" "h20" "h28" "h33" "h16" "h29" "c9"  "h15" "h14" "c5"  "c3"  "h19"#> [13] "h26" "c4"  "age" "c7"  "c2"  "h31" "c1"  "h18" "h17" "h32" "c11" "h13"#> [25] "h23" "c10" "h22" "h24" "h30" "h27"

For more information, see the documentation. E.g. type?fit_graph in anR session.

See Also

Themolic package isused for outlier detection in categorical data and is designed to workwithgengraph objects. One can useess tofit agengraph object, extract the adjacency matrix, conertit to anigraph object and use it in connection with beliefpropagation via thejtipackage.


[8]ページ先頭

©2009-2025 Movatter.jp