diff --git a/.Rbuildignore b/.Rbuildignore index eb5f282..6459bde 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,6 +6,7 @@ ^CRAN-SUBMISSION$ ^cran-comments\.md$ ^_pkgdown\.yml$ +^data-raw$ ^docs$ ^pkgdown$ ^\.positai$ diff --git a/.Rhistory b/.Rhistory index 6d518e7..6767d1c 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,268 +1,512 @@ -? with -?svd -devtools::document() -devtools::document() -devtools::document() -devtools::document() -library(SimFit) -data1 <- kinsim_single(name = "KinPair1", -Rel=1, -r_c = 1, -n=100, -mu=0, -ace=c(1,1,1)) -library(SimFit) -kinsim_single(name = "KinPair1", -+ Rel=1, -+ r_c = 1, -+ n=100, -+ mu=0, -+ ace=c(1,1,1)) -load_all() -library(devtools) -load_all() -use_mit_license() -check() -check() -check() -install() -library(SimFit) -test <- kinsim_single() -View(test) -test2 <- kinsim_double() -View(test2) -library(SimFit) -test <- kinsim_double( -GroupNames = c("tiger","lion"), -GroupSizes = c(100,300), -GroupRel = c(.8,.6), -GroupR_c = c(.99,.95), -ifComb = TRUE) -tiger <- test[which(test$GroupName=="tiger"), c("y1","y2")] -lion <- test[which(test$GroupName=="lion"), c("y1","y2")] -testResult <- fit_siACE(tiger, lion, GroupRel = c(.8,.6),GroupR_c = c(.99,.95)) -testResult <- fit_uniACE(tiger, lion, GroupRel = c(.8,.6),GroupR_c = c(.99,.95)) -View(testResult) -testResult[["summary"]] -library(SimFit) -test <- Sim_Fit(GroupSizes = c(55,55), SSeed = 1999, nIter = 20) -View(test) -test[["Iteration1"]][["Results"]][["nest"]] -test[["Iteration4"]][["Results"]][["nest"]] -?Sim_Fit -test <- Sim_Fit(GroupSizes = c(55,55), SSeed = 1999, nIter = 20, saveRaw = TRUE) -View(test) -test[["Iteration1"]][["data"]] -test <- Sim_Fit(GroupSizes = c(55,55),GroupRel = c(.8,.5), SSeed = 1999, nIter = 5, saveRaw = TRUE, ifComb = TRUE) -test <- Sim_Fit(GroupSizes = c(56,56),GroupRel = c(.8,.5), SSeed = 1999, nIter = 5, saveRaw = TRUE, ifComb = TRUE) -test <- Sim_Fit(GroupSizes = c(56,56),GroupRel = c(.8,.5), SSeed = 1999, nIter = 5, saveRaw = TRUE, ifComb = FALSE) -test2 <- kinsim_double(GroupRel = c(.6,.5), ifComb = TRUE) -test2 <- kinsim_double(GroupRel = c(.6,.55), ifComb = TRUE) -test <- Sim_Fit(GroupSizes = c(56,56),GroupRel = c(.8,.55), SSeed = 1999, nIter = 5, saveRaw = TRUE, ifComb = FALSE) -test2 <- kinsim_double(GroupRel = c(.6,.501), ifComb = TRUE) -test2 <- kinsim_double(GroupRel = c(.6,.505), ifComb = TRUE) -library(devtools) -check() -install() -test2 <- kinsim_double(GroupRel = c(.6,.5), ifComb = TRUE) -library(SimFit) -test2 <- kinsim_double(GroupRel = c(.6,.5), ifComb = TRUE) -View(test2) -View(test2) -test2 <- kinsim_double(GroupRel = c(.6,.501), ifComb = TRUE) -?tryCatch -demo(error.catching) -library(devtools) -load_all -load_all() -expect_equal(ncol(kinsim_single( -name = "testtesttest", -Rel = .8, -r_c = .98, -n = 1000, -mu = 2, -ace = c(2,2,6) -)), 12) -test_that("single simulation works", { -expect_equal(ncol(kinsim_single( -name = "testtesttest", -Rel = .8, -r_c = .98, -n = 1000, -mu = 2, -ace = c(2,2,6) -)), 12) -}) -check() -use_test("kinsim_double") -test_that("two group exist", { -expect_equal(length(unique(kinsim_double(GroupRel = c(.98,644), -ace2 = c(5,7,9), -ifComb = TRUE))), 2) -}) -test_that("two group exist", { -expect_equal(length(unique(kinsim_double(GroupRel = c(.98,.644), -ace2 = c(5,7,9), -ifComb = TRUE))), 2) -}) -test_that("two group exist", { -expect_equal(length(unique(kinsim_double(GroupRel = c(.98,.644), -ace2 = c(5,7,9), -ifComb = TRUE)$GroupName)), 2) -}) -test_that("ncol correct", { -expect_equal(ncol(kinsim_double(GroupSizes = c(59,131), -GroupRel = c(.98,.644), -ace2 = c(5,7,9), -ifComb = TRUE)), 190) -}) -test_that("nrow correct", { -expect_equal(nrow(kinsim_double(GroupSizes = c(59,131), -GroupRel = c(.98,.644), -ace2 = c(5,7,9), -ifComb = TRUE)), 190) -}) -test_that("ncol correct", { -expect_equal(ncol(kinsim_double(GroupSizes = c(159,231), -GroupRel = c(.98,.5), -ace2 = c(5,7,9), -ifComb = FALSE)), 12) -}) -use_test("Sim_Fit) -"" -" -use_test("Sim_Fit") -test_that("Results Level Check", { -expect_equal(length(Sim_Fit()), 2) -}) -test_that("Results Level Check", { -expect_equal(length(Sim_Fit(nIter = 5,saveRaw=FALSE)), 2) -}) -test_that("Results Level Check", { -expect_equal(length(Sim_Fit(nIter = 5,saveRaw=TRUE)), 2) -}) -test_that("Results Level Check", { -expect_equal(levels(Sim_Fit(nIter = 5,saveRaw=TRUE)), 2) -}) -Sim_Fit(nIter = 5,saveRaw=TRUE) -testststs <- Sim_Fit(nIter = 5,saveRaw=TRUE) -View(testststs) -test_that("Results Category Check", { -expect_equal(length(Sim_Fit(nIter = 5,saveRaw=TRUE)[[1]]), 5) -}) -test_that("Results Level Check", { -expect_equal(length(Sim_Fit(nIter = 5,saveRaw=TRUE)), 5) -}) -test_that("Results Category Check", { -expect_equal(length(Sim_Fit(nIter = 5,saveRaw=TRUE)[[1]]), 2) -}) -use_test("Power_LS") -test_that("Power and sample size can match", { -expect_equal(round(Power_LS(N1 = 57, N2 = 114, h2 = .5, c2 = .2, R1 = 1, R2 = .50),1),.8) -}) -test_that("Power and sample size can match", { -expect_equal(round(Power_LS(p_N1 = .333333, power = .8,h2 = .5, c2 = .2, R1 = 1, R2 = .50)[1]),57) -}) -check() -check() -check() -check() -usethis::use_github_action_check_standard() -usethis::use_github_action("check-release") -usethis::use_github_action("check-standard") -library(devtools) -usethis::use_vignette("") -usethis::use_vignette("SimFit") -library(SimFit) -?kinsim_double -?Sim_Fit -results_fit <- Sim_Fit( +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 2 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +} +if ((GroupRel[1] == 1 | GroupRel[1] == .5) & (GroupRel[2] == 1 | GroupRel[2] == .5)) { +df_N1 <- kinsim_single( +name = GroupNames[1], +Rel = GroupRel[1], +r_c = GroupR_c[1], +n = GroupSizes[1], +mu = mu[1], +ace = ace1 +) +df_N2 <- kinsim_single( +name = GroupNames[2], +Rel = GroupRel[2], +r_c = GroupR_c[2], +n = GroupSizes[2], +mu = mu[2], +ace = ace2 +) +df_final <- rbind(df_N1, df_N2) +df_final <- df_final %>% mutate(y1 = case_when( +R == GroupRel[1] ~ ifelse(runif(n()) < missing[1], NA, y1), +R == GroupRel[2] ~ ifelse(runif(n()) < missing[2], NA, y1))) %>% +mutate(y2 = case_when( +is.na(y1) ~ NA, +TRUE ~ y2 +)) %>% +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 2 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +} +if (GroupRel[1] != 1 & GroupRel[1] != .5 & GroupRel[2] != 1 & GroupRel[2] != .5) { +print(paste("running the new condition")) +df1MZ <- kinsim_single( +name = GroupNames[1], +Rel = 1, +r_c = GroupR_c[1], +n = round((GroupRel[1] - .5) * 2 * GroupSizes[1]), +mu = mu[1], +ace = ace1 +) +df1DZ <- kinsim_single( +name = GroupNames[1], +Rel = .5, +r_c = GroupR_c[1], +n = GroupSizes[1] - round((GroupRel[1] - .5) * 2 * GroupSizes[1]), +mu = mu[1], +ace = ace1 +) +df_N1 <- rbind(df1MZ, df1DZ) +df_N1 <- df_N1[sample(1:nrow(df_N1)), ] +df_N1$id <- 1:nrow(df_N1) +df_N1$R <- GroupRel[1] +df2MZ <- kinsim_single( +name = GroupNames[2], +Rel = 1, +r_c = GroupR_c[2], +n = round((GroupRel[2] - .5) * 2 * GroupSizes[2]), +mu = mu[2], +ace = ace2 +) +df2DZ <- kinsim_single( +name = GroupNames[2], +Rel = .5, +r_c = GroupR_c[2], +n = GroupSizes[2] - round((GroupRel[2] - .5) * 2 * GroupSizes[2]), +mu = mu[2], +ace = ace2 +) +df_N2 <- rbind(df2MZ, df2DZ) +df_N2 <- df_N2[sample(1:nrow(df_N2)), ] +df_N2$id <- 1:nrow(df_N2) +df_N2$R <- GroupRel[2] +df_final <- rbind(df_N1, df_N2) +df_final <- df_final %>% mutate(y1 = case_when( +R == GroupRel[1] ~ ifelse(runif(n()) < missing[1], NA, y1), +R == GroupRel[2] ~ ifelse(runif(n()) < missing[2], NA, y1))) %>% +mutate(y2 = case_when( +is.na(y1) ~ NA, +TRUE ~ y2 +)) %>% +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 1 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +} +} +return(df_final) +} +#' kinsim_double2 +#' @description The function to generate two groups of univariate kin pair(e.g., both MZ and DZ twins) data using a multivariate norm approach, given the ACE components. +#' \cr +#' \cr +#' Two approaches can be selected: a) simulate two groups of kin pairs using the genetic relatedness directly b) simulate two groups of kin pairs by combining MZ twins and DZ twins to achieve the required genetic relatedness (.5% mutate(y1 = case_when( +R == GroupRel[1] ~ ifelse(runif(n()) < missing[1], NA, y1), +R == GroupRel[2] ~ ifelse(runif(n()) < missing[2], NA, y1))) %>% +mutate(y2 = case_when( +is.na(y1) ~ NA, +TRUE ~ y2 +)) %>% +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 2 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +return(df_final) +} else { +if ((GroupRel[1] == 1 | GroupRel[1] == .5) & GroupRel[2] != 1 & GroupRel[2] != .5) { +df_N1 <- kinsim_single( +name = GroupNames[1], +Rel = GroupRel[1], +r_c = GroupR_c[1], +n = GroupSizes[1], +mu = mu[1], +ace = ace1 +) +df2MZ <- kinsim_single( +name = GroupNames[2], +Rel = 1, +r_c = GroupR_c[2], +n = GroupSizes[2], #round((GroupRel[2] - .5) * 2 * GroupSizes[2]), +mu = mu[2], +ace = ace2 +) +df2DZ <- kinsim_single( +name = GroupNames[2], +Rel = .5, +r_c = GroupR_c[2], +n = GroupSizes[2], #GroupSizes[2] - round((GroupRel[2] - .5) * 2 * GroupSizes[2]), +mu = mu[2], +ace = ace2 +) +df_N2 <- rbind(df2MZ, df2DZ) +df_N2 <- df_N2[sample(1:nrow(df_N2)), ] +df_N2$id <- 1:nrow(df_N2) +df_N2$R <- GroupRel[2] +df_final <- rbind(df_N1, df_N2) +df_final <- df_final %>% mutate(y1 = case_when( +R == GroupRel[1] ~ ifelse(runif(n()) < missing[1], NA, y1), +R == GroupRel[2] ~ ifelse(runif(n()) < missing[2], NA, y1))) %>% +mutate(y2 = case_when( +is.na(y1) ~ NA, +TRUE ~ y2 +)) %>% +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 2 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +} +if (GroupRel[1] != 1 & GroupRel[1] != .5 & (GroupRel[2] == 1 | GroupRel[2] == .5)) { +df1MZ <- kinsim_single( +name = GroupNames[1], +Rel = 1, +r_c = GroupR_c[1], +n = round((GroupRel[1] - .5) * 2 * GroupSizes[1]), +mu = mu[1], +ace = ace1 +) +df1DZ <- kinsim_single( +name = GroupNames[1], +Rel = .5, +r_c = GroupR_c[1], +n = GroupSizes[1] - round((GroupRel[1] - .5) * 2 * GroupSizes[1]), +mu = mu[1], +ace = ace1 +) +df_N1 <- rbind(df1MZ, df1DZ) +df_N1 <- df_N1[sample(1:nrow(df_N1)), ] +df_N1$id <- 1:nrow(df_N1) +df_N1$R <- GroupRel[1] +df_N2 <- kinsim_single( +name = GroupNames[2], +Rel = GroupRel[2], +r_c = GroupR_c[2], +n = GroupSizes[2], +mu = mu[2], +ace = ace2 +) +df_final <- rbind(df_N1, df_N2) +df_final <- df_final %>% mutate(y1 = case_when( +R == GroupRel[1] ~ ifelse(runif(n()) < missing[1], NA, y1), +R == GroupRel[2] ~ ifelse(runif(n()) < missing[2], NA, y1))) %>% +mutate(y2 = case_when( +is.na(y1) ~ NA, +TRUE ~ y2 +)) %>% +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 2 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +} +if ((GroupRel[1] == 1 | GroupRel[1] == .5) & (GroupRel[2] == 1 | GroupRel[2] == .5)) { +df_N1 <- kinsim_single( +name = GroupNames[1], +Rel = GroupRel[1], +r_c = GroupR_c[1], +n = GroupSizes[1], +mu = mu[1], +ace = ace1 +) +df_N2 <- kinsim_single( +name = GroupNames[2], +Rel = GroupRel[2], +r_c = GroupR_c[2], +n = GroupSizes[2], +mu = mu[2], +ace = ace2 +) +df_final <- rbind(df_N1, df_N2) +df_final <- df_final %>% mutate(y1 = case_when( +R == GroupRel[1] ~ ifelse(runif(n()) < missing[1], NA, y1), +R == GroupRel[2] ~ ifelse(runif(n()) < missing[2], NA, y1))) %>% +mutate(y2 = case_when( +is.na(y1) ~ NA, +TRUE ~ y2 +)) %>% +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 2 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +} +if (GroupRel[1] != 1 & GroupRel[1] != .5 & GroupRel[2] != 1 & GroupRel[2] != .5) { +print(paste("running the new condition")) +df1MZ <- kinsim_single( +name = GroupNames[1], +Rel = 1, +r_c = GroupR_c[1], +n = round((GroupRel[1] - .5) * 2 * GroupSizes[1]), +mu = mu[1], +ace = ace1 +) +df1DZ <- kinsim_single( +name = GroupNames[1], +Rel = .5, +r_c = GroupR_c[1], +n = GroupSizes[1] - round((GroupRel[1] - .5) * 2 * GroupSizes[1]), +mu = mu[1], +ace = ace1 +) +df_N1 <- rbind(df1MZ, df1DZ) +df_N1 <- df_N1[sample(1:nrow(df_N1)), ] +df_N1$id <- 1:nrow(df_N1) +df_N1$R <- GroupRel[1] +df2MZ <- kinsim_single( +name = GroupNames[2], +Rel = 1, +r_c = GroupR_c[2], +n = round((GroupRel[2] - .5) * 2 * GroupSizes[2]), +mu = mu[2], +ace = ace2 +) +df2DZ <- kinsim_single( +name = GroupNames[2], +Rel = .5, +r_c = GroupR_c[2], +n = GroupSizes[2] - round((GroupRel[2] - .5) * 2 * GroupSizes[2]), +mu = mu[2], +ace = ace2 +) +df_N2 <- rbind(df2MZ, df2DZ) +df_N2 <- df_N2[sample(1:nrow(df_N2)), ] +df_N2$id <- 1:nrow(df_N2) +df_N2$R <- GroupRel[2] +df_final <- rbind(df_N1, df_N2) +df_final <- df_final %>% mutate(y1 = case_when( +R == GroupRel[1] ~ ifelse(runif(n()) < missing[1], NA, y1), +R == GroupRel[2] ~ ifelse(runif(n()) < missing[2], NA, y1))) %>% +mutate(y2 = case_when( +is.na(y1) ~ NA, +TRUE ~ y2 +)) %>% +mutate(Ord_1 = case_when( +y1 <= -2 ~ 1, +y1 <= -1 ~ 2, +y1 <= 0 ~ 3, +y1 < 1 ~ 3, +y1 >= 1 ~ 4, +is.na(y1) ~ 4, +), +Ord_2 = case_when( +y2 <= -2 ~ 1, +y2 <= -1 ~ 2, +y2 <= 0 ~ 3, +y1 < 1 ~ 3, +y2 >= 2 ~ 4, +is.na(y2) ~ 4, +)) +} +} +return(df_final) +} +kindata <- kinsim_double2( GroupNames = c("SStwins", "OStwins"), GroupSizes = c(120, 60), -nIter = 50, -SSeed = 62, -GroupRel = c(.75, 0.5), +GroupRel = c(.5, 0.25), GroupR_c = c(1, 1), mu = c(0, 0), ace1 = c(.6, .2, .2), ace2 = c(.6, .2, .2), +ifComb = TRUE +) +View(kindata) +#these are here for now - won't need to source these once I fork ACEsimFit and work off my version +source("Sim_Fit2.R") +source("kinsim_double2.R") +source("fit_OrdACE.R") +source("fit_uniACE.R") +results_fit <- Sim_Fit2( +GroupNames = c("FS", "HS"), +GroupSizes = c(2500, 2500), +nIter = 1, +SSeed = 62, +GroupRel = c(.5, .25), #still need to figure out why this is breaking for sibs and half sibs +GroupR_c = c(1, 1), +nth = 4, +mu = c(0,0), +ace1 = c(.5, .2, .3), #other to do: fork ACEsimFit and work off my own version of the package +ace2 = c(.5, .2, .3), +missing = c(.50,.30), ifComb = TRUE, lbound = FALSE, -saveRaw = FALSE +saveRaw = TRUE, +Ord = TRUE) +kindata <- kinsim_double2( +GroupNames = c("SStwins", "OStwins"), +GroupSizes = c(120, 60), +GroupRel = c(.5, 0.25), +GroupR_c = c(1, 1), +mu = c(0, 0), +ace1 = c(.6, .2, .2), +ace2 = c(.6, .2, .2), +ifComb = TRUE ) -View(results_fit) -results_fit[["Iteration1"]][["Results"]][["nest"]] -?Power_LS -Power_LS(N1=120, N2=60, power, p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -Power_LS(N1=120, N2=60, power, p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -Power_LS(N1=120, N2=60, power, p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -Power_LS(N1=120, N2=60, power, p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -Power_LS(N1=100, N2=60, power, p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -Power_LS(N1, N2, power=.8, p_N1 = .6, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -check() -install() -library(SimFit) -library(SimFit) -Power_LS(N1=120, N2=60, power, p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -Power_LS(N1=120, N2=60, p_N1 = NULL, h2=.6, c2=.2, R1 = .75, R2 = 0.5, alpha = 0.05) -install() -library(devtools) -install() -library(devtools) -check() -release() -spell_check() -release() -check_rhub -check_rhub() -check_rhub() -install() -check_rhub() -library(devtools) -install() -release() -install.packages("pkgdown") -use_readme_rmd() -install() -release() -use_cran_comments() -release() -library(devtools) -check() -install() -check() -install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com") -install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com") -library(devtools) -check() -install() -install() -check() -release() -library(devtools) -install() -install() -install() -install() -install() -check_rhub() -install() -check() -release() -library(devtools) -install() -check() -release() +View(kindata) +rm(list = ls()) +knitr::opts_chunk$set( +echo = TRUE, +message = FALSE, +warning = FALSE +) +# set seed +set.seed(20200804) +library(psych) +library(polycor) +library(tidyverse) library(devtools) -check() -install() -check -check() -install() -check() -release() -check() -check() -release() -release() +library(remotes) +library(NlsyLinks) +library(parameters) +library(dplyr) +library(gtsummary) +library(discord) +library(janitor) +library(lm.beta) +library(matrixStats) +library(gt) +library(OpenMx) +library(ACEsimFit) +library(BGmisc) +library(ggpedigree) +library(knitr) +library(dplyr) +library(survival) +library(ggplot2) +library(tibble) +library(lubridate) +library(ggsurvfit) +library(tidycmprsk) +library(condSURV) +library(viridis) +library(mets) +library(umx) +# Helper functions +source("data/miFunctions.R") diff --git a/DESCRIPTION b/DESCRIPTION index df0c9cd..d8dba5a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,14 +4,19 @@ Version: 0.0.1.0 Date: 2025 Authors@R: c(person("Xuanyu", "Lyu", email = "lyux20@wfu.edu", role = c("aut", "cre")), - person("S.Mason", "Garrison", email = "garrissm@wfu.edu", role = "aut")) + person("Cailey", "Fay", role = "aut"), + person("S. Mason", "Garrison", email = "garrissm@wfu.edu", role = "aut")) Description: A few functions aim to provide a statistic tool for three purposes. First, simulate kin pairs data based on the assumption that every trait is affected by genetic effects (A), common environmental effects (C) and unique environmental effects (E). Second, use kin pairs data to fit an ACE model and get model fit output. Third, calculate power of A estimate given a specific condition. For the mechanisms of power calculation, we suggest to read Visscher (2004) , as well as Lyu and Garrison (2023) License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) Imports: OpenMx (>= 2.19.6), - stats (>= 3.5.0) + stats (>= 3.5.0), + dplyr, + purrr, + tidyr, + polycor Suggests: knitr, testthat (>= 3.0.0), diff --git a/NAMESPACE b/NAMESPACE index fd35fdf..7a974f3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,8 +2,12 @@ export(Power_LS) export(Sim_Fit) +export(Sim_Fit2) +export(fit_OrdACE) export(fit_uniACE) +export(harvest) export(kinsim_double) +export(kinsim_double2) export(kinsim_single) import(stats) importFrom(OpenMx,mxAlgebra) @@ -17,3 +21,9 @@ importFrom(OpenMx,mxMatrix) importFrom(OpenMx,mxModel) importFrom(OpenMx,mxRun) importFrom(OpenMx,omxSetParameters) +importFrom(dplyr,filter) +importFrom(dplyr,relocate) +importFrom(dplyr,select) +importFrom(polycor,hetcor) +importFrom(purrr,imap_dfr) +importFrom(tidyr,pivot_wider) diff --git a/R/Harvest.R b/R/Harvest.R new file mode 100644 index 0000000..797457b --- /dev/null +++ b/R/Harvest.R @@ -0,0 +1,51 @@ +#' Harvest results from MCMCglmm analyses +#' @description A function to extract the A, C, E estimates from the model +#' fitting results of the MCMCglmm analyses. This function is designed to work with the output of \code{Sim_Fit2}, which includes both interval and ordinal model fitting results. +#' @param results_fit A list of model fitting results generated from \code{Sim_Fit2}. This list should have two sub-lists: one for "Interval" model results and one for "Ordinal" model results. Each sub-list should contain the fitting results for each iteration (e.g., "Iteration1", "Iteration2", etc.). +#' @param type A character string specifying the type of model results to extract. Should be +#' either "Interval" for the interval model results or "Ordinal" for the ordinal model results. +#' @return Returns a \code{data.frame} with the following columns: +#' \item{Iteration}{The iteration name (e.g., "Iteration1", " +#' Iteration2", etc.)} +#' \item{Analysis}{The type of analysis ("Interval" or "Ordinal")} +#' \item{VA11}{The estimated additive genetic variance component (A) for the +#' first group of kin pairs} +#' \item{VC11}{The estimated common environmental variance component (C) for the +#' first group of kin pairs} +#' \item{VE11}{The estimated unique environmental variance component (E) for the +#' first group of kin pairs} +#' @export +#' @importFrom dplyr filter select relocate +#' @importFrom tidyr pivot_wider +#' @importFrom purrr imap_dfr + +harvest <- function(results_fit, type) { + + # 1. Grab the correct sub-list based on type ("Interval" or "Ordinal") + target_list <- results_fit[[type]] + + # 2. Loop through every iteration using imap (which tracks the iteration name) + master_df <- purrr::imap_dfr(target_list, function(iteration_data, iter_name) { + + # pull the parameters + param_table <- as.data.frame(iteration_data[["Results"]][["summary"]][["parameters"]]) + + # reshape the data + param_table |> + dplyr::filter(name %in% c("VA11", "VC11", "VE11")) |> + dplyr::select(name, Estimate) |> + tidyr::pivot_wider( + names_from = name, + values_from = Estimate + ) |> + dplyr::mutate( + Analysis = type, + Iteration = iter_name # Captures "Iteration1", "Iteration2", etc. + ) + }) + + master_df <- master_df |> + dplyr::relocate(Iteration, Analysis) + + return(master_df) +} diff --git a/R/Internal.R b/R/Internal.R index dead494..2bd6047 100644 --- a/R/Internal.R +++ b/R/Internal.R @@ -3,7 +3,7 @@ #' @param n Sample Size #' @param sigma Covariance matrix #' @return Generates multivariate normal data from a covariance matrix (\code{sigma}) of length \code{n} -#' +#' @importFrom stats rnorm rmvn <- function(n, sigma) { Sh <- with( svd(sigma), @@ -13,3 +13,59 @@ rmvn <- function(n, sigma) { ncol = ncol(sigma) ) %*% Sh } + +#' add missing +#' @description Internal function to add missingness to the simulated data frame. +#' +#' @details +#' Apply random missingness by GroupName (not by R value, which breaks when groups share the same relatedness), +#' @param df A data frame containing the simulated data with columns 'GroupName', 'y1', and 'y2'. +#' @param GroupNames A character vector of length 2 specifying the group names corresponding to the two groups in the data frame. +#' @param prop_missing A numeric vector of length 2 specifying the proportion of missing values +#' for each group. The first element corresponds to the first group in GroupNames, and the second element corresponds to the second group. +#' @return A modified data frame with missing values added to 'y1' and 'y2' according to the specified proportions, and new ordinal columns 'Ord_1' and 'Ord_2' added based on the cutpoints applied to 'y1' and 'y2 respectively. +#' @importFrom stats runif +.add_missing <- function(df, GroupNames, prop_missing) { + in_g1 <- df$GroupName == GroupNames[1] + in_g2 <- df$GroupName == GroupNames[2] + + miss_mask <- logical(nrow(df)) + miss_mask[in_g1] <- stats::runif(sum(in_g1)) < prop_missing[1] + miss_mask[in_g2] <- stats::runif(sum(in_g2)) < prop_missing[2] + + df$y1[miss_mask] <- NA_real_ + df$y2[miss_mask] <- NA_real_ + + + df +} + +#' add_missing_and_ordinal +#' +#' @details Applies random missingness to the 'y1' and 'y2' columns of the input data frame based on the specified proportions for each group, and +#' then compute 4-category ordinal columns. +#' Cutpoints: (-Inf, -2] = 1, (-2, -1] = 2, (-1, 1) = 3, [1, Inf) = 4. +#' NA y values produce NA ordinal scores; missingness is cascaded from y1 to y2. +#' @inheritParams .add_missing +#' @return A modified data frame with missing values added to 'y1' and 'y2' according to the specified proportions, and new ordinal columns 'Ord_1' and 'Ord_2' added based on the cutpoints applied to 'y1' and 'y2 respectively. +#' +.add_missing_and_ordinal <- function(df, GroupNames, prop_missing) { + + df_missing <- .add_missing(df, GroupNames, prop_missing) + + .to_ord <- function(y) { + out <- rep(NA_integer_, length(y)) + out[!is.na(y) & y <= -2] <- 1L + out[!is.na(y) & y > -2 & y <= -1] <- 2L + out[!is.na(y) & y > -1 & y < 1] <- 3L + out[!is.na(y) & y >= 1] <- 4L + out + } + + df_missing$Ord_1 <- .to_ord(df_missing$y1) + df_missing$Ord_2 <- .to_ord(df_missing$y2) + df_missing +} + + + diff --git a/R/Sim_Fit2.R b/R/Sim_Fit2.R new file mode 100644 index 0000000..c78387c --- /dev/null +++ b/R/Sim_Fit2.R @@ -0,0 +1,117 @@ +#' Sim_Fit2 +#' @description A function to simulate a set of kin pair data and fit them with ACE models. Can be helpful with checking model performance for a given parameter setting. +#' @param GroupNames A character vector specifying two names of the simulated kin pairs +#' @param GroupSizes A numeric vector specifying two group sizes indicating the amount of kin pairs in respective group. +#' @param nIter A numeric value specifying the number of iteration you want to run given the parameters assigned (i.e. the number of model fitting results you want to get) +#' @param SSeed An integer specifying the starting seed of the random number. This parameter will make sure the simulated results are replicable across time +#' @param GroupRel A numeric vector specifying two genetic relatedness values of the simulated kin pairs +#' @param GroupR_c A numeric vector specifying two common environment correlation coefficients of the simulated kin pairs +#' @param mu A numeric vector specifying two mean values for the generated variable of the kin pairs +#' @param ace1 A numeric vector specifying three variance components under an ACE (additive genetics, common environment, unique environment) structure for group1 +#' @param ace2 A numeric vector specifying three variance components under an ACE (additive genetics, common environment, unique environment) structure for group2 +#' @param prop_missing A numeric vector specifying the percentage random missing data for kin pairs +#' @param ifComb A logical value specifying the approach to achieve the required genetic relatedness value. \code{TRUE} = using combination approach. \code{FALSE} = using direct approach. (See function description for a detailed explanation of two approaches.) +#' @param lbound A logical value indicating if a lower boundary of .0001 will be imposed to the estimated A, C and E components +#' @param saveRaw A logical value specifying if the raw simulated data should be saved in the output list +#' @param Ord a logical value specifying if the data will also be analyzed with a threshold model +#' @param nth a numerical value specifying the number of thresholds, if applicable, for the threshold model +#' #eventually add an argument called: plot a logical value specifying if you want the density distributions of the estimates (faceted by analysis type) +#' @return Returns a two-level \code{list}. Level-one is the number of iterations. Level-two is the model fitting results and raw data (if \code{saveRaw = TRUE}) of the simulated data from the respective iteration. Level-two includes: +#' \item{Results}{A \code{list} including 1) A \code{data.frame} displaying the nested comparison model between ACE, AE, CE, E models and 2) A \code{list} of all model fit information generated from OpenMx} +#' \item{Data}{A \code{data.frame} consists of the simulated raw data} +#' #I need to figure out how to add in the ord results as part of the return +#' @export + +#' +#' + +Sim_Fit2 <- function(GroupNames = c("KinPair1", "KinPair2"), + GroupSizes = c(100, 100), + nIter = 100, + SSeed = 22, + GroupRel = c(1, .5), + GroupR_c = c(1, 1), + mu = c(0, 0), + ace1 = c(1, 1, 1), + ace2 = c(1, 1, 1), + prop_missing = c(.20,.20), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE, + nth = 4 #, + # plot = TRUE + ) { + + l.results <- list() + l.resultsOrd <- list() + + for (i in 1:nIter) { + set.seed(SSeed - 1 + i) + df_temp <- kinsim_double2( + GroupNames = GroupNames, + GroupSizes = GroupSizes, + GroupRel = GroupRel, + GroupR_c = GroupR_c, + mu = mu, + prop_missing = prop_missing, + ace1 = ace1, + ace2 = ace2, + ifComb = ifComb + ) + if (!saveRaw) { + l.results[[i]] <- list( + Results = fit_uniACE( + data_1 = df_temp[which(df_temp$GroupName == GroupNames[1]), c("y1", "y2")], + data_2 = df_temp[which(df_temp$GroupName == GroupNames[2]), c("y1", "y2")], + GroupRel = GroupRel, GroupR_c = GroupR_c, lbound = lbound #, + # nth = 1 + ), + data = NA + ) + } else { + l.results[[i]] <- list( + Results = ACEsimFit::fit_uniACE( + data_1 = df_temp[which(df_temp$GroupName == GroupNames[1]), c("y1", "y2")], + data_2 = df_temp[which(df_temp$GroupName == GroupNames[2]), c("y1", "y2")], + GroupRel = GroupRel, GroupR_c = GroupR_c, lbound = lbound + ), + + + data = df_temp, + assign("df_temp", df_temp, envir = .GlobalEnv), + assign("table", table, envir = .GlobalEnv) + ) + + } + + if(Ord) { + + l.resultsOrd[[i]] <- list( + Results = fit_OrdACE( + data_1 = df_temp[which(df_temp$GroupName == GroupNames[1]), c("Ord_1", "Ord_2")], + data_2 = df_temp[which(df_temp$GroupName == GroupNames[2]), c("Ord_1", "Ord_2")], + GroupRel = GroupRel, + GroupR_c = GroupR_c, + nth = nth, + lbound = TRUE + ), + + data = df_temp + ) + + error = function(e) { + message(paste("Iteration", i, "failed due to factor level mismatch. Skipping Ordinal.")) } + + } + + names(l.results)[[i]] <- paste("Iteration", i, sep = "") + names(l.resultsOrd)[[i]] <- paste("Iteration", i, sep = "") + + + results <- list(Interval = l.results, Ordinal = l.resultsOrd) + + } + return(results) + +} diff --git a/R/Simulation.html b/R/Simulation.html new file mode 100644 index 0000000..a83504a --- /dev/null +++ b/R/Simulation.html @@ -0,0 +1,3739 @@ + + + + + + + + + + + + + + + +Simulation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
results_fit <- Sim_Fit2(
+  GroupNames = c("FS", "HS"),
+  GroupSizes = c(2500, 2500),
+  nIter = 20,
+  SSeed = 62,
+  GroupRel = c(.5, .25), #this works but it changes the sample size adjustment so there are 7500 obs when I asked for 5000
+  GroupR_c = c(1, 1),
+  nth = 4,
+  mu = c(0,0), 
+  ace1 = c(.5, .2, .3), #other to do: fork ACEsimFit and work off my own version of the package 
+  ace2 = c(.5, .2, .3),
+  missing = c(.50,.30),
+  ifComb = TRUE,
+  lbound = FALSE,
+  saveRaw = TRUE,
+  Ord = TRUE)
+
## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20444.9295529197
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20444.9295529157
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20444.9295529127
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  20462.7881207459 vs 20444.9295529127
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20444.93 (started at 142185.7)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.25591873172601,0.508550502715253,1.41900248329713,0.00293939651604995,0.947651331648003,0.0494092718359466
+
## Mx:oneACEvo  os=13825  ns=7500   ep=7   co=1  df=13818  ll=20444.9296  cpu=0.1489  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2559   0.5086   1.4190   0.0029   0.9477   0.0494 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0029     NA
+## oneACEvo.US[1,2]     NA   0.9477     NA
+## oneACEvo.US[1,3]     NA   0.0494     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=13825  ns=7500   ep=6   co=1  df=13819  ll=22756.233  cpu=0.1477  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9379   0.7430   1.5732   1.8968  -0.8968 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   1.8968     NA
+## oneAEvo.US[1,2]     NA   0.0000      0
+## oneAEvo.US[1,3]     NA  -0.8968     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13825  ns=7500   ep=6   co=1  df=13819  ll=20444.9533  cpu=0.1059  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2561   0.5084   1.4189   0.9486   0.0514 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9486     NA
+## oneCEvo.US[1,3]     NA   0.0514     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20834.8001202586
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20834.8001202575
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20834.8001202569
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20834.8001202567
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20834.8001202567
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20834.8001202557
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20834.8 (started at 139738.19)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.27257477166334,0.532692794830288,1.41549223780036,0.0457947648465033,0.928701178207566,0.0255040569459309
+
## Mx:oneACEvo  os=13752  ns=7500   ep=7   co=1  df=13745  ll=20834.8001  cpu=0.1507  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2726   0.5327   1.4155   0.0458   0.9287   0.0255 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0458     NA
+## oneACEvo.US[1,2]     NA   0.9287     NA
+## oneACEvo.US[1,3]     NA   0.0255     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=13752  ns=7500   ep=6   co=1  df=13746  ll=22759.0016  cpu=0.132  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.2696   0.6318   1.4535   3.6123  -2.6123 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.6123     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.6123     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13752  ns=7500   ep=6   co=1  df=13746  ll=20839.88  cpu=0.121  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2744   0.5307   1.4140   0.9440   0.0560 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA    0.000     NA
+## oneCEvo.US[1,2]     NA    0.944     NA
+## oneCEvo.US[1,3]     NA    0.056     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20322.5337012781
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20322.533701276
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20322.534 (started at 140186.08)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.25088920270044,0.510741662366651,1.45954822524567,0.00449218515935094,0.944421585760959,0.0510862290796901
+
## Mx:oneACEvo  os=13736  ns=7500   ep=7   co=1  df=13729  ll=20322.5337  cpu=0.1523  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2509   0.5107   1.4595   0.0045   0.9444   0.0511 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0045     NA
+## oneACEvo.US[1,2]     NA   0.9444     NA
+## oneACEvo.US[1,3]     NA   0.0511     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : constraint-adjusted standard errors
+## could not be calculated because the coefficient matrix of the quadratic form was uninvertible
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : 6686 rows obtained probability of
+## exactly zero; You may wish to try again with better starting values.
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 10. Starting values are not feasible. Consider
+## mxTryHard()
+
## Mx:oneAEvo  os=13736  ns=7500   ep=6   co=1  df=13730  ll=36502212935.8204  cpu=6.0289  opt=SLSQP  ver=2.22.11  stc=10
+##  t1thOrd_  t2thOrd_  t3thOrd_  t4thOrd_      VA11      VE11 
+##   -1.9175    1.1301 7058.1201    2.1211    2.0244   -1.0244 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   2.0244     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -1.0244     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13736  ns=7500   ep=6   co=1  df=13730  ll=20322.5841  cpu=0.1063  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2511   0.5106   1.4594   0.9459   0.0541 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9459     NA
+## oneCEvo.US[1,3]     NA   0.0541     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20441.5656437985
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20441.5656437955
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20441.566 (started at 141288.44)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.2531550585455,0.508954463258813,1.43938715349077,0.0212673203389418,0.939566197926251,0.0391664817348072
+
## Mx:oneACEvo  os=13790  ns=7500   ep=7   co=1  df=13783  ll=20441.5656  cpu=0.1588  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2532   0.5090   1.4394   0.0213   0.9396   0.0392 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0213     NA
+## oneACEvo.US[1,2]     NA   0.9396     NA
+## oneACEvo.US[1,3]     NA   0.0392     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=13790  ns=7500   ep=6   co=1  df=13784  ll=22400.8756  cpu=1.1389  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.4886   0.3819   1.4648   3.8065  -2.8065 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.8065     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.8065     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13790  ns=7500   ep=6   co=1  df=13784  ll=20442.7224  cpu=0.1187  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2537   0.5086   1.4384   0.9467   0.0533 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9467 0.9523
+## oneCEvo.US[1,3] 0.0477   0.0533     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20279.5337995653
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20279.5337995648
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20279.534 (started at 142935.69)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.23846699839547,0.513588614164544,1.40748846991846,0.0149673547026209,0.944241105910154,0.0407915393872247
+
## Mx:oneACEvo  os=13802  ns=7500   ep=7   co=1  df=13795  ll=20279.5338  cpu=0.1485  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2385   0.5136   1.4075   0.0150   0.9442   0.0408 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0150     NA
+## oneACEvo.US[1,2]     NA   0.9442     NA
+## oneACEvo.US[1,3]     NA   0.0408     NA
+
## Running oneAEvo with 6 parameters
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=13802  ns=7500   ep=6   co=1  df=13796  ll=32152.1487  cpu=0.2516  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.7285   0.3794   0.8995  -0.8304   1.8304 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA  -0.8304     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA   1.8304     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13802  ns=7500   ep=6   co=1  df=13796  ll=20280.1462  cpu=0.1157  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2387   0.5134   1.4069   0.9493   0.0507 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9493     NA
+## oneCEvo.US[1,3]     NA   0.0507     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20247.8501342079
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20247.850134207
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20247.8501342066
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20247.8501342064
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20247.85 (started at 139724.38)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -2.99999999999997,1.25488095006987,0.526186829022014,1.43099270281887,-0.00252692040544806,0.950220662929619,0.0523062574758287
+
## Mx:oneACEvo  os=13693  ns=7500   ep=7   co=1  df=13686  ll=20247.8501  cpu=0.1562  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2549   0.5262   1.4310  -0.0025   0.9502   0.0523 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA  -0.0025     NA
+## oneACEvo.US[1,2]     NA   0.9502     NA
+## oneACEvo.US[1,3]     NA   0.0523     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : constraint-adjusted standard errors
+## could not be calculated because the coefficient matrix of the quadratic form was uninvertible
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : 6932 rows obtained probability of
+## exactly zero; You may wish to try again with better starting values.
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 10. Starting values are not feasible. Consider
+## mxTryHard()
+
## Mx:oneAEvo  os=13693  ns=7500   ep=6   co=1  df=13687  ll=39467976648.9511  cpu=1.1834  opt=SLSQP  ver=2.22.11  stc=10
+##  t1thOrd_  t2thOrd_  t3thOrd_  t4thOrd_      VA11      VE11 
+##   -3.0000  340.1266 1401.4726    0.0010    3.9965   -2.9965 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.9965     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.9965     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13693  ns=7500   ep=6   co=1  df=13687  ll=20247.8679  cpu=0.1099  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2548   0.5263   1.4311   0.9494   0.0506 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9494     NA
+## oneCEvo.US[1,3]     NA   0.0506     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20624.5417142214
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20624.541714221
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20624.5417142207
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20624.1421668972
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  20624.541714219 vs 20624.1421668972
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  20624.5417142205 vs 20624.1421668972
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  20624.5417142278 vs 20624.1421668972
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  20624.5417142195 vs 20624.1421668972
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  20624.5417142213 vs 20624.1421668972
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  20624.5417142225 vs 20624.1421668972
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20624.142 (started at 141459.3)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -2.99751161245723,1.27708190656529,0.517439511904492,1.4220604483559,-0.00472830301076898,0.909925454946367,0.0574205571829079
+
## Mx:oneACEvo  os=13884  ns=7500   ep=7   co=1  df=13877  ll=20624.1422  cpu=0.1588  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -2.9975   1.2771   0.5174   1.4221  -0.0047   0.9099   0.0574 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA  -0.0047     NA
+## oneACEvo.US[1,2]     NA   0.9099     NA
+## oneACEvo.US[1,3]     NA   0.0574     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : 5923 rows obtained probability of
+## exactly zero; You may wish to try again with better starting values.
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 10. Starting values are not feasible. Consider
+## mxTryHard()
+
## Mx:oneAEvo  os=13884  ns=7500   ep=6   co=1  df=13878  ll=32134818555.2518  cpu=1.0359  opt=SLSQP  ver=2.22.11  stc=10
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   9.0673  29.2929   0.0010  -1.0717   2.0717 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA  -1.0717     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA   2.0717     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13884  ns=7500   ep=6   co=1  df=13878  ll=20624.5755  cpu=0.1097  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2458   0.5274   1.4468   0.9440   0.0560 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0    0.000     NA
+## oneCEvo.US[1,2]     NA    0.944     NA
+## oneCEvo.US[1,3]     NA    0.056     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20614.0458246763
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20614.0458246763
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20614.046 (started at 141446.51)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.26599362796403,0.51901312544344,1.3998491982065,0.0153225815489091,0.943064609620405,0.0416128088306862
+
## Mx:oneACEvo  os=13793  ns=7500   ep=7   co=1  df=13786  ll=20614.0458  cpu=0.1543  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2660   0.5190   1.3998   0.0153   0.9431   0.0416 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0153     NA
+## oneACEvo.US[1,2]     NA   0.9431     NA
+## oneACEvo.US[1,3]     NA   0.0416     NA
+
## Running oneAEvo with 6 parameters
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=13793  ns=7500   ep=6   co=1  df=13787  ll=22791.8372  cpu=0.7868  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -2.1501   0.8026   0.3614   1.2319   3.8866  -2.8866 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.8866     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.8866     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13793  ns=7500   ep=6   co=1  df=13787  ll=20614.6931  cpu=0.1258  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2662   0.5189   1.3992   0.9482   0.0518 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9482     NA
+## oneCEvo.US[1,3]     NA   0.0518     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20338.5550338107
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20338.555033807
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20338.555033807
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20338.555 (started at 141700.56)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.26741756490679,0.485498962910768,1.44679148532255,0.0218242282168823,0.942023447249857,0.0361523245332611
+
## Mx:oneACEvo  os=13810  ns=7500   ep=7   co=1  df=13803  ll=20338.555  cpu=0.1582  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2674   0.4855   1.4468   0.0218   0.9420   0.0362 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0218     NA
+## oneACEvo.US[1,2]     NA   0.9420     NA
+## oneACEvo.US[1,3]     NA   0.0361     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=13810  ns=7500   ep=6   co=1  df=13804  ll=41787.7003  cpu=0.634  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.8162   0.4618   0.8327  -4.0709   5.0709 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA  -4.0709     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA   5.0709     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13810  ns=7500   ep=6   co=1  df=13804  ll=20339.8802  cpu=0.1058  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2679   0.4851   1.4459   0.9493   0.0507 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9493     NA
+## oneCEvo.US[1,3]     NA   0.0507     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20708.7888644942
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20708.788864492
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20708.7888644904
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20708.7888644894
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20708.789 (started at 141745.34)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.24949461088369,0.530674202416428,1.40420017841994,0.0565984010658039,0.924453141136675,0.0189484577975212
+
## Mx:oneACEvo  os=13799  ns=7500   ep=7   co=1  df=13792  ll=20708.7889  cpu=0.1634  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2495   0.5307   1.4042   0.0566   0.9245   0.0189 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0566     NA
+## oneACEvo.US[1,2]     NA   0.9245     NA
+## oneACEvo.US[1,3]     NA   0.0189     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=13799  ns=7500   ep=6   co=1  df=13793  ll=22574.0403  cpu=0.1398  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.2433   0.6307   1.4431   3.6089  -2.6089 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.6089     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.6089     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13799  ns=7500   ep=6   co=1  df=13793  ll=20716.3289  cpu=0.1234  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2518   0.5284   1.4019   0.9432   0.0568 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9432     NA
+## oneCEvo.US[1,3]     NA   0.0568     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20368.0404460227
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20368.0404460219
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20368.04044602
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20368.04 (started at 141123.11)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -2.99999999999979,1.2301546681746,0.542181203722407,1.42836875942926,-0.00168311391246491,0.947820663661815,0.05386245025065
+
## Mx:oneACEvo  os=13787  ns=7500   ep=7   co=1  df=13780  ll=20368.0404  cpu=0.1592  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2302   0.5422   1.4284  -0.0017   0.9478   0.0539 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA  -0.0017     NA
+## oneACEvo.US[1,2]     NA   0.9478     NA
+## oneACEvo.US[1,3]     NA   0.0539     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : 60 rows obtained probability of
+## exactly zero; You may wish to try again with better starting values.
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 10. Starting values are not feasible. Consider
+## mxTryHard()
+
## Mx:oneAEvo  os=13787  ns=7500   ep=6   co=1  df=13781  ll=4866057.4625  cpu=4.8003  opt=SLSQP  ver=2.22.11  stc=10
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.2108   0.5224   1.2705   0.1444  -0.0922 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   0.1444     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -0.0922     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13787  ns=7500   ep=6   co=1  df=13781  ll=20368.0478  cpu=0.1115  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2301   0.5423   1.4284   0.9473   0.0527 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9473     NA
+## oneCEvo.US[1,3]     NA   0.0527     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20776.7265173039
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20776.7265173018
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20776.7265173014
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20776.7265173009
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20776.7265172994
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20776.727 (started at 139851.01)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.27488366231675,0.5192776488385,1.42255535246741,0.0376860490328577,0.930598490650072,0.0317154603170699
+
## Mx:oneACEvo  os=13728  ns=7500   ep=7   co=1  df=13721  ll=20776.7265  cpu=0.1582  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2749   0.5193   1.4226   0.0377   0.9306   0.0317 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0377     NA
+## oneACEvo.US[1,2]     NA   0.9306     NA
+## oneACEvo.US[1,3]     NA   0.0317     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=13728  ns=7500   ep=6   co=1  df=13722  ll=22742.232  cpu=0.1249  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.2734   0.6213   1.4569   3.5950  -2.5950 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA    3.595     NA
+## oneAEvo.US[1,2]     NA    0.000      0
+## oneAEvo.US[1,3]     NA   -2.595     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13728  ns=7500   ep=6   co=1  df=13722  ll=20780.1245  cpu=0.1265  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2760   0.5183   1.4211   0.9432   0.0568 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9432     NA
+## oneCEvo.US[1,3]     NA   0.0568     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20367.2459832708
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20367.2459832637
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20367.2459832626
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20367.2459832622
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20367.246 (started at 142049.65)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.24473817255445,0.5171354352853,1.42423908177936,0.0373471501898089,0.936264676959605,0.0263881728505865
+
## Mx:oneACEvo  os=13819  ns=7500   ep=7   co=1  df=13812  ll=20367.246  cpu=0.1476  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2447   0.5171   1.4242   0.0373   0.9363   0.0264 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0373     NA
+## oneACEvo.US[1,2]     NA   0.9363     NA
+## oneACEvo.US[1,3]     NA   0.0264     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=13819  ns=7500   ep=6   co=1  df=13813  ll=22321.5369  cpu=0.1515  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.2488   0.6161   1.4553   3.6472  -2.6472 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.6472     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.6472     NA
+
## Running oneCEvo with 6 parameters
+
## Warning: In model 'oneCEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneCEvo  os=13819  ns=7500   ep=6   co=1  df=13813  ll=20371.0192  cpu=0.0925  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2460   0.5161   1.4226   0.9488   0.0512 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9488     NA
+## oneCEvo.US[1,3]     NA   0.0512     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20702.2694043845
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20702.2694043844
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20702.269 (started at 142176.27)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.22603250758965,0.555969371691418,1.4143463622904,-0.00362132216181017,0.945357143739078,0.0582641784227318
+
## Mx:oneACEvo  os=13888  ns=7500   ep=7   co=1  df=13881  ll=20702.2694  cpu=0.16  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2260   0.5560   1.4143  -0.0036   0.9454   0.0583 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA  -0.0036     NA
+## oneACEvo.US[1,2]     NA   0.9454     NA
+## oneACEvo.US[1,3]     NA   0.0583     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Mx:oneAEvo  os=13888  ns=7500   ep=6   co=1  df=13882  ll=35416.0523  cpu=0.2  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.4432   0.6765   1.0300  -2.0000   3.0000 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA       -2     NA
+## oneAEvo.US[1,2]     NA        0     NA
+## oneAEvo.US[1,3]     NA        3     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13888  ns=7500   ep=6   co=1  df=13882  ll=20702.3001  cpu=0.1089  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2260   0.5560   1.4145   0.9442   0.0558 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9442     NA
+## oneCEvo.US[1,3]     NA   0.0558     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20276.5445071972
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20276.5445071965
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20276.5445071953
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20276.545 (started at 141123.74)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.21394355856443,0.544258227264624,1.45328091307995,0.0366436808196778,0.935208421764385,0.0281478974159374
+
## Mx:oneACEvo  os=13793  ns=7500   ep=7   co=1  df=13786  ll=20276.5445  cpu=0.1561  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2139   0.5443   1.4533   0.0366   0.9352   0.0281 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0366     NA
+## oneACEvo.US[1,2]     NA   0.9352     NA
+## oneACEvo.US[1,3]     NA   0.0281     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=13793  ns=7500   ep=6   co=1  df=13787  ll=260942.1575  cpu=0.4347  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -2.8854   0.7224   1.5314   6.4579  -4.8688   5.8688 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA  -4.8688     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA   5.8688     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13793  ns=7500   ep=6   co=1  df=13787  ll=20280.1088  cpu=0.1231  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2150   0.5435   1.4515   0.9475   0.0525 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9475     NA
+## oneCEvo.US[1,3]     NA   0.0525     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20512.2341088896
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20512.2341088894
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20512.234108889
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20512.234108887
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20512.234 (started at 140651.81)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.27603138018991,0.49657444268168,1.44977471282939,0.0119283618274243,0.943698648855262,0.0443729893173141
+
## Mx:oneACEvo  os=13810  ns=7500   ep=7   co=1  df=13803  ll=20512.2341  cpu=0.1619  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2760   0.4966   1.4498   0.0119   0.9437   0.0444 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0119     NA
+## oneACEvo.US[1,2]     NA   0.9437     NA
+## oneACEvo.US[1,3]     NA   0.0444     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Mx:oneAEvo  os=13810  ns=7500   ep=6   co=1  df=13804  ll=69155.4709  cpu=0.5856  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -2.9503   0.2780   0.0767   2.7591  -3.0176   4.0176 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA  -3.0176     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA   4.0176     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13810  ns=7500   ep=6   co=1  df=13804  ll=20512.6074  cpu=0.1014  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2767   0.4959   1.4495   0.9477   0.0523 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9477     NA
+## oneCEvo.US[1,3]     NA   0.0523     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20365.7891054147
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20365.7891054115
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20365.789105411
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20365.7891054101
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20365.789 (started at 142630.63)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.24499084469756,0.507291863670521,1.43787818497223,0.0319661467862303,0.938714476619858,0.029319376593912
+
## Mx:oneACEvo  os=13870  ns=7500   ep=7   co=1  df=13863  ll=20365.7891  cpu=0.1525  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2450   0.5073   1.4379   0.0320   0.9387   0.0293 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0320     NA
+## oneACEvo.US[1,2]     NA   0.9387     NA
+## oneACEvo.US[1,3]     NA   0.0293     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : 9 rows obtained probability of
+## exactly zero; You may wish to try again with better starting values.
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 10. Starting values are not feasible. Consider
+## mxTryHard()
+
## Mx:oneAEvo  os=13870  ns=7500   ep=6   co=1  df=13864  ll=2746596.9304  cpu=0.5907  opt=SLSQP  ver=2.22.11  stc=10
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -2.2301   2.0173   1.1485   0.7422   1.1011  -1.0398 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   1.1011     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -1.0398     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13870  ns=7500   ep=6   co=1  df=13864  ll=20368.6535  cpu=0.1045  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2459   0.5066   1.4364   0.9494   0.0506 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9494     NA
+## oneCEvo.US[1,3]     NA   0.0506     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20152.9296268642
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20152.9296268627
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20152.93 (started at 142450.45)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.24272098519642,0.496085502953213,1.45105427744605,0.0130828565319589,0.945783297059948,0.0411338464080932
+
## Mx:oneACEvo  os=13843  ns=7500   ep=7   co=1  df=13836  ll=20152.9296  cpu=0.1506  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2427   0.4961   1.4511   0.0131   0.9458   0.0411 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0131     NA
+## oneACEvo.US[1,2]     NA   0.9458     NA
+## oneACEvo.US[1,3]     NA   0.0411     NA
+
## Running oneAEvo with 6 parameters
+
## Warning in runHelper(model, frontendStart, intervals, silent, suppressWarnings, : Polite note: Model finished with a larger ordinal error than we typically expect.
+##  This may be fine, but you may wish to re-run the model using
+##  `mxTryHardOrdinal()` in place of `mxRun()` to try for a better fit.
+##  Expert version: model$output[['maxRelativeOrdinalError']] is 
+##  larger than the mvnRelEps value of  0.005 .
+##  If this is expected for your model, you might wish to increase `mvnRelEps`, e.g:
+##  mxOption(NULL, 'mvnRelEps', value= mxOption(NULL, 'mvnRelEps')*5)
+##  see `?mxOptions`
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=13843  ns=7500   ep=6   co=1  df=13837  ll=48604.023  cpu=0.4626  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -2.6501   0.0085   0.3616   2.0296  -2.0000   3.0000 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA       -2     NA
+## oneAEvo.US[1,2]     NA        0     NA
+## oneAEvo.US[1,3]     NA        3     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13843  ns=7500   ep=6   co=1  df=13837  ll=20153.4234  cpu=0.1191  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2433   0.4956   1.4506   0.9502   0.0498 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9502     NA
+## oneCEvo.US[1,3]     NA   0.0498     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20590.4632826183
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20590.4632826156
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20590.463 (started at 141770.55)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -2.99999999999992,1.23990256980457,0.538920604475016,1.4046498744242,0.00540857774578677,0.943422865150779,0.0511685571034346
+
## Mx:oneACEvo  os=13798  ns=7500   ep=7   co=1  df=13791  ll=20590.4633  cpu=0.1496  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2399   0.5389   1.4046   0.0054   0.9434   0.0512 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0054     NA
+## oneACEvo.US[1,2]     NA   0.9434     NA
+## oneACEvo.US[1,3]     NA   0.0512     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=13798  ns=7500   ep=6   co=1  df=13792  ll=22500.3016  cpu=0.1483  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   1.2527   0.6295   1.4357   3.6501  -2.6501 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.6501     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.6501     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=13798  ns=7500   ep=6   co=1  df=13792  ll=20590.5331  cpu=0.1186  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2400   0.5389   1.4044   0.9452   0.0548 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9452     NA
+## oneCEvo.US[1,3]     NA   0.0548     NA
+## [1] "the if statement you think is running is running"
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20680.1551225554
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  20680.1551225541
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=20680.155 (started at 141485.9)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.26030476117794,0.514828100529639,1.42865926523878,0.0241637347143448,0.935683127624715,0.0401531376609408
+
## Mx:oneACEvo  os=13826  ns=7500   ep=7   co=1  df=13819  ll=20680.1551  cpu=0.1631  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2603   0.5148   1.4287   0.0242   0.9357   0.0402 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.0242     NA
+## oneACEvo.US[1,2]     NA   0.9357     NA
+## oneACEvo.US[1,3]     NA   0.0401     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=13826  ns=7500   ep=6   co=1  df=13820  ll=22859.3788  cpu=0.2769  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9537   0.7361   1.5860   1.8949  -0.8949 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   1.8949     NA
+## oneAEvo.US[1,2]      0   0.0000      0
+## oneAEvo.US[1,3]     NA  -0.8949     NA
+
## Running oneCEvo with 6 parameters
+
## Warning: In model 'oneCEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneCEvo  os=13826  ns=7500   ep=6   co=1  df=13820  ll=20681.5459  cpu=0.1131  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2607   0.5146   1.4276   0.9437   0.0563 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9437     NA
+## oneCEvo.US[1,3]     NA   0.0563     NA
+
table_ord <- harvest(results_fit, "Ordinal")
+table_int <- harvest(results_fit, "Interval")
+
+final_results <- rbind(table_ord, table_int)
+final_results <- final_results %>% mutate(TV = VA11 + VC11 + VE11,
+                                          A = VA11 / TV,
+                                          C = VC11 / TV,
+                                          E = VE11 / TV) %>%
+  select(-c("VA11","VC11","VE11","TV"))
+final_results
+
## # A tibble: 40 × 5
+##    Iteration   Analysis        A     C      E
+##    <chr>       <chr>       <dbl> <dbl>  <dbl>
+##  1 Iteration1  Ordinal   0.00294 0.948 0.0494
+##  2 Iteration2  Ordinal   0.0458  0.929 0.0255
+##  3 Iteration3  Ordinal   0.00449 0.944 0.0511
+##  4 Iteration4  Ordinal   0.0213  0.940 0.0392
+##  5 Iteration5  Ordinal   0.0150  0.944 0.0408
+##  6 Iteration6  Ordinal  -0.00253 0.950 0.0523
+##  7 Iteration7  Ordinal  -0.00491 0.945 0.0597
+##  8 Iteration8  Ordinal   0.0153  0.943 0.0416
+##  9 Iteration9  Ordinal   0.0218  0.942 0.0362
+## 10 Iteration10 Ordinal   0.0566  0.924 0.0189
+## # ℹ 30 more rows
+
true_A <- 0.50
+true_C <- 0.20
+true_E <- 0.30
+
+#plot <- 
+ggplot(final_results) +
+  geom_density(aes(x = A, fill = "Additive Genetic (A)"), alpha = 0.4, color = "#9E7E38") +
+  geom_density(aes(x = C, fill = "Shared Environment (C)"), alpha = 0.4, color = "#D4AF37") +
+  geom_density(aes(x = E, fill = "Error (E)"), alpha = 0.4, color = "#4A4E41") +
+  
+  geom_vline(xintercept = true_A, color = "#9E7E38", linetype = "dashed", size = 1) +
+  geom_vline(xintercept = true_C, color = "#D4AF37", linetype = "dashed", size = 1) +
+  geom_vline(xintercept = true_E, color = "#4A4E41", linetype = "dashed", size = 1) +
+  scale_fill_manual(
+  values = c(
+    "Additive Genetic (A)" = "#9E7E38",
+    "Shared Environment (C)" = "#D4AF37",
+    "Error (E)" = "#4A4E41")) +
+
+  facet_wrap(~Analysis) +
+
+    theme_minimal() +
+  
+  theme(axis.title.x = element_blank(),
+    text = element_text(family = "Baskerville", color = "black"),#not to self turn the text to white and then its ready for poster (already has transparent background)
+    panel.background = element_rect(fill = "transparent", color = NA),
+    plot.background = element_rect(fill = "transparent", color = NA),
+    panel.grid = element_blank(),
+    axis.ticks.y = element_blank()) +
+
+    labs(title = "Distribution of Simulation Results",
+       subtitle = "Siblings and Half Siblings",
+       y = "Density",
+       fill = "Parameter Estimate")
+
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
+## ℹ Please use `linewidth` instead.
+## This warning is displayed once per session.
+## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
+

