How to Fix Error in chol.defalt(cov): leading minor of order 2 is not positive definite

I'm trying to put a gate on my scatter plot, but I'm running to the error: "Error in chol.default(cov) : the leading minor of order 2 is not positive definite"
I don't know what it means and I'm having trouble finding resources to understand it.

Here's my code!

meantBB<- c("BL1.H"=9, "BL3.H"=9)
cov <- matrix(c(7.5,7.9,9,10.5), ncol = 2, dimnames=list(c("BL1.H", "BL3.H"), c("BL1.H", "BL3.H")))

GateBB<- ellipsoidGate(.gate = cov,
                      mean = meantBB,
                      distance = 1,
                      filterId = "test gate")
ps_rose.0t <- ggcyto::ggcyto(InFCS_ta[rose.0], aes(x = `BL3.H`, y = `BL1.H`)) + 
  geom_hex(bins = 300) +
    theme(axis.text = element_text(size = 12),
        axis.title = element_text(size = 12),
        strip.background = element_rect(colour="white", fill="white"),
        panel.border = element_rect(colour = "white"))+
  geom_gate(GateBB, col = "#CB0001", fill = "ffa401", alpha = 0.8, size = 1)
plot(ps_rose.0t, echo = FALSE)


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.