Forum: open-discussion
Monitor Forum | Start New ThreadRE: optim - hypergeometric function and constraint on argument [ Reply ] By: Arne Henningsen on 2016-02-10 07:34 | [forum:42899] |
Dear Graziella Can you please provide a minimal reproducible example that reproduces the error? Best regards, Arne |
optim - hypergeometric function and constraint on argument [ Reply ] By: Graziella Bonanno on 2014-10-24 09:29 | [forum:42896] |
Dear All, I'm trying to optimization a log-likelihood function which argument is the error of a model y-x*betas, where y and x are observed (I have a sample of 54 manufactuirng firms). The density function is a combination of 4 Hypergeometric functions, then I have to consider more than one constraint. One of these is on the argument. When I launch the optim command, I obtain the following error message: "Error in optim(iv, ll_prodf, method = "L-BFGS-B", lower = c(0.1, 0.3, : L-BFGS-B needs finite values of 'fn' In addition: In if (abs(-exp((-x + eta[8])/eta[7])) > 1) a = exp(99999) else -(sum(log((1 - ... : the condition has length > 1 and only the first element will be used" I tried to maximize also with optimConstr. The error messages are as follows: "Error in obj * sign(mu) > obj.old * sign(mu) : invalid comparison with complex values In addition: 1: In h[1] <- x - eta[8] : number of items to replace is not a multiple of replacement length 10 2: In if (abs(-exp((-x + eta[8])/eta[7])) > 1) a = exp(99999) else -(sum(log((1 - ... : the condition has length > 1 and only the first element will be used" Where can I find th descriptions of this kind of errors? My problem (in addition to this maximization) is that I cannot interpret the error messages. Thank you, Graziella |