+
#ggsave('simresults.PNG', plot, bg = 'transparent', dpi = 300)
+

MZ and DZs

+
results_fit <- Sim_Fit2(
+  GroupNames = c("FS", "HS"),
+  GroupSizes = c(2500, 2500),
+  nIter = 20,
+  SSeed = 62,
+  GroupRel = c(1, .5), #now we are back to having the sample size adjustment, so this is truly 5,000 obs whereas the sibs and half sibs one is 7500
+  GroupR_c = c(1, 1),
+  nth = 4,
+  mu = c(0,0), 
+  ace1 = c(.5, .2, .3), #other to do: fork ACEsimFit and work off my own version of the package 
+  ace2 = c(.5, .2, .3),
+  missing = c(.50,.30),
+  ifComb = TRUE,
+  lbound = FALSE,
+  saveRaw = TRUE,
+  Ord = TRUE)
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13352.6941929477
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13352.6941929469
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13352.694 (started at 95694.35)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.24375184100985,0.487659034350144,1.39502545937307,0.135936775157444,0.901555337882871,-0.0374921130403146
+
## Mx:oneACEvo  os=9227  ns=5000   ep=7   co=1  df=9220  ll=13352.6942  cpu=0.1353  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2438   0.4877   1.3950   0.1359   0.9016  -0.0375 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1359     NA
+## oneACEvo.US[1,2]     NA   0.9016     NA
+## oneACEvo.US[1,3]     NA  -0.0375     NA
+
## Running oneAEvo with 6 parameters
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=9227  ns=5000   ep=6   co=1  df=9221  ll=15244.3369  cpu=0.1163  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9679   0.7510   1.5624   2.9719  -1.9719 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   2.9719     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -1.9719     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9227  ns=5000   ep=6   co=1  df=9221  ll=13396.6087  cpu=0.1185  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2532   0.4790   1.3890   0.9538   0.0462 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9538 0.9598
+## oneCEvo.US[1,3] 0.0402   0.0462     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13234.4337327792
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13234.4337327746
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13234.4337327742
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13234.4337327737
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13234.434 (started at 97414.828)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.1920675263295,0.519874832075136,1.37172277498725,0.123929793781845,0.90703442355023,-0.0309642173320751
+
## Mx:oneACEvo  os=9285  ns=5000   ep=7   co=1  df=9278  ll=13234.4337  cpu=0.1392  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.1921   0.5199   1.3717   0.1239   0.9070  -0.0310 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1239     NA
+## oneACEvo.US[1,2]     NA   0.9070     NA
+## oneACEvo.US[1,3]     NA  -0.0310     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9285  ns=5000   ep=6   co=1  df=9279  ll=15099.2818  cpu=0.1053  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9082   0.8045   1.5332   3.0188  -2.0188 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0188     NA
+## oneAEvo.US[1,2]     NA   0.0000      0
+## oneAEvo.US[1,3]     NA  -2.0188     NA
+
## Running oneCEvo with 6 parameters
+
## Warning: In model 'oneCEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneCEvo  os=9285  ns=5000   ep=6   co=1  df=9279  ll=13270.0787  cpu=0.092  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2055   0.5069   1.3652   0.9541   0.0459 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1] 0.0000   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9541 0.9601
+## oneCEvo.US[1,3] 0.0399   0.0459     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13441.8733941452
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13441.8733941451
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13441.873 (started at 96085.776)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -2.99999999999995,1.22453410825627,0.521616331942896,1.37571443906023,0.155293626692092,0.892813319976336,-0.0481069466684285
+
## Mx:oneACEvo  os=9271  ns=5000   ep=7   co=1  df=9264  ll=13441.8734  cpu=0.1381  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2245   0.5216   1.3757   0.1553   0.8928  -0.0481 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1553     NA
+## oneACEvo.US[1,2]     NA   0.8928     NA
+## oneACEvo.US[1,3]     NA  -0.0481     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9271  ns=5000   ep=6   co=1  df=9265  ll=15364.5639  cpu=0.11  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9571   0.7791   1.5433   2.9727  -1.9727 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   2.9727     NA
+## oneAEvo.US[1,2]     NA   0.0000      0
+## oneAEvo.US[1,3]     NA  -1.9727     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9271  ns=5000   ep=6   co=1  df=9265  ll=13496.2833  cpu=0.0915  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2348   0.5124   1.3683   0.9517   0.0483 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1] 0.0000   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9517 0.9577
+## oneCEvo.US[1,3] 0.0423   0.0483     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13335.6305306042
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  61220.1028774141 vs 13335.6305306042
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13335.6305306036
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13335.631 (started at 95481.485)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.18569171423944,0.565969579231105,1.37352968699427,0.155204162612624,0.893013389481806,-0.0482175520944303
+
## Mx:oneACEvo  os=9217  ns=5000   ep=7   co=1  df=9210  ll=13335.6305  cpu=0.1358  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.1857   0.5660   1.3735   0.1552   0.8930  -0.0482 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1552     NA
+## oneACEvo.US[1,2]     NA   0.8930     NA
+## oneACEvo.US[1,3]     NA  -0.0482     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9217  ns=5000   ep=6   co=1  df=9211  ll=15234.5229  cpu=0.0988  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.8884   0.8526   1.5412   2.9294  -1.9294 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   2.9294     NA
+## oneAEvo.US[1,2]     NA   0.0000      0
+## oneAEvo.US[1,3]     NA  -1.9294     NA
+
## Running oneCEvo with 6 parameters
+
## Warning: In model 'oneCEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneCEvo  os=9217  ns=5000   ep=6   co=1  df=9211  ll=13386.8178  cpu=0.1026  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2027   0.5493   1.3669   0.9522   0.0478 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9522     NA
+## oneCEvo.US[1,3]     NA   0.0478     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13545.1220200826
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13545.1220200821
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13545.122 (started at 95457.337)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.21559524761199,0.533384666581938,1.40474123480211,0.153431988914586,0.890342506181476,-0.0437744950960623
+
## Mx:oneACEvo  os=9276  ns=5000   ep=7   co=1  df=9269  ll=13545.122  cpu=0.1389  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2156   0.5334   1.4047   0.1534   0.8903  -0.0438 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1534     NA
+## oneACEvo.US[1,2]     NA   0.8903     NA
+## oneACEvo.US[1,3]     NA  -0.0438     NA
+
## Running oneAEvo with 6 parameters
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=9276  ns=5000   ep=6   co=1  df=9270  ll=15383.6183  cpu=0.0971  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9133   0.8236   1.5732   2.9182  -1.9182 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   2.9182     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -1.9182     NA
+
## Running oneCEvo with 6 parameters
+
## Warning: In model 'oneCEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneCEvo  os=9276  ns=5000   ep=6   co=1  df=9270  ll=13593.0751  cpu=0.0892  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2265   0.5227   1.3983   0.9490   0.0510 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1] 0.0000    0.000 0.0000
+## oneCEvo.US[1,2]     NA    0.949 0.9555
+## oneCEvo.US[1,3] 0.0445    0.051     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13261.2526550407
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13261.25265504
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13261.2526550399
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13261.2526550396
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13261.253 (started at 95293.678)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.2094139586372,0.547201888136113,1.36190435612747,0.163183469048163,0.893439108592692,-0.0566225776408556
+
## Mx:oneACEvo  os=9198  ns=5000   ep=7   co=1  df=9191  ll=13261.2527  cpu=0.1353  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2094   0.5472   1.3619   0.1632   0.8934  -0.0566 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1632     NA
+## oneACEvo.US[1,2]     NA   0.8934     NA
+## oneACEvo.US[1,3]     NA  -0.0566     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9198  ns=5000   ep=6   co=1  df=9192  ll=15235.0696  cpu=0.1074  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9490   0.7987   1.5290   3.0285  -2.0285 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0285     NA
+## oneAEvo.US[1,2]      0   0.0000      0
+## oneAEvo.US[1,3]     NA  -2.0285     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9198  ns=5000   ep=6   co=1  df=9192  ll=13325.3066  cpu=0.1006  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2275   0.5282   1.3567   0.9560   0.0440 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA    0.000      0
+## oneCEvo.US[1,2]     NA    0.956     NA
+## oneCEvo.US[1,3]     NA    0.044     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13457.3104601697
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13457.3104601692
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  13458.8675331138 vs 13457.3104601692
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13457.3104601688
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13457.31 (started at 95643.066)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.20756759315039,0.550329836866374,1.36955849483901,0.178263298665194,0.88305877411058,-0.0613220727757741
+
## Mx:oneACEvo  os=9248  ns=5000   ep=7   co=1  df=9241  ll=13457.3105  cpu=0.1352  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2076   0.5503   1.3696   0.1783   0.8831  -0.0613 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1783     NA
+## oneACEvo.US[1,2]     NA   0.8831     NA
+## oneACEvo.US[1,3]     NA  -0.0613     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9248  ns=5000   ep=6   co=1  df=9242  ll=14409.8343  cpu=0.105  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9218   0.7707   1.5022   1.9374  -0.9374 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   1.9374     NA
+## oneAEvo.US[1,2]     NA   0.0000      0
+## oneAEvo.US[1,3]     NA  -0.9374     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9248  ns=5000   ep=6   co=1  df=9242  ll=13524.748  cpu=0.1025  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2276   0.5304   1.3615   0.9511   0.0489 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9511     NA
+## oneCEvo.US[1,3]     NA   0.0489     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13321.8665416462
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13321.8665416448
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13321.8665416444
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13321.867 (started at 96578.525)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.21086728195345,0.524126391781704,1.37039933865628,0.135703971702119,0.90295559615215,-0.0386595678542694
+
## Mx:oneACEvo  os=9275  ns=5000   ep=7   co=1  df=9268  ll=13321.8665  cpu=0.1324  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2109   0.5241   1.3704   0.1357   0.9030  -0.0387 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1357     NA
+## oneACEvo.US[1,2]     NA   0.9030     NA
+## oneACEvo.US[1,3]     NA  -0.0387     NA
+
## Running oneAEvo with 6 parameters
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=9275  ns=5000   ep=6   co=1  df=9269  ll=15273.0117  cpu=0.1052  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9178   0.8010   1.5408   2.9616  -1.9616 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   2.9616     NA
+## oneAEvo.US[1,2]      0   0.0000      0
+## oneAEvo.US[1,3]     NA  -1.9616     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9275  ns=5000   ep=6   co=1  df=9269  ll=13366.5197  cpu=0.0877  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2210   0.5149   1.3644   0.9550   0.0450 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0    0.000      0
+## oneCEvo.US[1,2]     NA    0.955     NA
+## oneCEvo.US[1,3]     NA    0.045     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13257.5944818649
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13257.5944818646
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13257.5944818641
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13257.594481864
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13257.594 (started at 95808.269)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.21775378691628,0.514812025913546,1.39730743849803,0.157520761300228,0.893685705199479,-0.0512064664997072
+
## Mx:oneACEvo  os=9260  ns=5000   ep=7   co=1  df=9253  ll=13257.5945  cpu=0.1348  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2178   0.5148   1.3973   0.1575   0.8937  -0.0512 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1575     NA
+## oneACEvo.US[1,2]     NA   0.8937     NA
+## oneACEvo.US[1,3]     NA  -0.0512     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9260  ns=5000   ep=6   co=1  df=9254  ll=15155.6754  cpu=0.097  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9387   0.7839   1.5661   3.0213  -2.0213 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0213     NA
+## oneAEvo.US[1,2]      0   0.0000      0
+## oneAEvo.US[1,3]     NA  -2.0213     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9260  ns=5000   ep=6   co=1  df=9254  ll=13318.2505  cpu=0.0949  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2277   0.5067   1.3883   0.9537   0.0463 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9537 0.9596
+## oneCEvo.US[1,3] 0.0404   0.0463     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13092.0893341593
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13092.0893341592
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13092.0893341592
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13092.089334159
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13092.089 (started at 96287.779)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.17734339362507,0.556276916402209,1.35045313490008,0.195625830249773,0.881313135935484,-0.0769389661852575
+
## Mx:oneACEvo  os=9180  ns=5000   ep=7   co=1  df=9173  ll=13092.0893  cpu=0.1338  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.1773   0.5563   1.3505   0.1956   0.8813  -0.0769 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1956     NA
+## oneACEvo.US[1,2]     NA   0.8813     NA
+## oneACEvo.US[1,3]     NA  -0.0769     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9180  ns=5000   ep=6   co=1  df=9174  ll=14974.5262  cpu=0.1146  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9363   0.8031   1.5038   3.1124  -2.1124 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.1124     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.1124     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9180  ns=5000   ep=6   co=1  df=9174  ll=13179.3284  cpu=0.0791  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2128   0.5183   1.3437   0.9556   0.0444 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1] 0.0000   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9556 0.9614
+## oneCEvo.US[1,3] 0.0386   0.0444     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13217.9850473144
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13217.9850473126
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13217.9850473113
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13217.985 (started at 95722.43)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.24244650280389,0.485770171001612,1.39776997076325,0.157844436816937,0.895965032807034,-0.053809469623971
+
## Mx:oneACEvo  os=9220  ns=5000   ep=7   co=1  df=9213  ll=13217.985  cpu=0.1401  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2424   0.4858   1.3978   0.1578   0.8960  -0.0538 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1578     NA
+## oneACEvo.US[1,2]     NA   0.8960     NA
+## oneACEvo.US[1,3]     NA  -0.0538     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9220  ns=5000   ep=6   co=1  df=9214  ll=15117.353  cpu=0.1092  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9971   0.7343   1.5550   3.0607  -2.0607 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0607     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.0607     NA
+
## Running oneCEvo with 6 parameters
+
## Warning: In model 'oneCEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneCEvo  os=9220  ns=5000   ep=6   co=1  df=9214  ll=13280.7108  cpu=0.0941  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2594   0.4688   1.3906   0.9565   0.0435 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9565 0.9623
+## oneCEvo.US[1,3] 0.0377   0.0435     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13171.5852315669
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13171.5852315652
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13171.585 (started at 95505.028)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.20780441736622,0.527215511696518,1.39516891300789,0.184801099033394,0.883889800276236,-0.0686908993096308
+
## Mx:oneACEvo  os=9218  ns=5000   ep=7   co=1  df=9211  ll=13171.5852  cpu=0.1434  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2078   0.5272   1.3952   0.1848   0.8839  -0.0687 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1848     NA
+## oneACEvo.US[1,2]     NA   0.8839     NA
+## oneACEvo.US[1,3]     NA  -0.0687     NA
+
## Running oneAEvo with 6 parameters
+
## Warning: In model 'oneAEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneAEvo  os=9218  ns=5000   ep=6   co=1  df=9212  ll=14134.4024  cpu=0.108  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9313   0.7339   1.5284   1.9455  -0.9455 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   1.9455     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -0.9455     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9218  ns=5000   ep=6   co=1  df=9212  ll=13254.0177  cpu=0.0954  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2266   0.5093   1.3862   0.9544   0.0456 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000      0
+## oneCEvo.US[1,2]     NA   0.9544     NA
+## oneCEvo.US[1,3]     NA   0.0456     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13213.2346155312
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13213.234615531
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13213.2346155307
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13213.2346155305
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  16475.3068120014 vs 13213.2346155305
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13213.235 (started at 96582.193)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.18998159806731,0.539656600768018,1.37220958509917,0.204281239987731,0.875530830811649,-0.0798120707993797
+
## Mx:oneACEvo  os=9262  ns=5000   ep=7   co=1  df=9255  ll=13213.2346  cpu=0.1343  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.1900   0.5397   1.3722   0.2043   0.8755  -0.0798 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.2043     NA
+## oneACEvo.US[1,2]     NA   0.8755     NA
+## oneACEvo.US[1,3]     NA  -0.0798     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9262  ns=5000   ep=6   co=1  df=9256  ll=15109.3731  cpu=0.1067  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9295   0.7932   1.5382   3.0399  -2.0399 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0399     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.0399     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9262  ns=5000   ep=6   co=1  df=9256  ll=13311.1958  cpu=0.1019  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2122   0.5193   1.3591   0.9525   0.0475 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9525     NA
+## oneCEvo.US[1,3]     NA   0.0475     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13629.3244768148
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13629.3244768142
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13629.3244768141
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13629.3244768137
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13629.324 (started at 95981.628)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.20934410645911,0.555023636511802,1.34847124652292,0.173234030323251,0.879979793124753,-0.0532138234480034
+
## Mx:oneACEvo  os=9251  ns=5000   ep=7   co=1  df=9244  ll=13629.3245  cpu=0.1373  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2093   0.5550   1.3485   0.1732   0.8800  -0.0532 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1732     NA
+## oneACEvo.US[1,2]     NA   0.8800     NA
+## oneACEvo.US[1,3]     NA  -0.0532     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9251  ns=5000   ep=6   co=1  df=9245  ll=15466.0918  cpu=0.0896  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9433   0.8138   1.5155   2.9168  -1.9168 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   2.9168     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -1.9168     NA
+
## Running oneCEvo with 6 parameters
+
## Warning: In model 'oneCEvo' Optimizer returned a non-zero status code 6. The model does not satisfy the first-order
+## optimality conditions to the required accuracy, and no improved point for the merit function could be found during the
+## final linesearch (Mx status RED)
+
## Mx:oneCEvo  os=9251  ns=5000   ep=6   co=1  df=9245  ll=13685.9385  cpu=0.1196  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2216   0.5442   1.3390   0.9450   0.0550 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA    0.000     NA
+## oneCEvo.US[1,2]     NA    0.945     NA
+## oneCEvo.US[1,3]     NA    0.055     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  12955.1693315127
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  12955.1693315114
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  12955.1693315107
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=12955.169 (started at 96392.722)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.17770399638754,0.524419944029862,1.40871130671604,0.166305522422505,0.894042343373345,-0.0603478657958498
+
## Mx:oneACEvo  os=9240  ns=5000   ep=7   co=1  df=9233  ll=12955.1693  cpu=0.1384  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.1777   0.5244   1.4087   0.1663   0.8940  -0.0603 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1663     NA
+## oneACEvo.US[1,2]     NA   0.8940     NA
+## oneACEvo.US[1,3]     NA  -0.0604     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9240  ns=5000   ep=6   co=1  df=9234  ll=14872.0572  cpu=0.1096  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.8746   0.8142   1.5751   3.0411  -2.0411 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0411     NA
+## oneAEvo.US[1,2]      0   0.0000      0
+## oneAEvo.US[1,3]     NA  -2.0411     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9240  ns=5000   ep=6   co=1  df=9234  ll=13025.8108  cpu=0.084  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2008   0.5010   1.4020   0.9577   0.0423 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9577 0.9634
+## oneCEvo.US[1,3] 0.0366   0.0423     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13331.2017051381
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13331.2017051158
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13331.2017051154
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13331.2017051149
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13331.2017051147
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  14490.7124826528 vs 13331.2017051147
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13331.202 (started at 96571.861)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.23392942250726,0.503663822458002,1.37818583335334,0.155899415933145,0.897051337034858,-0.0529507529680031
+
## Mx:oneACEvo  os=9299  ns=5000   ep=7   co=1  df=9292  ll=13331.2017  cpu=0.1372  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2339   0.5037   1.3782   0.1559   0.8971  -0.0530 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1559     NA
+## oneACEvo.US[1,2]     NA   0.8971     NA
+## oneACEvo.US[1,3]     NA  -0.0530     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9299  ns=5000   ep=6   co=1  df=9293  ll=15288.6478  cpu=0.1103  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9833   0.7563   1.5369   3.0680  -2.0680 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA    3.068     NA
+## oneAEvo.US[1,2]     NA    0.000      0
+## oneAEvo.US[1,3]     NA   -2.068     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9299  ns=5000   ep=6   co=1  df=9293  ll=13393.4054  cpu=0.1066  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2501   0.4872   1.3720   0.9567   0.0433 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9567     NA
+## oneCEvo.US[1,3]     NA   0.0433     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13265.1184026889
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13265.1184026878
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13265.1184026877
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13265.1184026876
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13265.1184026876
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13265.1184026871
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13265.118 (started at 95892.094)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -3,1.24011228783357,0.489013092193872,1.38619686201804,0.157642866534052,0.894908299820166,-0.0525511663542171
+
## Mx:oneACEvo  os=9220  ns=5000   ep=7   co=1  df=9213  ll=13265.1184  cpu=0.1507  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2401   0.4890   1.3862   0.1576   0.8949  -0.0526 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1576     NA
+## oneACEvo.US[1,2]     NA   0.8949     NA
+## oneACEvo.US[1,3]     NA  -0.0526     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9220  ns=5000   ep=6   co=1  df=9214  ll=15170.0233  cpu=0.097  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9755   0.7440   1.5513   3.0256  -2.0256 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0256     NA
+## oneAEvo.US[1,2]      0   0.0000      0
+## oneAEvo.US[1,3]     NA  -2.0256     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9220  ns=5000   ep=6   co=1  df=9214  ll=13327.6576  cpu=0.0859  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2533   0.4766   1.3791   0.9557   0.0443 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]      0   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9557     NA
+## oneCEvo.US[1,3]     NA   0.0443     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13108.7620593541
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13108.7620593513
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13108.762 (started at 96206.744)  (11 attempt(s): 11 valid, 0 errors)
+
##  Start values from best fit:
+
## -3,1.23086309298788,0.473241270129991,1.40190015592066,0.131571749292,0.905722194829585,-0.037293944121585
+
## Mx:oneACEvo  os=9212  ns=5000   ep=7   co=1  df=9205  ll=13108.7621  cpu=0.1463  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2309   0.4732   1.4019   0.1316   0.9057  -0.0373 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1316     NA
+## oneACEvo.US[1,2]     NA   0.9057     NA
+## oneACEvo.US[1,3]     NA  -0.0373     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9212  ns=5000   ep=6   co=1  df=9206  ll=14963.3395  cpu=0.0984  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9611   0.7375   1.5651   3.0525  -2.0525 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0525     NA
+## oneAEvo.US[1,2]      0   0.0000     NA
+## oneAEvo.US[1,3]     NA  -2.0525     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9212  ns=5000   ep=6   co=1  df=9206  ll=13152.7377  cpu=0.0959  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2388   0.4669   1.3944   0.9562   0.0438 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1] 0.0000   0.0000 0.0000
+## oneCEvo.US[1,2]     NA   0.9562 0.9621
+## oneCEvo.US[1,3] 0.0379   0.0438     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13327.3786684342
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13327.378668426
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13327.379 (started at 96138.109)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -2.99999999999998,1.23410039280133,0.492510848702347,1.37529403151291,0.148763941741511,0.894259555698719,-0.04302349744023
+
## Mx:oneACEvo  os=9204  ns=5000   ep=7   co=1  df=9197  ll=13327.3787  cpu=0.1376  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -3.0000   1.2341   0.4925   1.3753   0.1488   0.8943  -0.0430 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1488     NA
+## oneACEvo.US[1,2]     NA   0.8943     NA
+## oneACEvo.US[1,3]     NA  -0.0430     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9204  ns=5000   ep=6   co=1  df=9198  ll=14292.1005  cpu=0.1274  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9653   0.6902   1.5111   1.9264  -0.9264 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   1.9264     NA
+## oneAEvo.US[1,2]     NA   0.0000     NA
+## oneAEvo.US[1,3]     NA  -0.9264     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9204  ns=5000   ep=6   co=1  df=9198  ll=13374.4296  cpu=0.115  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2467   0.4806   1.3684   0.9513   0.0487 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1]     NA   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9513     NA
+## oneCEvo.US[1,3]     NA   0.0487     NA
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning initial fit attempt
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13335.0770406317
+
## 
+## Beginning fit attempt 1 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13335.0770406219
+
## 
+## Beginning fit attempt 2 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 3 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13335.0770406218
+
## 
+## Beginning fit attempt 4 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 5 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+## Beginning fit attempt 6 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Lowest minimum so far:  13335.0070031667
+
## 
+## Beginning fit attempt 7 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  13335.077040622 vs 13335.0070031667
+
## 
+## Beginning fit attempt 8 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  13335.0770406222 vs 13335.0070031667
+
## 
+## Beginning fit attempt 9 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  13335.0770406226 vs 13335.0070031667
+
## 
+## Beginning fit attempt 10 of at maximum 10 extra tries
+
## Running oneACEvo with 7 parameters
+
## 
+##  Fit attempt worse than current best:  13335.0770406219 vs 13335.0070031667
+
## 
+## Retry limit reached
+
## 
+## Solution found
+
## Final run, for Hessian and/or standard errors and/or confidence intervals
+
## Running oneACEvo with 7 parameters
+
## 
+##  Solution found!  Final fit=13335.007 (started at 96989.263)  (11 attempt(s): 11 valid, 0 errors)
+
## Warning in mxTryHard(model = model, greenOK = greenOK, checkHess = checkHess, : The model does not satisfy the
+## first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found
+## during the final linesearch (Mx status RED)
+
##  Start values from best fit:
+
## -2.98699271869992,1.20946860816343,0.537233995368371,1.3279159469219,0.144453145821322,0.874932815494295,-0.0438471026586665
+
## Mx:oneACEvo  os=9283  ns=5000   ep=7   co=1  df=9276  ll=13335.007  cpu=0.141  opt=SLSQP  ver=2.22.11  stc=6
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VC11     VE11 
+##  -2.9870   1.2095   0.5372   1.3279   0.1445   0.8749  -0.0438 
+##                  lbound estimate ubound
+## oneACEvo.US[1,1]     NA   0.1445     NA
+## oneACEvo.US[1,2]     NA   0.8749     NA
+## oneACEvo.US[1,3]     NA  -0.0439     NA
+
## Running oneAEvo with 6 parameters
+
## Mx:oneAEvo  os=9283  ns=5000   ep=6   co=1  df=9277  ll=15259.6969  cpu=0.1085  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VA11     VE11 
+##  -3.0000   0.9491   0.7997   1.5007   3.0732  -2.0732 
+##                 lbound estimate ubound
+## oneAEvo.US[1,1]     NA   3.0732     NA
+## oneAEvo.US[1,2]     NA   0.0000      0
+## oneAEvo.US[1,3]     NA  -2.0732     NA
+
## Running oneCEvo with 6 parameters
+
## Mx:oneCEvo  os=9283  ns=5000   ep=6   co=1  df=9277  ll=13385.2561  cpu=0.103  opt=SLSQP  ver=2.22.11  stc=0
+## t1thOrd_ t2thOrd_ t3thOrd_ t4thOrd_     VC11     VE11 
+##  -3.0000   1.2055   0.5407   1.3308   0.9526   0.0474 
+##                 lbound estimate ubound
+## oneCEvo.US[1,1] 0.0000   0.0000     NA
+## oneCEvo.US[1,2]     NA   0.9526 0.9584
+## oneCEvo.US[1,3] 0.0416   0.0474     NA
+
table_ord <- harvest(results_fit, "Ordinal")
+table_int <- harvest(results_fit, "Interval")
+
+final_results <- rbind(table_ord, table_int)
+final_results <- final_results %>% mutate(TV = VA11 + VC11 + VE11,
+                                          A = VA11 / TV,
+                                          C = VC11 / TV,
+                                          E = VE11 / TV) %>%
+  select(-c("VA11","VC11","VE11","TV"))
+final_results
+
## # A tibble: 40 × 5
+##    Iteration   Analysis     A     C       E
+##    <chr>       <chr>    <dbl> <dbl>   <dbl>
+##  1 Iteration1  Ordinal  0.136 0.902 -0.0375
+##  2 Iteration2  Ordinal  0.124 0.907 -0.0310
+##  3 Iteration3  Ordinal  0.155 0.893 -0.0481
+##  4 Iteration4  Ordinal  0.155 0.893 -0.0482
+##  5 Iteration5  Ordinal  0.153 0.890 -0.0438
+##  6 Iteration6  Ordinal  0.163 0.893 -0.0566
+##  7 Iteration7  Ordinal  0.178 0.883 -0.0613
+##  8 Iteration8  Ordinal  0.136 0.903 -0.0387
+##  9 Iteration9  Ordinal  0.158 0.894 -0.0512
+## 10 Iteration10 Ordinal  0.196 0.881 -0.0769
+## # ℹ 30 more rows
+
true_A <- 0.50
+true_C <- 0.20
+true_E <- 0.30
+
+#plot <- 
+ggplot(final_results) +
+  geom_density(aes(x = A, fill = "Additive Genetic (A)"), alpha = 0.4, color = "#9E7E38") +
+  geom_density(aes(x = C, fill = "Shared Environment (C)"), alpha = 0.4, color = "#D4AF37") +
+  geom_density(aes(x = E, fill = "Error (E)"), alpha = 0.4, color = "#4A4E41") +
+  
+  geom_vline(xintercept = true_A, color = "#9E7E38", linetype = "dashed", size = 1) +
+  geom_vline(xintercept = true_C, color = "#D4AF37", linetype = "dashed", size = 1) +
+  geom_vline(xintercept = true_E, color = "#4A4E41", linetype = "dashed", size = 1) +
+  scale_fill_manual(
+  values = c(
+    "Additive Genetic (A)" = "#9E7E38",
+    "Shared Environment (C)" = "#D4AF37",
+    "Error (E)" = "#4A4E41")) +
+
+  facet_wrap(~Analysis) +
+
+    theme_minimal() +
+  
+  theme(axis.title.x = element_blank(),
+    text = element_text(family = "Baskerville", color = "black"),#not to self turn the text to white and then its ready for poster (already has transparent background)
+    panel.background = element_rect(fill = "transparent", color = NA),
+    plot.background = element_rect(fill = "transparent", color = NA),
+    panel.grid = element_blank(),
+    axis.ticks.y = element_blank()) +
+
+    labs(title = "Distribution of Simulation Results",
+       subtitle = "MZs and DZs",
+       y = "Density",
+       fill = "Parameter Estimate")
+

