title: Matrix doesn't pass as positive definite
body: <p>I have a 4x4 matrix which I believe should pass as positive definite however using is.positive.definite(), it is evaluating to false. When I use nearPD() to compute the nearest positive definite matrix, the resulting matrix evaluates as positive definite with is.positive.definite(), but looks the same.</p>
  
  <p>The matrix looks like this</p>
  
  <pre><code> 1 1 0 0
   1 1 0 0
   0 0 1 1
   0 0 1 1
  </code></pre>
  
  <p>Where x'Mx should evaluate to (x1+x2)^2 + (x3+x4)^2 which seems to satisfy the positive definite condition.</p>
  
  <p>Anyway, here is the code. Does anyone know if there is anything I am missing here?</p>
  
  <pre><code>library(Matrix)
  library(matrixcalc)
  
  D = rbind(c(1,1,0,0),c(1,1,0,0),c(0,0,1,1),c(0,0,1,1))
  
  ##evaluates false
  is.positive.definite(D)
  
  d = nearPD(D)$mat
  d = matrix(d, nrow = 4)
  
  ## looks the same as D
  d
  
  ##but evaluates to positive definite
  is.positive.definite(d)
  </code></pre>