Am 03.12.2017 um 21:43 schrieb Ioannis A. Venetis: > One guess is trouble will the log expression and/or exponentials etc. > > Try to simplify the likelihood function. > > For example -2*log(th)+log( exp(.+.)*B1 + (resM+su)*B2 + sr*B3 ) >
(Copied from OP: mle logl = check ? log((2/th^2)*exp(sr^2/(2*su^2))*exp(resM/su)*B1 + (2/th^2)*(resM+su)*B2 + (2/th^2)*sr*B3) :NA scalar check = (sr>0) && (su>0) && (th>0) ) Actually, now that I think of it, this on-off-check in the definition of the likelihood might be problematic. Have you ever had success with it? The typical way to ensure such constraints into the parameters is to map them via an appropriate function with the right support and/or domain, such as CDFs, exponentials, etc. Then the parameters of interest can never go wrong, but the algorithm is still formally unconstrained. hth, sven
