full.select.gen: Perform MPS

Description Usage Arguments Examples

View source: R/myPackage.R

Description

Function that performs Model Path Selection (MPS)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
full.select.gen(
  myframe,
  resp.name,
  depth,
  r,
  f,
  type,
  model,
  fun.args,
  pred.args,
  condense = FALSE
)

Arguments

myframe

data.frame holding explanatory and response data

resp.name

matrix of MPS data

depth

maximum depth of paths

r

maximum cell count

f

loss function

type

'reg' or 'class' for regression and classification. Not needed if f is specified.

model

name of modeling method; must be name of the function called in R

fun.args

list of arguments that are passed to modeling function

pred.args

list of arguments that are passed to model predict function

condense

logical for whether or not paths should be merged

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
set.seed(200)
library(MASS)
n<-1000
p<-10
x<-mvrnorm(n,rep(0,p),diag(p))
signal<-rowSums(x[,1:3])
noise<-rnorm(n,0,1/4)
y<-signal+noise
mydata<-data.frame(x,y)
mps1<-full.select.gen(myframe=mydata,resp.name='y',depth=3,
   B=100,model='lm',condense=FALSE)
mps1
build.tree(mps1) #graph

#merged paths
mps2<-full.select.gen(myframe=mydata,resp.name='y',depth=3,
   r=100,model='lm',condense=TRUE)
mps2
build.tree(mps2) #graph

nkissel/ModelPath documentation built on Feb. 13, 2021, 12:53 a.m.