Dear all,
I am using Stata SE 17.0, update level 13 Feb 2024. I found that the mvnormal-family commands, e.g., mvnormal(), mvnormalqp(), occasionally produce missing values. Here is an example:
It seems that this issue occurs not because the upper limits are too extreme. As can be seen from the examples below, both MoreExtremeU and LessExtremeU work just fine. mvnormalqp() returns non-missing results.
So far I have only found this issue when the theoretical result is close to 0, but I am not sure if the same issue would occur when the result is close to 1, so I am still hesitating over whether I should replace all missing values with zero or not.
I use mvnormalqp() to write my maximum likelihood estimation model (a lf-type evaluator programmed in Mata and used in Stata command "ml model"). I also use mvnormalqp() to write my post-estimation predict programme, which is then automatically used in the official command margins. Therefore, my questions are:
1) Is there any way to avoid mvnormalqp() generating missing values?
2) Does the missing-value issue of mvnormalqp() matter to the estimation of ml model and margins? I know that ml model with a lf-type evaluator has some protection against missing values in the log-likelihood function, but does margins do similar protection too?
Thank you.
Chi-lin
I am using Stata SE 17.0, update level 13 Feb 2024. I found that the mvnormal-family commands, e.g., mvnormal(), mvnormalqp(), occasionally produce missing values. Here is an example:
Code:
m: U =0, 5, 5, -10 //upper limits m: R =1, 0, 0, 0, 1, .5, .5, 1, .5, 1 //vectorized correlation matrices m: mvnormal(U, R) //returns a missing value . m: mvnormalqp(U, R, 5000) //returns a missing value, even if the maximum number of quadrature points is specified .
It seems that this issue occurs not because the upper limits are too extreme. As can be seen from the examples below, both MoreExtremeU and LessExtremeU work just fine. mvnormalqp() returns non-missing results.
Code:
m: R =1, 0, 0, 0, 1, .5, .5, 1, .5, 1 m: MoreExtremeU =0, 5, 5, -10-1 m: mvnormalqp(MoreExtremeU, R, 5000) 6.89514e-60 m: LessExtremeU =0, 5, 5, -10+1 m: mvnormalqp(LessExtremeU, R, 5000) 3.20780e-20
So far I have only found this issue when the theoretical result is close to 0, but I am not sure if the same issue would occur when the result is close to 1, so I am still hesitating over whether I should replace all missing values with zero or not.
I use mvnormalqp() to write my maximum likelihood estimation model (a lf-type evaluator programmed in Mata and used in Stata command "ml model"). I also use mvnormalqp() to write my post-estimation predict programme, which is then automatically used in the official command margins. Therefore, my questions are:
1) Is there any way to avoid mvnormalqp() generating missing values?
2) Does the missing-value issue of mvnormalqp() matter to the estimation of ml model and margins? I know that ml model with a lf-type evaluator has some protection against missing values in the log-likelihood function, but does margins do similar protection too?
Thank you.
Chi-lin
Comment