Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error message when applying cholesky decomposition for random draws

    Hello,
    I am trying to estimate parameters of a utility function throu Simulated Maximum Likelihood.
    My programe is showing an error message ""too few variables specified"... (image below) after ml check when I try to generate random draws through cholesky decomposition:
    My sintax is:
    ...
    . matrix W = (`sigma1' , `cov12' , `cov13' \ `cov12' , `sigma2' , `cov23' \ `cov13' , `cov23' , `sigma3')
    . capture matrix U = cholesky(W)
    . if _rc != 0 {
    . di "Warning: cannot do Cholesky factorization of rho matrix"
    . }
    . local l11=U[1,1]
    . local l21=U[2,1]
    . local l31=U[3,1]
    . local l22=U[2,2]
    . local l32=U[3,2]
    . local l33=U[3,3]
    . forvalues r = 1/100{
    . qui {
    . gen double `random1' = randomc1_`r'*`l11'
    HERE ml check shows the error message "too few variables specified"

    . gen double `random2' = randomc2_`r'*`l22' + randomc1_`r'*`l21'
    . gen double `random3' = randomc3_`r'*`l33' + randomc2_`r'*`l32' + randomc1_`r'*`l31'

    MY SINTAX IS AN ADAPTATION OF PROFESSORS HAAN & UHLENDORFFF' "Estimation of Multinomial Logit Models with Unobserved Heterogeneity Using Maximum Simulated Likelihood"

    I am confused because I don't know the exact reason of this message.
    If any colleague could help me I would thank him a lot.
    Best wishes,
    Ernesto

  • #2
    "Rodriguetti": you are not maximizing your chances of receiving helpful replies because you are not following Forum etiquette in several respects. You need to give full references to articles (you only give a partial one) -- how else is our multidisciplinary membership going to know what you're referring to or indeed be able to access it? [My guess is that you're referring to an article in volume 6 issue 2 of the Stata Journal, freely downloadable from the SJ website -- but I may be wrong.] Also please use CODE delimiters to report Stata output (this is important for legibility; it uses a fixed font). Also, report exactly what Stata shows, not your transcription -- details can matter. In addition, please re-register to use your full name (firstname lastname) here -- it's easy to do: hit the Contact Us link in the blue bar below, and make your request. All of these issues are discussed in the FAQ, which I would ask you to re-read in full. Thank you.

    My guess is that you have not defined the "randomc1_`r'" or "`l11' " variables correctly elsewhere in your program. But then you don't show your complete program, so one can only guess.

    Comment

    Working...
    X