Open igorkf opened 1 year ago
To overcome this problem I did a try-catch approach to fit the model until it works:
fit_model <- function() {
mod <- Multitrait(...) # your arguments here
return(mod)
}
run <- function() {
mod <- T
while (is.list(mod) == F) {
mod <- tryCatch({fit_model()}, error = function(e) { return(TRUE) })
}
return(mod)
}
set.seed(2023)
mod <- run()
Seems overkill but it works in the first 2 or 3 tries.
Hello Igor,
Thanks for sharing the details of the problem and the hints for the solutions,
Best regards.
On Thu, Jul 20, 2023 at 2:52 PM Igor Kuivjogi Fernandes < @.***> wrote:
To overcome this problem I did a try-catch approach to fit the model until it works:
fit_model <- function() { mod <- Multitrait(...) # your arguments here return(mod) }
run <- function(x) { success <- FALSE while (!success) { success <- tryCatch({fit_model()}, error = function(e) { return(FALSE) }) } return(success) }
set.seed(2023) mod <- run()
Seems overkill but it works in the first few tries.
— Reply to this email directly, view it on GitHub https://github.com/gdlc/BGLR-R/issues/73#issuecomment-1644589932, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3ARLSDL5XHRTJCLN5BZQTXRGLAZANCNFSM6AAAAAA2R5A3YI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi, thanks for the BGLR package!
I'm trying to fit an FA1 model, but sometimes I get this error:
Curiously, if I try to run a couple of times, the model works, so I suppose it could be to a random initialization.
After looking for this error, I saw this post in StackOverflow: https://stackoverflow.com/questions/41146141/error-in-factor-analysis-starting-values
Does it make sense to increase the number of starting values or give us the option to change the lower bound?
The documentation of
factanal
saysnstart = 1
andlower = 0.005
.Thanks!