% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PMutilities.R
\name{pos_def}
\alias{pos_def}
\title{Check if a matrix is positive definite}
\usage{
pos_def(mat, id, source)
}
\arguments{
\item{mat}{A covariance matrix to check.}
}
\value{
A positive definite covariance matrix, 1 if aborting, or -1 if unable to fix
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}
Checks if a matrix is positive definite and attempts to fix it if necessary.
}
\author{
Michael Neely
}
\keyword{internal}
