Dear Statalisters,
Here is my problem:
[CODE]
Are you aware of any implementation of algorithms to compute the nearest positive definite matrix (to an approximate one) in Stata? Any tips/suggestions are very much appreciated.
All the best,
Tiago
Here is my problem:
[CODE]
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double(y1 y2 y3 V11 V22 V33 V12 V13 V23) .026383349697260604 .12976520542009573 .24293224436300737 .0008748842993677882 .0005412437445877245 .0020661462350592126 .00030152317645533867 .00020717540851181314 .0002147076486284315 .16672760556617316 -.03071545716172275 -.15278090694110302 .0026170399755727314 .0017630378967933304 .004162395980374229 .0007982445099144358 .0006579982281102412 .0006783226262312874 .18870618718253707 .07827002832983285 -.5083775696283495 .009003455824558866 .006674393764124837 .015503895865096649 .0028066743454998695 .0021764046251487243 .0026094379132329732 -.24861908809077787 .1958184287474064 -.06210259287116862 .024355964092499592 .007780704202271271 .01752038893093712 .0032648982435753175 .0032889470632104746 .0034581980175482888 end
Code:
meta mvregress y1 y2 y3, wcovvariables(V11 V12 V22 V33 V13 V23)
covariance matrix not positive definite
Within-study covariance matrix in study 1 defined by variables V11 V12 V22 V33 V13
V23 not positive definite
Within-study covariance matrix in study 1 defined by variables V11 V12 V22 V33 V13
V23 not positive definite
Are you aware of any implementation of algorithms to compute the nearest positive definite matrix (to an approximate one) in Stata? Any tips/suggestions are very much appreciated.
All the best,
Tiago
Comment