SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: No iterations over parameter [ Reply ]
By: Ott Toomet on 2019-12-20 05:38
[forum:47291]
Hi Marie,
hope you can solve it :-)

In my experience, usually it is not "noisiness" that creates the issues, it is more often some sort of multicollinearity where you only see certain type of variation in your data while your model assumes a nice continuous pattern. Another issue is often related to numeric gradient, this may not work, or may not work well. But I have never experienced this giving you flat zero standard errors. I suspect either your log-likelihood is incorrect, or it is some sort of data quirk where no matter what delta you feed into it, you get the same likelihood.

I cannot do much more though without data.

Cheers,
Ott

RE: No iterations over parameter [ Reply ]
By: Marie Lappe on 2019-12-19 08:33
[forum:47290]
Hey Ott,

thank you for your answer.
Sadly I cannot post a minimal example since the problem then disappears.

This would is the function I'm using:

g_LK_cons = function(thetag_LK){
alpha <- thetag_LK[1] #parameter vector
if(alpha < 0 || alpha > 1)
return(NA)
delta <- thetag_LK[2]
if(delta < 0 || delta > 1)
return(NA)
e_b <- thetag_LK[3]
if(e_b < 0)
return(NA)
mu_b <-thetag_LK[4]
if(mu_b < 0)
return(NA)
e_k <- thetag_LK[5]
if(e_k < 0)
return(NA)
mu_k <- thetag_LK[6]
if(mu_k < 0)
return(NA)
e_p <- thetag_LK[7]
if(e_p < 0)
return(NA)
mu_p <- thetag_LK[8]
if(mu_p < 0)
return(NA)

e1b = -mu_b*T-bBuys*log(1+(mu_b/e_b))
e2b = -mu_b*T-bSells*log(1+(mu_b/e_b))
e3b = -bBuys*log(1+(mu_b/e_b))-bSells*log(1+(mu_b/e_b))
emaxb = pmax(e1b,e2b,e3b)

e1k = -mu_k*T-kBuys*log(1+(mu_k/e_k))
e2k = -mu_k*T-kSells*log(1+(mu_k/e_k))
e3k = -kBuys*log(1+(mu_k/e_k))-kSells*log(1+(mu_k/e_k))
emaxk = pmax(e1k,e2k,e3k)

e1p = -mu_p*T-pBuys*log(1+(mu_p/e_p))
e2p = -mu_p*T-pSells*log(1+(mu_p/e_p))
e3p = -pBuys*log(1+(mu_p/e_p))-pSells*log(1+(mu_p/e_p))
emaxp = pmax(e1p,e2p,e3p)

log(alpha*(1-delta)*exp(e2b+e2k+e2p-emaxb-emaxk-emaxp)+alpha*delta*exp(e1b+e1k+e1p-emaxb-emaxk-emaxp)+(1-alpha)*exp(e3b+e3k+e3p-emaxb-emaxk-emaxp))-2*T*(e_b+e_k+e_p)+emaxb+emaxk+emaxp+bSells*log((e_b+mu_b)*T)+kSells*log((e_k+mu_k)*T)+pSells*log((e_p+mu_p)*T)+bBuys*log((e_b+mu_b)*T)+kBuys*log((e_k+mu_k)*T)+pBuys*log((e_p+mu_p)*T)

}


The parameter delta is usually the one that causes the issue (I've tried different starting values, etc.).
Honestly, I think my data is the problem, since it seems to be very noisy. I've tried different datasets and it seems to be working using them, so it's not the function.

I do have the problem of infinite standard errors using BFGS for all of my parameters, but I'm thinking about solving that by using BHHH as my final Hessian.

So I guess the issue is more or less resolved.

Thanks a lot though!

Greetings,
Marie

RE: No iterations over parameter [ Reply ]
By: Ott Toomet on 2019-12-16 23:19
[forum:47285]
Hi Marie,
it is hard to tell unless I know more (see code). Even better, try to create a minimal reproducible example.

Your problem hints that your likelihood function does not depend on that parameter at all, and hence it's value is not determined (and hence infinite standard errors).

Cheers,
Ott

No iterations over parameter [ Reply ]
By: Marie Lappe on 2019-12-12 14:16
[forum:47265]
Hello everyone,

I'm using the MaxLik package for my Bachelor thesis and I have the following problem:

One of my parameters is not iterated over. Its initial value is given as my estimate. I don't understand where that could come from.
A problem that arises with that is, that the Hessian I'm getting via BHHH has zeros in the row and column corresponding to said parameter. I need to extract my standard errors from there, because MaxLik itself returns infinite standard errors.

I'm using BFGS as a method.

Let me know, if you need the code to reproduce the results, but maybe this is a known issue? (Didn't find it in the forum though)

Thanks in advance!
Marie

Thanks to:
Vienna University of Economics and Business Powered By FusionForge