Ahoy. I am attempting to estimate a copula using the ml method. So far
my margins will run using separate programs, but my copulas always fail
in finding starting values. I can't seem to make it recognise initial
values from the marginal analyses (or it does but it doesn't help),
there are no missing values and I belive all of the syntax is correct.
I've included the code below (for the simplest of the copulas) and a
portion of the output. I'd appreciate any advice at this point, nothing
is working. Also, both the lf and d0 methods get me to this point but
collapse at the feasibility part. I've also moved my scalars from
tempvars to tempnames, but with no change.
quietly {
gen double `fdist' = normal(($ML_y1-`theta1')/`theta2')
gen double `fdens' = normalden($ML_y1,`theta1',`theta2')
gen double `gdist' = normal(($ML_y2-`theta3')/`theta4')
gen double `gdens' = normalden($ML_y2,`theta3',`theta4')
gen double `fgm' = `fdens'*`gdens'*(1-`theta5'*(1-2*`fdist')*(1-2*`gdist'))
mlsum `lnfj' =
ln(`fdens')+ln(`gdens')+ln(1+`theta5'*(1-2*`fdist')*(1-2*`gdist'))
}
end
ml model d0 model2 (theta1: Tcost = xx_age) (theta2:) (theta3: Tqaly =
r_bmi) (theta4:) (theta5:)
ml check
ml search
ml maximize
ml display
Output is okay until: (can somebody help with the likely meaning of
"broken", also?)
. ml check
Test 1: Calling model2 to check if it computes log likelihood and
does not alter coefficient vector...
Passed.
Test 2: Calling model2 again to check if the same log likelihood value
is returned...
Passed.
------------------------------------------------------------------------------
The initial values are not feasible. This may be because the initial values
have been chosen poorly or because there is an error in model2 and it
always returns missing no matter what the parameter values.
Stata is going to use ml search to find a feasible set of initial values.
If model2 is broken, this will not work and you will have to press Break
to make ml search stop.
Searching...
initial: log likelihood = -<inf> (could not be evaluated)
searching for feasible values
.........................................................................
>
.....................................................................................................
>
.....................................................................................................
could not find feasible values
r(491);