Hi Zakaria, I had such an issue before, and in my case, the problem was that the calculation of the objective for some values used by the optimizer gave back a non-finite result. In general, this might be because the objective function has poles, and the calculation returns inf. Alternatively, there might be a calculation error somewhere in the objective function's code resulting in a nan value. I think that first, you need to determine more precisely what the problem is in your case. You could try evaluating the objective at different points (for instance, your initialization values) to see how it behaves.
I hope this helps! Pantelis -----Original Message----- From: R-help <r-help-boun...@r-project.org> On Behalf Of SITI AISYAH ZAKARIA Sent: Thursday, September 1, 2022 5:22 AM To: r-help mailing list <r-help@r-project.org> Subject: [R] How to solve this? Hi everyone, Can some one help me? If my coding come out the error like this "Error in optim(start, nhl, ..., method = method) : non-finite value supplied by optim". What it means? How can I solve this? Thank you. -- "..Millions of trees are used to make papers, only to be thrown away after a couple of minutes reading from them. Our planet is at stake. Please be considerate. THINK TWICE BEFORE PRINTING THIS.." DISCLAIMER: This email \ and any files transmitte...{{dr...{{dropped:9}} ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.