# Error in Regression but I don't think there is collinearity: "PosDefException: matrix is not positive definite; Cholesky factorization failed."

**URL:** https://discourse.julialang.org/t/error-in-regression-but-i-dont-think-there-is-collinearity-posdefexception-matrix-is-not-positive-definite-cholesky-factorization-failed/56689
**Category:** New to Julia
**Tags:** dataframes, glm
**Created:** [March 7, 2021, 4:51pm UTC](https://discourse.julialang.org/t/error-in-regression-but-i-dont-think-there-is-collinearity-posdefexception-matrix-is-not-positive-definite-cholesky-factorization-failed/56689 "2021-03-07T16:51:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![samerb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samerb/32/9242_2.png) [@samerb](https://discourse.julialang.org/u/samerb)
#### Post date: [March 7, 2021, 4:51pm UTC](https://discourse.julialang.org/t/error-in-regression-but-i-dont-think-there-is-collinearity-posdefexception-matrix-is-not-positive-definite-cholesky-factorization-failed/56689/1 "2021-03-07T16:51:55Z")

</div>

“PosDefException: matrix is not positive definite; Cholesky factorization failed.”

I am getting the above error when I try to do certain regressions such as the one below involving interaction terms involving some binary variables. Is this reflecting a multicolinearity (i.e. non-full rank) issue with the matrix of regressors? I think the regressors are of full rank, so I don’t know what the problem is. I also don’t know how to check whether they are of full rank. I don’t know how to reproduce this with a minimal example.

```julia
using GLM
sm = GLM.lm( @formula(inspection ~ DAV+
        + lag_violator_notHPV_DAV + lag_HPV_status_DAV), df)

```
