Hi all,
I am wondering how to code a log likelihood function with a indicator in the
formula? The log likelihood function is as follow:
L(m,s)=Ķē(Zt*s+m)^I
I=1, if Zt > -m/s;
I=-1, otherwise;
I am wondering if I can add this indicator I when define the log likelihood in
the following way:
maxlik(const vP, const adFunc, const avScore, const amHessian)
{
decl m=vP[0][], s=vP[1][];
if(z>-m/s)
I=1;
else
I=-1;
adFunc[0]=sumc((z.*s+m).^I);
}
Many thanks,
Shuai
|