Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: feasible values with ml - copulas


From   Casey Quinn <[email protected]>
To   [email protected]
Subject   st: feasible values with ml - copulas
Date   Mon, 29 Aug 2005 18:54:10 +0100

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.

program model2
version 8.1
args todo b lnfj
tempvar fdist theta1 theta2 fdens gdist theta3 theta4 gdens fgm theta5
mleval `theta1' = `b', eq(1)
mleval `theta2' = `b', eq(2) scalar
mleval `theta3' = `b', eq(3)
mleval `theta4' = `b', eq(4) scalar
mleval `theta5' = `b', eq(5) scalar

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);

Many thanks

Casey


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index