[R] How to solve this?

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Thu Sep 1 10:54:08 CEST 2022


Hello,

Can you post the code you've tried and sample data? Please post the code 
you ran and the output of `dput(df)`. Or, if it is too big with the 
output of `dput(head(df, 20))`. (Note: `df` is a placeholder for the 
name of your data set.)

Hope this helps,

Rui Barradas


Às 08:28 de 01/09/2022, pikappa.devel using gmail.com escreveu:
> 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-bounces using r-project.org> On Behalf Of SITI AISYAH ZAKARIA
> Sent: Thursday, September 1, 2022 5:22 AM
> To: r-help mailing list <r-help using 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.
>



More information about the R-help mailing list