Skip to content

Commit

Permalink
started coding heuristic for control objects
Browse files Browse the repository at this point in the history
  • Loading branch information
brandmaier committed Mar 14, 2024
1 parent 90d60bd commit 3774930
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ Description: SEM Trees and SEM Forests -- an extension of model-based decision
License: GPL-3
Encoding: UTF-8
LazyLoad: yes
Version: 0.9.19
Date: 2023-11-24
Version: 0.9.20
Date: 2024-03-14
RoxygenNote: 7.2.3
VignetteBuilder: knitr
BugReports: https://github.com/brandmaier/semtree/issues
Expand Down
12 changes: 12 additions & 0 deletions R/npar.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
npar <- function(x) {
if (is(x,"OpenMx") || is(x,"MxRAMModel")) {
stop("npar() not implemented yet")
} else if (is(x, "ctsemFit")) {
stop("npar() not implemented yet")
} else if (is(x,"lavaan")) {
pt <- parameterTable(x)
sum(pt$free!=0)
} else {
stop("npar() not implemented yet")
}
}
8 changes: 8 additions & 0 deletions R/semtree.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ semtree <- function(model, data=NULL, control=NULL, constraints=NULL,
if (checkControl(control)!=TRUE) {stop( "Unknown options in semtree.control object!");}
}

#


# set min.bucket and min.N heuristically
if (is.null(control$min.bucket)) {
control$min.bucket = control$min.N / 2
}

if (control$method=="cv") {
ui_stop("This method ceased to exist. Please see modern score-based tests.")
}
Expand Down

0 comments on commit 3774930

Please sign in to comment.