+
#ggsave('simresults.PNG', plot, bg = 'transparent', dpi = 300)
+ + + + +
+ + + + + + + + + + + + + + + diff --git a/R/fit_OrdACE.R b/R/fit_OrdACE.R new file mode 100644 index 0000000..ab2805b --- /dev/null +++ b/R/fit_OrdACE.R @@ -0,0 +1,247 @@ +#' fit_OrdACE +#' @description Use OpenMx to quickly fit a univariate Ordinal ACE model +#' @importFrom OpenMx mxMatrix mxAlgebra mxData mxExpectationNormal mxFitFunctionML mxModel mxRun mxCI mxFitFunctionMultigroup omxSetParameters mxCompare +#' @importFrom polycor hetcor +#' @param data_1 A n by 2 \code{data.frame} consisting of the group1 kin pairs +#' @param data_2 A n by 2 \code{data.frame} consisting of the group2 kin pairs +#' @param GroupRel A numeric vector specifying two genetic relatedness values of two groups of kin pairs +#' @param GroupR_c A numeric vector specifying two common environment correlation coefficients of two groups of kin pairs +#' @param nth A numerical value specifiying the number of thresholds +#' @param lbound A logical value indicating if a lower boundary of .0001 will be imposed to the estimated A, C and E components +#' @return Returns a \code{list} with the following: +#' \item{df_nested}{A \code{data.frame} displaying the nested comparison model between ACE, AE, CE, E models} +#' \item{fitACE}{A \code{list} of all model fit information generated from OpenMx} +#' @export + +fit_OrdACE <- function(data_1, data_2, GroupRel = c(1, .5), GroupR_c = c(1, 1), + nth = 4 + , lbound = FALSE) { + # Load Libraries & Options + # require(OpenMx) + # require(psych) + # require(polycor) + # source("miFunctions.R") + # # Create Output + # filename <- "oneACEc" + # sink(paste(filename,".Ro",sep=""), append=FALSE, split=TRUE) + + + # internal functions + fitGofS <- function(fit) { + summ <- summary(fit) + cat(paste("Mx:", fit$name," #statistics=", summ$ob," #records=", summ$nu," #parameters=", summ$es, + " #constraints=", sum(summ$cons)," df=", summ$de, " -2LL=", round(summ$Mi,4), + " cpu=", round(summ$cpu,4)," optim=", summ$op," version=", summ$mx, + " code=", fit$output$status$code, "\n",sep="")) + } + fitEstCis <- function(fit) { + print(round(fit$output$estimate,4)) + print(round(fit$output$confidenceIntervals,4)) + } + labTh <- function(lab,vars,nth) { + paste(paste("t",1:nth,lab,sep=""), + rep(vars,each=nth), + sep="") + } + # ---------------------------------------------------------------------------------------------------------------------- + # PREPARE DATA + + # nth <- nth + + # Load Data + FSData <- data_1 #in the Sim_Fit2.R function it already assigns the groups and the variable names + HSData <- data_2 + FSDataF <- mxFactor( x=FSData, levels=c(0:nth) ) + HSDataF <- mxFactor( x=HSData, levels=c(0:nth) ) + + vars <- 'Ord_' # I don't know what to do with this just yet - this is the list of variables + nv <- 1 # number of variables + ntv <- nv*2 # number of total variables + selVars <- c("Ord_1", "Ord_2") #paste(vars,c(rep(1,nv),rep(2,nv)),sep="") + + + R1 <- mxMatrix(type = "Full", nrow = 1, ncol = 1, free = FALSE, values = GroupRel[1], name = "R1") + R2 <- mxMatrix(type = "Full", nrow = 1, ncol = 1, free = FALSE, values = GroupRel[2], name = "R2") + r_c1 <- mxMatrix(type = "Full", nrow = 1, ncol = 1, free = FALSE, values = GroupR_c[1], name = "r_c1") + r_c2 <- mxMatrix(type = "Full", nrow = 1, ncol = 1, free = FALSE, values = GroupR_c[2], name = "r_c2") + + + #Descriptives + sapply(FSData,table) + sapply(HSData,table) + hetcor(FSData)$cor + hetcor(HSData)$cor + + # coeAM <- coe_am + + # covMZ <- cov(mzData, use = "pairwise") + # covDZ <- cov(dzData, use = "pairwise") + # # + # mean(rbind(mzData,dzData)[,1], na.rm = TRUE) + + nv <- 1 + ntv <- 2 + selVars1 <- colnames(FSData) + selVars2 <- colnames(HSData) + + # start values + svLTh <- 0.01 # start value for first threshold + svITh <- 1 # start value for increments + svTh <- matrix(rep(c(svLTh,(rep(svITh,nth-1)))),nrow=nth,ncol=nv) # start value for thresholds + lbTh <- matrix(rep(c(-3,(rep(0.001,nth-1))),nv),nrow=nth,ncol=nv) # lower bounds for thresholds + svPa <- .2 # start value for path coefficient + svPc <- .3 + svPe <- .4 #start value for the path coefficient e + + # variance matrix + + # if (lbound == TRUE) { + # covA <- mxMatrix(type = "Symm", nrow = nv, ncol = nv, free = TRUE, values = svVa, lbound = .0001, labels = "VA11", name = "VA") + # covC <- mxMatrix(type = "Symm", nrow = nv, ncol = nv, free = TRUE, values = svVa, lbound = .0001, labels = "VC11", name = "VC") + # covE <- mxMatrix(type = "Symm", nrow = nv, ncol = nv, free = TRUE, values = svVe, lbound = .0001, labels = "VE11", name = "VE") + # } else { + # covA <- mxMatrix(type = "Symm", nrow = nv, ncol = nv, free = TRUE, values = svVa, labels = "VA11", name = "VA") + # covC <- mxMatrix(type = "Symm", nrow = nv, ncol = nv, free = TRUE, values = svVa, labels = "VC11", name = "VC") + # covE <- mxMatrix(type = "Symm", nrow = nv, ncol = nv, free = TRUE, values = svVe, labels = "VE11", name = "VE") + # } + + + + + #PREPARE MODEL + # Create Algebra for expected Mean & Threshold Matrices + + meanG <- mxMatrix( type="Zero", nrow=1, ncol=ntv, name="meanG" ) + + thinG <- mxMatrix( type="Full", nrow=nth, ncol=ntv, free=TRUE, values=svTh, lbound=lbTh, + labels=labTh("th",vars,nth), name="thinG") + + inc <- mxMatrix( type="Lower", nrow=nth, ncol=nth, free=FALSE, values=1, name="inc" ) + + threG <- mxAlgebra( expression= inc %*% thinG, name="threG" ) + + #Create matrices for variance components + covA <- mxMatrix( type="Symm", nrow=nv, ncol=nv, free=TRUE, values=svPa, label="VA11", name="VA" ) + covC <- mxMatrix( type="Symm", nrow=nv, ncol=nv, free=TRUE, values=svPa, label="VC11", name="VC" ) + covE <- mxMatrix( type="Symm", nrow=nv, ncol=nv, free=TRUE, values=svPa, label="VE11", name="VE") #, lbound = 0.0001 ) makes it so that E isn't negative + + # Create Algebra for expected Variance/Covariance Matrices in MZ & DZ twins + covP <- mxAlgebra( expression= VA+VC+VE, name="V" ) + covFS <- mxAlgebra( expression= 0.5%x%VA+VC, name="cFS" ) + covHS <- mxAlgebra( expression= 0.25%x%VA+ VC, name="cHS" ) + expCovFS <- mxAlgebra( expression= rbind( cbind(V, cFS), cbind(t(cFS), V)), name="expCovFS" ) + expCovHS <- mxAlgebra( expression= rbind( cbind(V, cHS), cbind(t(cHS), V)), name="expCovHS" ) + + # Constrain Variance of Binary Variables + var1 <- mxConstraint( expression=diag2vec(V)==1, name="Var1" ) + + # Create Data Objects for Multiple Groups + dataFS <- mxData( observed=FSDataF, type="raw" ) + dataHS <- mxData( observed=HSDataF, type="raw" ) + + # Create Expectation Objects for Multiple Groups + expFS <- mxExpectationNormal( covariance="expCovFS", means="meanG", dimnames=selVars, thresholds="threG" ) + expHS <- mxExpectationNormal( covariance="expCovHS", means="meanG", dimnames=selVars, thresholds="threG" ) + funML <- mxFitFunctionML() + + # Create Model Objects for Multiple Groups + pars <- list(meanG, thinG,inc, threG,covA, covC, covE, covP) + modelFS <- mxModel(pars, covFS, expCovFS, dataFS, expFS, funML, name ="FS" ) + modelHS <- mxModel(pars, covHS, expCovHS, dataHS, expHS, funML, name ="HS" ) + multi <- mxFitFunctionMultigroup( c("FS","HS") ) + + # Create Algebra for Unstandardized and Standardized Variance Components + rowUS <- rep('US',nv) + colUS <- rep(c('VA','VC','VE','SA','SC','SE'),each=nv) + estUS <- mxAlgebra( expression=cbind(VA,VC,VE,VA/V,VC/V,VE/V), name="US", dimnames=list(rowUS,colUS) ) + + # Create Confidence Interval Objects + ciACE <- mxCI( "US[1,1:3]" ) + + # Build Model with Confidence Intervals + modelACE <- mxModel( "oneACEvo", pars, var1, modelFS, modelHS, multi, estUS, ciACE) + + #--------------------------------------------------------------------------------------- + # RUN MODEL + slsqp <- mxOption(NULL,"Default optimizer","SLSQP") + # Run ACE Model + fitACE <- mxTryHardOrdinal( modelACE, intervals=TRUE ) + sumACE <- summary( fitACE ) + + # Compare with Saturated Model + + #if saturated model fitted in same session + #mxCompare( fitSAT, fitACE ) + #if saturated model prior to genetic model + #lrtSAT(fitACE,4207.7738,1762) + + # Print Goodness-of-fit Statistics & Parameter Estimates + + +# fitGofs(fitACE) +# fitEstCis(fitACE) + + # ---------------------------------------------------------------------------------------------------------------------- + # RUN SUBMODELS + # Run AE model + modelAE <- mxModel( fitACE, name="oneAEvo" ) + modelAE <- omxSetParameters( modelAE, labels="VC11", free=FALSE, values=0 ) + fitAE <- mxRun( modelAE, intervals=T ) + + # fitGofs(fitAE); fitEstCis(fitAE) + + # Run CE model + modelCE <- mxModel( fitACE, name="oneCEvo" ) + modelCE <- omxSetParameters( modelCE, labels="VA11", free=FALSE, values=0 ) + modelCE <- omxSetParameters( modelCE, labels=c("VE11","VC11"), free=TRUE, values=.6 ) + fitCE <- mxRun( modelCE, intervals=TRUE ) +# fitGofs(fitCE); fitEstCis(fitCE) + + # Run E model + # modelE <- mxModel( fitAE, name="oneEvo" ) + # modelE <- omxSetParameters( modelE, labels="VA11", free=FALSE, values=0 ) + # fitE <- mxRun( modelE, intervals=T ) + # fitGofs(fitE); fitEstCis(fitE) + + # Print Comparative Fit Statistics + mxCompare( fitACE, nested <- list(fitAE, fitCE) ) # fitE commented out for now + round(rbind(fitACE$US$result,fitAE$US$result,fitCE$US$result),4) #,fitE$US$result + + #in response to one of my warnings about the optimizer having a status code 5 for modelETO + #mxCheckIdentification(modelETO, details=TRUE, nrows=2, exhaustive=FALSE, silent=FALSE) + + sumACE + + #this gives me a table with two rows and three columns - row 1 is unstandardized ACE, row 2 is standardized. + #I got this from https://openmx.ssri.psu.edu/docs/OpenMx/2.5.1/GeneticEpi_Path.html + + # Generate & Print Output + # additive genetic variance, a^2 + A <- mxEval(VA11, fitACE) + # shared environmental variance, c^2 + C <- mxEval(VC11, fitACE) + # unique environmental variance, e^2 + E <- mxEval(VE11, fitACE) + # total variance + V <- (A+C+E) + # standardized A + a2 <- A/V + # standardized C + c2 <- C/V + # standardized E + e2 <- E/V + # table of estimates + estACE <- rbind(cbind(A,C,E),cbind(a2,c2,e2)) + # likelihood of ACE model + LL_ACE <- mxEval(fitfunction, fitACE) + + + # Print Comparative Fit Statistics + + df_nested <- mxCompare(fitACE, nested <- list(fitAE, fitCE ))#fitE) commented out for now + # (rbind(fitACE$US$result,fitAE$US$result,fitCE$US$result,fitE$US$result),4) + l.modeloutput <- list(nest = df_nested, summary = sumACE) + return(l.modeloutput) +} + + diff --git a/R/kinsim_double.R b/R/kinsim_double.R index d89a250..a772b53 100644 --- a/R/kinsim_double.R +++ b/R/kinsim_double.R @@ -34,7 +34,7 @@ kinsim_double <- function(GroupNames = c("KinPair1", "KinPair2"), ace1 = c(1, 1, 1), ace2 = c(1, 1, 1), ifComb = FALSE) { - if (!ifComb) { + if (ifComb==FALSE) { df_N1 <- kinsim_single( name = GroupNames[1], Rel = GroupRel[1], @@ -52,8 +52,9 @@ kinsim_double <- function(GroupNames = c("KinPair1", "KinPair2"), ace = ace2 ) df_final <- rbind(df_N1, df_N2) - # return(df_final) + } else { + # The following code simulates two groups of kin pairs by combining MZ twins and DZ twins to achieve the required genetic relatedness (.5 0)) { + df_final <- .add_missing_and_ordinal(df_final, + GroupNames=GroupNames, + prop_missing=prop_missing) + + } + return(df_final) +} diff --git a/R/plotSim.R b/R/plotSim.R new file mode 100644 index 0000000..df3d77d --- /dev/null +++ b/R/plotSim.R @@ -0,0 +1,98 @@ +#making a function for plotting the chart in the way I want it specifically for this simulation +#calling the function plotSim + + +#its going to take results_fit list from SimFit2 +make_parameter_df <- function(results_fit, prop_missing, GroupRel, true_A, true_C, true_E) { + + table_ord <- data.frame() + table_int <- data.frame() + final_results <- data.frame() + +#use harvest functions to put the parameters into a data frame - repeat twice for ord and int results, and then rbind it + +table_ord <- harvest(results_fit, "Ordinal") %>% mutate(Analysis = "Ordinal") +table_int <- harvest(results_fit, "Interval") %>% mutate(Analysis = "Interval") +final_results <- rbind(table_ord, table_int) + +#next add in the mutation to get total variance and standardization, censorship columns, and a column with the relatedness values + +final_results <- final_results %>% mutate(TV = VA11 + VC11 + VE11, + A = VA11 / TV, + C = VC11 / TV, + E = VE11 / TV, + + censored1 = prop_missing[1], #prop missing for the first kin type, where prop_missing is a vector of two values + censored2 = prop_missing[2], + + R1 = GroupRel[1], #tells us the relatedness for pair one, where group rel is a vector with two values + R2 = GroupRel[2], #tells us relatedness of pair two + + Bias_A = true_A - A, #tells us how far off A was from the true A + Bias_C = true_C - C, #tells us how far off from the true C + Bias_E = true_E - E #tells us how far off from true E + ) %>% + + #this is the part AI thinks I should add on to make my function better - will see if thats actually the way to go or not + #this will give me a different plot option - I can graph the bias as a function of missingnes (for example) for the two analysis types + #AI was correct - this addition makes it much better and now gives me more info I need for more interesting figures + + # 3. COLLAPSE THE 10,000 ITERATIONS INTO MEAN + SE + # Group by your X-axis variable and your line color variable + + group_by(Analysis, censored1, censored2, R1, R2) %>% + mutate( + # Mean bias (this forms the continuous line) + mean_bias_A = mean(Bias_A, na.rm = TRUE), + mean_bias_C = mean(Bias_C, na.rm = TRUE), + mean_bias_E = mean(Bias_E, na.rm = TRUE), + + # Standard Error (this forms the shaded confidence band) + se_bias_A = sd(Bias_A, na.rm = TRUE) / sqrt(n()), + se_bias_C = sd(Bias_C, na.rm = TRUE) / sqrt(n()), + se_bias_E = sd(Bias_E, na.rm = TRUE) / sqrt(n())) %>% + +ungroup() + +return(final_results) #return this data frame and then use it to plot + +} + + +#I am not sure if I will do anything with this - I don't think this particular graph is all that informative for the poster given it can only show one condition at a time + +#change this so true_A, true_C, etc are flexible +# true_A <- 0.50 +# true_C <- 0.20 +# true_E <- 0.30 +# +# #plot <- +# ggplot(final_results2) + +# geom_density(aes(x = A, fill = "Additive Genetic (A)"), alpha = 0.4, color = "#9E7E38") + +# geom_density(aes(x = C, fill = "Shared Environment (C)"), alpha = 0.4, color = "#D4AF37") + +# geom_density(aes(x = E, fill = "Error (E)"), alpha = 0.4, color = "#4A4E41") + +# +# geom_vline(xintercept = true_A, color = "#9E7E38", linetype = "dashed", size = 1) + +# geom_vline(xintercept = true_C, color = "#D4AF37", linetype = "dashed", size = 1) + +# geom_vline(xintercept = true_E, color = "#4A4E41", linetype = "dashed", size = 1) + +# scale_fill_manual( +# values = c( +# "Additive Genetic (A)" = "#9E7E38", +# "Shared Environment (C)" = "#D4AF37", +# "Error (E)" = "#4A4E41")) + +# +# facet_wrap(~Analysis) + +# +# theme_minimal() + +# +# theme(axis.title.x = element_blank(), +# text = element_text(family = "Baskerville", color = "black"),#not to self turn the text to white and then its ready for poster (already has transparent background) +# panel.background = element_rect(fill = "transparent", color = NA), +# plot.background = element_rect(fill = "transparent", color = NA), +# panel.grid = element_blank(), +# axis.ticks.y = element_blank()) + +# +# labs(title = "Distribution of Simulation Results", +# subtitle = "MZs and DZs", +# y = "Density", +# fill = "Parameter Estimate") diff --git a/data-raw/Simulation.Rmd b/data-raw/Simulation.Rmd new file mode 100644 index 0000000..98d53ea --- /dev/null +++ b/data-raw/Simulation.Rmd @@ -0,0 +1,301 @@ +--- +title: "Simulation" +author: "Cailey Fay & Mason Garrison" +date: "2026-05-27" +output: html_document +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +library(OpenMx) +library(tidyr) +library(ggplot2) +library(dplyr) +library(ACEsimFit) +library(polycor) +library(purrr) +source("~/Documents/Research/Github/risky_gambling/ACEsimFit2/R/Sim_Fit2.R") +source("~/Documents/Research/Github/risky_gambling/ACEsimFit2/R/kinsim_double2.R") +source("~/Documents/Research/Github/risky_gambling/ACEsimFit2/R/fit_OrdACE.R") +source("~/Documents/Research/Github/risky_gambling/ACEsimFit2/R/Harvest.R") +source("~/Documents/Research/Github/risky_gambling/data/miFunctions.R") +source("~/Documents/Research/Github/risky_gambling/ACEsimFit2/R/Internal.R") +``` + + +```{r sibs and half sibs } +results_fit <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(2500, 2500), + nIter = 2, + SSeed = 62, + GroupRel = c(.5, .25), #this works but it changes the sample size adjustment so there are 7500 obs when I asked for 5000 + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.5, .2, .3), #other to do: fork ACEsimFit and work off my own version of the package + ace2 = c(.5, .2, .3), + prop_missing = c(.50,.50), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +table_ord <- harvest(results_fit, "Ordinal") +table_int <- harvest(results_fit, "Interval") + +final_results1 <- rbind(table_ord, table_int) +final_results1 <- final_results1 %>% mutate(TV = VA11 + VC11 + VE11, + A = VA11 / TV, + C = VC11 / TV, + E = VE11 / TV, + censored = .50 + ) %>% + select(-c("VA11","VC11","VE11","TV")) +final_results1 + +true_A <- 0.50 +true_C <- 0.20 +true_E <- 0.30 + +#plot <- +ggplot(final_results) + + geom_density(aes(x = A, fill = "Additive Genetic (A)"), alpha = 0.4, color = "#9E7E38") + + geom_density(aes(x = C, fill = "Shared Environment (C)"), alpha = 0.4, color = "#D4AF37") + + geom_density(aes(x = E, fill = "Error (E)"), alpha = 0.4, color = "#4A4E41") + + + geom_vline(xintercept = true_A, color = "#9E7E38", linetype = "dashed", size = 1) + + geom_vline(xintercept = true_C, color = "#D4AF37", linetype = "dashed", size = 1) + + geom_vline(xintercept = true_E, color = "#4A4E41", linetype = "dashed", size = 1) + + scale_fill_manual( + values = c( + "Additive Genetic (A)" = "#9E7E38", + "Shared Environment (C)" = "#D4AF37", + "Error (E)" = "#4A4E41")) + + + facet_wrap(~Analysis, ncol=1) + + + theme_minimal() + + + theme(axis.title.x = element_blank(), + text = element_text(family = "Baskerville", color = "black"),#not to self turn the text to white and then its ready for poster (already has transparent background) + panel.background = element_rect(fill = "transparent", color = NA), + plot.background = element_rect(fill = "transparent", color = NA), + panel.grid = element_blank(), + axis.ticks.y = element_blank(), + legend.position = c(0.8, 0.4)) + + + labs(title = "Distribution of Simulation Results", + subtitle = "Siblings and Half Siblings", + y = "Density", + fill = "Parameter Estimate") + +#ggsave('simresults.PNG', plot, bg = 'transparent', dpi = 300) +``` +This returns a df that will give me more plotting options (rbind it for each condition I run, and then use to graph) + +Example: generating three sets identical except they are 25%, 50%, and 75% censored +```{r} +source("~/Documents/Research/Github/risky_gambling/ACEsimFit2/R/plotSim.R") +results_fit1 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 62, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(.2,.2), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots1 <- make_parameter_df(results_fit = results_fit1, GroupRel = c(.5, 0.25), prop_missing = c(.2,.2), true_A = .6, true_C = .2, true_E = .2) + +results_fit2 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 63, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(.50,.50), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots2 <- make_parameter_df(results_fit = results_fit2, GroupRel = c(.5, 0.25), prop_missing = c(.50,.50), true_A = .6, true_C = .2, true_E = .2) + +results_fit3 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 64, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(.70,.70), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots3 <- make_parameter_df(results_fit = results_fit3, GroupRel = c(.5, 0.25), prop_missing = c(.70,.70), true_A = .6, true_C = .2, true_E = .2) + +results_fit4 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 64, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(.1,.1), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots4 <- make_parameter_df(results_fit = results_fit4, GroupRel = c(.5, 0.25), prop_missing = c(.1,.1), true_A = .6, true_C = .2, true_E = .2) + +results_fit5 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 64, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(0,0), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots5 <- make_parameter_df(results_fit = results_fit5, GroupRel = c(.5, 0.25), prop_missing = c(0,0), true_A = .6, true_C = .2, true_E = .2) + +results_fit6 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 64, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(.3,.3), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots6 <- make_parameter_df(results_fit = results_fit6, GroupRel = c(.5, 0.25), prop_missing = c(.30,.30), true_A = .6, true_C = .2, true_E = .2) + +results_fit7 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 64, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(.40,.40), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots7 <- make_parameter_df(results_fit = results_fit7, GroupRel = c(.5, 0.25), prop_missing = c(.40,.40), true_A = .6, true_C = .2, true_E = .2) + +results_fit8 <- Sim_Fit2( + GroupNames = c("FS", "HS"), + GroupSizes = c(1000, 1000), + nIter = 10, + SSeed = 64, + GroupRel = c(.5, .25), + GroupR_c = c(1, 1), + nth = 4, + mu = c(0,0), + ace1 = c(.6, .2, .2), + ace2 = c(.6, .2, .2), + prop_missing = c(.60,.60), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE) + +use_for_plots8 <- make_parameter_df(results_fit = results_fit8, GroupRel = c(.5, 0.25), prop_missing = c(.60,.60), true_A = .6, true_C = .2, true_E = .2) + + +#make one frame +plot_time <- rbind(use_for_plots1, use_for_plots2, #use_for_plots3, + use_for_plots4, #use_for_plots5, + use_for_plots6, use_for_plots7, use_for_plots8) + +#one time plot of this (practice before needing to repeat a bunch) +#I want a line for each analysis, I want x to be the prop_missingness, and I want y to be the bias, and I want three graphs - A, C, E + +ggplot(plot_time, mapping = aes(x = censored1, y = Bias_A, fill = Analysis, color = Analysis)) + + scale_color_manual(values = c("Ordinal" = "#9E7E38","Interval" = "#4A4E41")) + + scale_fill_manual(values = c("#9E7E38","#4A4E41")) + + geom_smooth() + + geom_ribbon(aes(ymin = mean_bias_A - 1.96 * se_bias_A, + ymax = mean_bias_A + 1.96 * se_bias_A), + alpha = 0.1, color = NA) + + theme_minimal() + + labs( title = "Estimation Bias of A", + x = "Proportion of Censored Cases", + y = "Deviation from Simulated Parameter") + +#C + +ggplot(plot_time, mapping = aes(x = censored1, y = Bias_C, fill = Analysis, color = Analysis)) + + scale_color_manual(values = c("Ordinal" = "#9E7E38","Interval" = "#4A4E41")) + + scale_fill_manual(values = c("#9E7E38","#4A4E41")) + + geom_smooth() + + geom_ribbon(aes(ymin = mean_bias_A - 1.96 * se_bias_A, + ymax = mean_bias_A + 1.96 * se_bias_A), + alpha = 0.1, color = NA) + + theme_minimal() + + labs( title = "Estimation Bias of C", + x = "Proportion of Censored Cases", + y = "Deviation from Simulated Parameter") + +#E + +ggplot(plot_time, mapping = aes(x = censored1, y = Bias_E, fill = Analysis, color = Analysis)) + + scale_color_manual(values = c("Ordinal" = "#9E7E38","Interval" = "#4A4E41")) + + scale_fill_manual(values = c("#9E7E38","#4A4E41")) + + geom_smooth() + + geom_ribbon(aes(ymin = mean_bias_A - 1.96 * se_bias_A, + ymax = mean_bias_A + 1.96 * se_bias_A), + alpha = 0.1, color = NA) + + theme_minimal() + + labs( title = "Estimation Bias of E", + x = "Proportion of Censored Cases", + y = "Deviation from Simulated Parameter") + +``` diff --git a/data-raw/results_fit_fshs.RData b/data-raw/results_fit_fshs.RData new file mode 100644 index 0000000..aa2d923 Binary files /dev/null and b/data-raw/results_fit_fshs.RData differ diff --git a/data-raw/simresults.PNG b/data-raw/simresults.PNG new file mode 100644 index 0000000..64323a2 Binary files /dev/null and b/data-raw/simresults.PNG differ diff --git a/man/Sim_Fit2.Rd b/man/Sim_Fit2.Rd new file mode 100644 index 0000000..ca82949 --- /dev/null +++ b/man/Sim_Fit2.Rd @@ -0,0 +1,65 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Sim_Fit2.R +\name{Sim_Fit2} +\alias{Sim_Fit2} +\title{Sim_Fit2} +\usage{ +Sim_Fit2( + GroupNames = c("KinPair1", "KinPair2"), + GroupSizes = c(100, 100), + nIter = 100, + SSeed = 22, + GroupRel = c(1, 0.5), + GroupR_c = c(1, 1), + mu = c(0, 0), + ace1 = c(1, 1, 1), + ace2 = c(1, 1, 1), + prop_missing = c(0.2, 0.2), + ifComb = FALSE, + lbound = FALSE, + saveRaw = TRUE, + Ord = TRUE, + nth = 4 +) +} +\arguments{ +\item{GroupNames}{A character vector specifying two names of the simulated kin pairs} + +\item{GroupSizes}{A numeric vector specifying two group sizes indicating the amount of kin pairs in respective group.} + +\item{nIter}{A numeric value specifying the number of iteration you want to run given the parameters assigned (i.e. the number of model fitting results you want to get)} + +\item{SSeed}{An integer specifying the starting seed of the random number. This parameter will make sure the simulated results are replicable across time} + +\item{GroupRel}{A numeric vector specifying two genetic relatedness values of the simulated kin pairs} + +\item{GroupR_c}{A numeric vector specifying two common environment correlation coefficients of the simulated kin pairs} + +\item{mu}{A numeric vector specifying two mean values for the generated variable of the kin pairs} + +\item{ace1}{A numeric vector specifying three variance components under an ACE (additive genetics, common environment, unique environment) structure for group1} + +\item{ace2}{A numeric vector specifying three variance components under an ACE (additive genetics, common environment, unique environment) structure for group2} + +\item{prop_missing}{A numeric vector specifying the percentage random missing data for kin pairs} + +\item{ifComb}{A logical value specifying the approach to achieve the required genetic relatedness value. \code{TRUE} = using combination approach. \code{FALSE} = using direct approach. (See function description for a detailed explanation of two approaches.)} + +\item{lbound}{A logical value indicating if a lower boundary of .0001 will be imposed to the estimated A, C and E components} + +\item{saveRaw}{A logical value specifying if the raw simulated data should be saved in the output list} + +\item{Ord}{a logical value specifying if the data will also be analyzed with a threshold model} + +\item{nth}{a numerical value specifying the number of thresholds, if applicable, for the threshold model +#eventually add an argument called: plot a logical value specifying if you want the density distributions of the estimates (faceted by analysis type)} +} +\value{ +Returns a two-level \code{list}. Level-one is the number of iterations. Level-two is the model fitting results and raw data (if \code{saveRaw = TRUE}) of the simulated data from the respective iteration. Level-two includes: +\item{Results}{A \code{list} including 1) A \code{data.frame} displaying the nested comparison model between ACE, AE, CE, E models and 2) A \code{list} of all model fit information generated from OpenMx} +\item{Data}{A \code{data.frame} consists of the simulated raw data} +#I need to figure out how to add in the ord results as part of the return +} +\description{ +A function to simulate a set of kin pair data and fit them with ACE models. Can be helpful with checking model performance for a given parameter setting. +} diff --git a/man/dot-add_missing.Rd b/man/dot-add_missing.Rd new file mode 100644 index 0000000..45fd1e1 --- /dev/null +++ b/man/dot-add_missing.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Internal.R +\name{.add_missing} +\alias{.add_missing} +\title{add missing} +\usage{ +.add_missing(df, GroupNames, prop_missing) +} +\arguments{ +\item{df}{A data frame containing the simulated data with columns 'GroupName', 'y1', and 'y2'.} + +\item{GroupNames}{A character vector of length 2 specifying the group names corresponding to the two groups in the data frame.} + +\item{prop_missing}{A numeric vector of length 2 specifying the proportion of missing values +for each group. The first element corresponds to the first group in GroupNames, and the second element corresponds to the second group.} +} +\value{ +A modified data frame with missing values added to 'y1' and 'y2' according to the specified proportions, and new ordinal columns 'Ord_1' and 'Ord_2' added based on the cutpoints applied to 'y1' and 'y2 respectively. +} +\description{ +Internal function to add missingness to the simulated data frame. +} +\details{ +Apply random missingness by GroupName (not by R value, which breaks when groups share the same relatedness), +} diff --git a/man/dot-add_missing_and_ordinal.Rd b/man/dot-add_missing_and_ordinal.Rd new file mode 100644 index 0000000..743de47 --- /dev/null +++ b/man/dot-add_missing_and_ordinal.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Internal.R +\name{.add_missing_and_ordinal} +\alias{.add_missing_and_ordinal} +\title{add_missing_and_ordinal} +\usage{ +.add_missing_and_ordinal(df, GroupNames, prop_missing) +} +\arguments{ +\item{df}{A data frame containing the simulated data with columns 'GroupName', 'y1', and 'y2'.} + +\item{GroupNames}{A character vector of length 2 specifying the group names corresponding to the two groups in the data frame.} + +\item{prop_missing}{A numeric vector of length 2 specifying the proportion of missing values +for each group. The first element corresponds to the first group in GroupNames, and the second element corresponds to the second group.} +} +\value{ +A modified data frame with missing values added to 'y1' and 'y2' according to the specified proportions, and new ordinal columns 'Ord_1' and 'Ord_2' added based on the cutpoints applied to 'y1' and 'y2 respectively. +} +\description{ +add_missing_and_ordinal +} +\details{ +Applies random missingness to the 'y1' and 'y2' columns of the input data frame based on the specified proportions for each group, and +then compute 4-category ordinal columns. +Cutpoints: (-Inf, -2] = 1, (-2, -1] = 2, (-1, 1) = 3, [1, Inf) = 4. +NA y values produce NA ordinal scores; missingness is cascaded from y1 to y2. +} diff --git a/man/fit_OrdACE.Rd b/man/fit_OrdACE.Rd new file mode 100644 index 0000000..8ba6bf6 --- /dev/null +++ b/man/fit_OrdACE.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/fit_OrdACE.R +\name{fit_OrdACE} +\alias{fit_OrdACE} +\title{fit_OrdACE} +\usage{ +fit_OrdACE( + data_1, + data_2, + GroupRel = c(1, 0.5), + GroupR_c = c(1, 1), + nth = 4, + lbound = FALSE +) +} +\arguments{ +\item{data_1}{A n by 2 \code{data.frame} consisting of the group1 kin pairs} + +\item{data_2}{A n by 2 \code{data.frame} consisting of the group2 kin pairs} + +\item{GroupRel}{A numeric vector specifying two genetic relatedness values of two groups of kin pairs} + +\item{GroupR_c}{A numeric vector specifying two common environment correlation coefficients of two groups of kin pairs} + +\item{nth}{A numerical value specifiying the number of thresholds} + +\item{lbound}{A logical value indicating if a lower boundary of .0001 will be imposed to the estimated A, C and E components} +} +\value{ +Returns a \code{list} with the following: +\item{df_nested}{A \code{data.frame} displaying the nested comparison model between ACE, AE, CE, E models} +\item{fitACE}{A \code{list} of all model fit information generated from OpenMx} +} +\description{ +Use OpenMx to quickly fit a univariate Ordinal ACE model +} diff --git a/man/harvest.Rd b/man/harvest.Rd new file mode 100644 index 0000000..f306125 --- /dev/null +++ b/man/harvest.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Harvest.R +\name{harvest} +\alias{harvest} +\title{Harvest results from MCMCglmm analyses} +\usage{ +harvest(results_fit, type) +} +\arguments{ +\item{results_fit}{A list of model fitting results generated from \code{Sim_Fit2}. This list should have two sub-lists: one for "Interval" model results and one for "Ordinal" model results. Each sub-list should contain the fitting results for each iteration (e.g., "Iteration1", "Iteration2", etc.).} + +\item{type}{A character string specifying the type of model results to extract. Should be +either "Interval" for the interval model results or "Ordinal" for the ordinal model results.} +} +\value{ +Returns a \code{data.frame} with the following columns: +\item{Iteration}{The iteration name (e.g., "Iteration1", " +Iteration2", etc.)} +\item{Analysis}{The type of analysis ("Interval" or "Ordinal")} +\item{VA11}{The estimated additive genetic variance component (A) for the +first group of kin pairs} +\item{VC11}{The estimated common environmental variance component (C) for the +first group of kin pairs} +\item{VE11}{The estimated unique environmental variance component (E) for the +first group of kin pairs} +} +\description{ +A function to extract the A, C, E estimates from the model +fitting results of the MCMCglmm analyses. This function is designed to work with the output of \code{Sim_Fit2}, which includes both interval and ordinal model fitting results. +} diff --git a/man/kinsim_double2.Rd b/man/kinsim_double2.Rd new file mode 100644 index 0000000..b70b3d4 --- /dev/null +++ b/man/kinsim_double2.Rd @@ -0,0 +1,58 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/kinsim_double2.R +\name{kinsim_double2} +\alias{kinsim_double2} +\title{kinsim_double2} +\usage{ +kinsim_double2( + GroupNames = c("KinPair1", "KinPair2"), + GroupSizes = c(100, 100), + GroupRel = c(1, 0.5), + GroupR_c = c(1, 1), + mu = c(0, 0), + ace1 = c(1, 1, 1), + ace2 = c(1, 1, 1), + prop_missing = c(0.2, 0.2), + ifComb = FALSE +) +} +\arguments{ +\item{GroupNames}{A character vector specifying two names of the simulated kin pairs} + +\item{GroupSizes}{A numeric vector specifying two group sizes indicating the amount of kin pairs in respective group.} + +\item{GroupRel}{A numeric vector specifying two genetic relatedness values of the simulated kin pairs} + +\item{GroupR_c}{A numeric vector specifying two common environment correlation coefficients of the simulated kin pairs} + +\item{mu}{A numeric vector specifying two mean values for the generated variable of the kin pairs} + +\item{ace1}{A numeric vector specifying three variance components under an ACE (additive genetics, common environment, unique environment) structure for group1} + +\item{ace2}{A numeric vector specifying three variance components under an ACE (additive genetics, common environment, unique environment) structure for group2} + +\item{prop_missing}{A numeric vector specifying the percentage random missing data for kin pairs} + +\item{ifComb}{A logical value specifying the approach to achieve the required genetic relatedness value. \code{TRUE} = using combination approach. \code{FALSE} = using direct approach. (See function description for a detailed explanation of two approaches.)} +} +\value{ +Returns \code{data.frame} with the following: +\item{GroupName}{group name of the kin pairs} +\item{R}{level of relatedness for the kin pair} +\item{r_c}{level of common envrionment correlation of the kin pairs} +\item{id}{id} +\item{A1}{Additive genetic component for kin1 of the kin pairs} +\item{A2}{Additive genetic component for kin2 of the kin pairs} +\item{C1}{shared-environmental component for kin1 of the kin pairs} +\item{C2}{shared-environmental component for kin2 of the kin pairs} +\item{E1}{non-shared-environmental component for kin1 of the kin pairs} +\item{E2}{non-shared-environmental component for kin2 of the kin pairs} +\item{y1}{generated variable i for kin1} +\item{y2}{generated variable i for kin2} +} +\description{ +The function to generate two groups of univariate kin pair(e.g., both MZ and DZ twins) data using a multivariate norm approach, given the ACE components. +\cr +\cr +Two approaches can be selected: a) simulate two groups of kin pairs using the genetic relatedness directly b) simulate two groups of kin pairs by combining MZ twins and DZ twins to achieve the required genetic relatedness (.5