-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
MixtCompConcern the C++ libraryConcern the C++ libraryRMixtCompIOConcern the RMixtCompIO package: R interface of the C++ libraryConcern the RMixtCompIO package: R interface of the C++ library
Description
library(RMixtComp)
dat = readRDS("bugdata.rds")
algo <- createAlgo(nInitPerClass = 1000)
model = list(molybdène = "Gaussian")
res <- mixtCompLearn(dat, model, algo, nClass = 1:3, nRun = 2, criterion = "ICL")
an R error is generated:
Error in res[[indMax]] :
attempt to select less than one element in get1index
3.
rmcMultiRun(algo, dataList, model, list(), nRun, nCore, verbose) at MIXTCOMP_mixtCompLearn.R#396
2.
classicLearn(data, model, algo, nClass, criterion, nRun, nCore,
verbose, mode) at MIXTCOMP_mixtCompLearn.R#283
1.
mixtCompLearn(datMC[datMC$Racine == "ELE100", ], model, algo,
nClass = 1:10, nRun = 10, criterion = "ICL")
the error comes from in RMixtCompIO:
logLikelihood <- sapply(res, function(x) {ifelse(is.null(x$warnLog), x$mixture$lnObservedLikelihood, -Inf)})
indMax <- which.max(logLikelihood)
return(res[[indMax]])
If all warnlog are null then logLikelihood
should be a vector of -Inf
and this should not generate an error for which.max
Metadata
Metadata
Assignees
Labels
MixtCompConcern the C++ libraryConcern the C++ libraryRMixtCompIOConcern the RMixtCompIO package: R interface of the C++ libraryConcern the RMixtCompIO package: R interface of the C++ library