Hello everyone,
I am estimating a model where one of the parameters is a probability, hence its domain is [0,1]. I am struggling to find an effective way to "tell" the ml commands to only search within this domain.
There is a bound option, yet it is poorly documented in ml.pdf (page 14). For example, how does one specify multiple parameters in the same equation? In any case, the utility of the option is not clear given that it only applies to search (and not to the maximization).
Another suggestion (provided here) is to use a transformation that maps the real line to the desired interval. In this case, I used exp(x)/(1+exp(x)). However, this is not a neutral choice, as it "stretches" the space close to the bounds. In my case this leads to non-convergence behavior in those areas, or it does converge to what looks like a local maximum.
I've also tried to ad-hoc add large negative terms to the likelihood if the test parameter is outside the range, but I ran into several errors that suggest that this is a poor way to go ahead. One error was (check's TEST 1 failed because "Two different coefficient vectors resulted in equal log likelihood values"). Another error was that search could not find feasible values.
Any suggestions welcome. Thank you!
The model is a simple probit with a cap on the maximum probability:
I am estimating a model where one of the parameters is a probability, hence its domain is [0,1]. I am struggling to find an effective way to "tell" the ml commands to only search within this domain.
There is a bound option, yet it is poorly documented in ml.pdf (page 14). For example, how does one specify multiple parameters in the same equation? In any case, the utility of the option is not clear given that it only applies to search (and not to the maximization).
Another suggestion (provided here) is to use a transformation that maps the real line to the desired interval. In this case, I used exp(x)/(1+exp(x)). However, this is not a neutral choice, as it "stretches" the space close to the bounds. In my case this leads to non-convergence behavior in those areas, or it does converge to what looks like a local maximum.
I've also tried to ad-hoc add large negative terms to the likelihood if the test parameter is outside the range, but I ran into several errors that suggest that this is a poor way to go ahead. One error was (check's TEST 1 failed because "Two different coefficient vectors resulted in equal log likelihood values"). Another error was that search could not find feasible values.
Any suggestions welcome. Thank you!
The model is a simple probit with a cap on the maximum probability:
Code:
cap program drop myprobit program myprobit version 13 args lnf theta1 theta2 tempvar probs qui gen double `probs' = exp(`theta2')/(1+exp(`theta2')) quietly replace `lnf' = ln(`probs'*normal(`theta1')) if $ML_y1==1 quietly replace `lnf' = ln(1 - `probs'*normal(`theta1')) if $ML_y1==0 end ml model lf myprobit (binaryyvar = depvar depvar2) () ml check ml search, repeat(150) ml maximize, difficult iterate(50)
Comment