So either:
XX contains some non-finite numbers
Or
Something produced from it does.
Non finite means things like 1?0. R might show Inf or -Inf. But if there is
maths happening in the function it might be passing something to it the is
a 0 and so creating a Inf.
But if there is a test of is.finite you will get "false" to NA or 0/1
or
"0" (ie. Passing a character representation of a number)
On Sat, 29 Mar 2025, 09:04 Behaylu Ayalew, <behaaya at gmail.com> wrote:
> How are you dear Helper?
> I am from Africa, Ethiopia , I have faced this type of problem
>
> Error in optim(seq(-3, 3, length.out = k), wle.fit, method =
"BFGS",
> control = list(maxit = max.it)) :
> initial value in 'vmmin' is not finite
>
> when I want to run RM.w
>
> > wt = beha$wt> rr = RM.w(XX, wt)
>
> library(psychomix)> rr.country1 = RM.w(XX, wt1)
>
> Error in optim(seq(-3, 3, length.out = k), wle.fit, method =
"BFGS",
> control = list(maxit = max.it)) :
> initial value in 'vmmin' is not finite
>
> when I want to run RM.w
>
> Thank you in advance !
>
>
> --
> Behaylu Ayalew
> +251918768614
> Ethiopia.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]