I am trying to find the coefficients of a system of linear regression equations defined as y = b*X + ε, where ε ~ N(0,s^2). The coefficients are to be constrained so that each b_i is between 0 and 1 and sum(b_i) = 1. To do this we are trying to define w = exp(b) / sum(exp(b)) and then solve for w. Inside my linregeval() function I make this transformation, obtain the X (data) matrix from userinfo, then set the likelihood equal to lnnormalden(y, X*w’, sqrt(p2)), where p2 is the variance parameter.
When I run moptimize() it fails in “Iteration 1” for “flat or discontinuous region encountered” and the likelihood value does not change upon each sub-iteration (each time linregeval() is called within “Iteration 1”). The value of b also doesn’t change, but if I print p1 (obtained from util_xb) it appears to update on each call to linregeval(). However, I can’t obtain b from p1 since this would involve “dividing out” the X matrix.
Is there any way to solve this problem?
Related Posts with Imposing nonlinear constraint in moptimize()
Retrieving data from online archive database and making it ready for STATA (CEDA Archive database) THERE MUST BE SOMEONE HERE WHO IS ABLE TO DO THIS Hi everyone, I'm in a bit of a pickle. I have …
Problem with number of instrument with xtabond2Hello everyone, I am just new to managing panel series and I am working on the investigation of fina…
Necessary co-variate omitted due to collinearityHi everyone, I had a quick question. I am new to Stata, so please forgive me if this question seems…
Whether coefficients of before clustering and after clustering in using reg command is strange?Hi all, Today I run a simple reg for a panel dataset with a panel of units and time periods , I con…
Export adjusted ratios from dstdize commandDear all, Really appreciate if someone could kindly help me. I'm using Code: dstdize command to ca…
Subscribe to:
Post Comments (Atom)
0 Response to Imposing nonlinear constraint in moptimize()
Post a Comment