Obsidian | Level 7

## Proc NLMIXED Covariance and Correlation

I have been trying a few different models with different functions but NB distribution. However, in one of the functions that I use, in my results, I get covariance matrix and correlation matrix of parameter estimates even though I did not use CORR or COV function.

What could possibly be the reason for me to obtain such output in one function but not in others? Attached is the output.

Is there any statistical problem in the function?

Any form of help would be highly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: Proc NLMIXED Covariance and Correlation

> What could possibly be the reason for me to obtain such output in one function but not in others?

> Is there any statistical problem in the function?

That is an interesting question. I am not 100% sure, but based on some testing I believe that the COV/CORR matrices will be displayed when

1. The model converges, but

2. The Hessian at the solution "has a problem."

Thus when they print, the procedure is encouraging you to look closely at the solution. There is something unusual about it.

The "problem" might be that it is not positive definite or that it is not invertible.

In my tests, one situation where I see the COV/CORR matrices when I am doing a constrained optimization and the optimal solution is on the boundary of the constraint region. In that case, the optimal solution is not a point where the gradient vanishes, and so the Hessian at the solution might not be positive definite.

4 REPLIES 4
SAS Super FREQ

## Re: Proc NLMIXED Covariance and Correlation

> What could possibly be the reason for me to obtain such output in one function but not in others?

> Is there any statistical problem in the function?

That is an interesting question. I am not 100% sure, but based on some testing I believe that the COV/CORR matrices will be displayed when

1. The model converges, but

2. The Hessian at the solution "has a problem."

Thus when they print, the procedure is encouraging you to look closely at the solution. There is something unusual about it.

The "problem" might be that it is not positive definite or that it is not invertible.

In my tests, one situation where I see the COV/CORR matrices when I am doing a constrained optimization and the optimal solution is on the boundary of the constraint region. In that case, the optimal solution is not a point where the gradient vanishes, and so the Hessian at the solution might not be positive definite.

Obsidian | Level 7

## Re: Proc NLMIXED Covariance and Correlation

Hi Rick,

So these were the notes in the Log file

NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: At least one element of the gradient is greater than 1e-3.
NOTE: Moore-Penrose inverse is used in covariance matrix.
WARNING: The final Hessian matrix is not positive definite, and therefore the estimated covariance
matrix is not full rank and may be unreliable. The variance of some parameter estimates is
zero or some parameters are linearly related to other parameters.

I came across an article which says that when above warning appears the results are not reliable. What are alternatives or other approaches to run the model without such errors?

SAS Super FREQ

## Re: Proc NLMIXED Covariance and Correlation

Your article should have mentioned that lack of convergence often indicates that the model does not fit the data. So alternatives to "run the model without such errors" include

1. Choose a model that fits the data better

2. Get more data, if the sample size is very small

Obsidian | Level 7

## Re: Proc NLMIXED Covariance and Correlation

Thank you.

Discussion stats
• 4 replies
• 2729 views
• 2 likes
• 2 in conversation