R Under development (unstable) (2025-07-27 r88459 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > set.seed(789) > require("semtree") Loading required package: semtree Loading required package: OpenMx > data(lgcm) > > lgcm$agegroup <- ordered(lgcm$agegroup) > lgcm$training <- factor(lgcm$training) > lgcm$noise <- factor(lgcm$noise) > > # LOAD IN OPENMX MODEL. > # A SIMPLE LINEAR GROWTH MODEL WITH 5 TIME POINTS FROM SIMULATED DATA > > manifests <- names(lgcm)[1:5] > lgcModel <- mxModel("Linear Growth Curve Model Path Specification", + type="RAM", + manifestVars=manifests, + latentVars=c("intercept","slope"), + # residual variances + mxPath( + from=manifests, + arrows=2, + free=TRUE, + values = c(1, 1, 1, 1, 1), + labels=c("residual1","residual2","residual3","residual4","residual5") + ), + # latent variances and covariance + mxPath( + from=c("intercept","slope"), + connect="unique.pairs", + arrows=2, + free=TRUE, + values=c(1, 1, 1), + labels=c("vari", "cov", "vars") + ), + # intercept loadings + mxPath( + from="intercept", + to=manifests, + arrows=1, + free=FALSE, + values=c(1, 1, 1, 1, 1) + ), + # slope loadings + mxPath( + from="slope", + to=manifests, + arrows=1, + free=FALSE, + values=c(0, 1, 2, 3, 4) + ), + # manifest means + mxPath( + from="one", + to=manifests, + arrows=1, + free=FALSE, + values=c(0, 0, 0, 0, 0) + ), + # latent means + mxPath( + from="one", + to=c("intercept", "slope"), + arrows=1, + free=TRUE, + values=c(1, 1), + labels=c("meani", "means") + ), + mxData(lgcm,type="raw") + ) > > > fr <- semforest(lgcModel, + lgcm, + control = semforest.control(num.trees = 3, + control=semtree.control(method="score",alpha = 1))) Beginning initial fit attempt Fit attempt 0, fit=3946.79931515402, new current best! (was 12364.5789577388) Beginning initial fit attempt Fit attempt 0, fit=2498.7679863863, new current best! (was 2500.57558385466) Beginning initial fit attempt Fit attempt 0, fit=764.772503388833, new current best! (was 1163.66565665044) Beginning initial fit attempt Fit attempt 0, fit=338.868295829071, new current best! (was 343.708152933193) Beginning initial fit attempt Fit attempt 0, fit=175.851011833291, new current best! (was 178.737405944433) Beginning initial fit attempt Fit attempt 0, fit=156.155329338793, new current best! (was 160.130889884629) Beginning initial fit attempt Fit attempt 0, fit=416.837040482738, new current best! (was 421.064350455595) Beginning initial fit attempt Fit attempt 0, fit=242.1898784002, new current best! (was 247.25952597349) Beginning initial fit attempt Fit attempt 0, fit=158.989241132223, new current best! (was 169.577514509256) Beginning initial fit attempt Fit attempt 0, fit=934.35539674276, new current best! (was 1335.10232973591) Beginning initial fit attempt Fit attempt 0, fit=447.459454932503, new current best! (was 473.567977547209) Beginning initial fit attempt Fit attempt 0, fit=444.014715095661, new current best! (was 460.787419195532) ✔ Tree construction finished [took 4s]. Beginning initial fit attempt Fit attempt 0, fit=2516.45260910029, new current best! (was 2517.92197222075) Beginning initial fit attempt Fit attempt 0, fit=1341.27576506244, new current best! (was 1348.10677657358) Beginning initial fit attempt Fit attempt 0, fit=460.481414615103, new current best! (was 672.697538435548) Beginning initial fit attempt Fit attempt 0, fit=230.238570141743, new current best! (was 236.014596391223) Beginning initial fit attempt Fit attempt 0, fit=219.568998837664, new current best! (was 224.466818223879) Beginning initial fit attempt Fit attempt 0, fit=470.679340307611, new current best! (was 668.578226626863) Beginning initial fit attempt Fit attempt 0, fit=229.005781402467, new current best! (was 234.004567014226) Beginning initial fit attempt Fit attempt 0, fit=232.65952357682, new current best! (was 236.674773293389) Beginning initial fit attempt Fit attempt 0, fit=1161.42709458488, new current best! (was 1168.3458325268) Beginning initial fit attempt Fit attempt 0, fit=290.972043547966, new current best! (was 516.660191580869) Beginning initial fit attempt Fit attempt 0, fit=441.521206027037, new current best! (was 644.766903003999) ✔ Tree construction finished [took 5s]. Beginning initial fit attempt Fit attempt 0, fit=2484.71604419056, new current best! (was 2486.93397670568) Beginning initial fit attempt Fit attempt 0, fit=840.478377838503, new current best! (was 1270.02577091646) Beginning initial fit attempt Fit attempt 0, fit=377.657268989176, new current best! (was 388.075617793004) Beginning initial fit attempt Fit attempt 0, fit=200.603675683903, new current best! (was 204.348446856422) Beginning initial fit attempt Fit attempt 0, fit=167.672029415641, new current best! (was 173.308822132735) Beginning initial fit attempt Fit attempt 0, fit=445.014434327539, new current best! (was 452.402760045546) Beginning initial fit attempt Fit attempt 0, fit=252.130990698267, new current best! (was 254.876132272871) Beginning initial fit attempt Fit attempt 0, fit=185.566971857669, new current best! (was 190.138302054666) Beginning initial fit attempt Fit attempt 0, fit=827.235462979418, new current best! (was 1214.69027327423) Beginning initial fit attempt Fit attempt 0, fit=394.500283161319, new current best! (was 409.798901605049) Beginning initial fit attempt Fit attempt 0, fit=194.650830045802, new current best! (was 198.533346986751) Beginning initial fit attempt Fit attempt 0, fit=192.79963908564, new current best! (was 195.966936174568) Beginning initial fit attempt Fit attempt 0, fit=406.774836552453, new current best! (was 417.436561374344) ✔ Tree construction finished [took 5s]. ✔ Forest completed [took 15s] > > > vimp <- varimp(fr) > > print(vimp) Variable Importance agegroup training noise 7254.849785 28.752065 -2.302292 > print(vimp, na.omit=TRUE) Variable Importance agegroup training noise 7254.849785 28.752065 -2.302292 > > varimpConvergencePlot(vimp, aggregate="mean") > varimpConvergencePlot(vimp, aggregate="median") > > > proc.time() user system elapsed 25.26 0.98 26.20