SachaEpskamp / psychonetrics

An R package for Network Psychometrics
43 stars 5 forks source link

panelgvar - non-positive definie matrix #10

Closed grossmania closed 1 year ago

grossmania commented 3 years ago

Dear Sacha,

As I mentioned on Facebook – I am a big fan of your work and would love to apply the method you and other colleagues have developed to the study of wisdom. I have a 4 wave, year-long dataset. Each wave participants report on intellectual humility, openmindedness to change, perspective-taking, distancing, willingness to compromise in reflection on a major adverse experience from the last 3 months. I want to examine trait, state, and lagged association in the network of these components, and your panelgvar function from psychonetrics seems a great fit here. The dataset has 341 participants who completed at least two waves (I filtered out those who did only one wave). Of these, 325 completed the first wave (some started at the wave 2), 277 completed second wave, 273 completed third wave, and 184 completed four waves (smaller because some started at wave 2 and only had to go till wave 3).

). As you can see in my code, I tried to create the covMat and the design matrices following the examples you outlined. I attach both the code I used to create the covMat and the analyses code, along with the covMat file I created here. When I tried to run it, I get the message “ The optimizer encountered at least one non-positive definite matrix and used a pseudoinverse in parameter estimation. Results may not be accurate.” I rerun it with each optimizer and the message remains (plus extra warnings, depending on optimizer). Results also look wonky depending on which optimizer I use. Grossmann.zip

Any advice here?

Huge thanks in advance!

Igor

selimsametoglu commented 3 years ago

I receive the same error no matter which optimizer I use ( “ The optimizer encountered at least one non-positive definite matrix and used a pseudoinverse in parameter estimation. Results may not be accurate.”).

Also, the same problem persisted even when I used your (Sacha's) tutorial StarWars data and the models that were described here: http://sachaepskamp.com/files/psychonetrics_networkAnalysis.pptx.

best,

Selim

SachaEpskamp commented 3 years ago

The warning “ The optimizer encountered at least one non-positive definite matrix and used a pseudoinverse in parameter estimation. Results may not be accurate.” can safely be ignored if the parameters look ok (e.g. no partial correlations of 1/-1). I would use the nlminb optimizer, it works the best.

bbailey1451 commented 2 years ago

Hi there! I am experiencing the same issue with my data. I get relative convergence with nlminb, and non-convergence with ucminf. In addition to the warning message reported here, I am also receiving the following message using nlminb:

2: In runmodel(.) One or more parameters were estimated to be near its bounds. This may be indicative of, for example, a Heywood case, but also of an optimization problem. Interpret results and fit with great care. For unconstrained estimation, set bounded = FALSE.

Taking a look at the parameters, I have found one case of a -1 partial correlation in the between subject estimates (omega_zeta_between). This estimate is non-significant and therefore will be pruned. Furthermore, the model is showing acceptable fit (RMSEA = .05).

My question is whether I should go forward with interpreting this model. Should I be especially cautious interpreting all resulting networks or just the between subject network given that is where the problematic parameter appeared to be? Thanks as always for the support!

SachaEpskamp commented 1 year ago

If the between person network is including questionable estimates, it is better to use a Cholesky decomposition to model the between subject variance--covarince matrix using between_latent = "chol" and not substantively interpret the between-person network structure.