similar to: Error in nlm : non-finite value supplied by 'nlm'

Displaying 20 results from an estimated 1000 matches similar to: "Error in nlm : non-finite value supplied by 'nlm'"

2010 Jun 15
0
nlm is
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is the negative loglikelihood derived from a mixing operator. f=function(vector)
2010 Feb 10
1
looping problem
Hi R-users,   I have this code here: library(numDeriv)   fprime <- function(z) { alp  <- 2.0165;   rho  <- 0.868;   # simplified expressions   a      <- alp-0.5   c1     <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)   c2     <- sqrt(rho)/(1-rho)   t1     <- exp(-z/(1-rho))   t2     <- (z/(2*c2))^a   bes1   <- besselI(z*c2,a)   t1bes1 <- t1*bes1   c1*t1bes1*t2 }   ## Newton
2007 Jun 18
1
two bessel function bugs for nu<0
#bug 1: besselI() for nu<0 and expon.scaled=TRUE #tested with R-devel (2007-06-17 r41981) x <- 2.3 nu <- -0.4 print(paste(besselI(x, nu, TRUE), "=", exp(-x)*besselI(x, nu, FALSE))) #fix: #$ diff bessel_i_old.c bessel_i_new.c #57c57 #< bessel_k(x, -alpha, expo) * ((ize == 1)? 2. : 2.*exp(-x))/M_PI #--- #> bessel_k(x, -alpha, expo) * ((ize == 1)? 2. :
2003 Aug 20
2
Method of L-BFGS-B of optim evaluate function outside of box constraints
Hi, R guys: I'm using L-BFGS-B method of optim for minimization problem. My function called besselI function which need non-negative parameter and the besselI will overflow if the parameter is too large. So I set the constraint box which is reasonable for my problem. But the point outside the box was test, and I got error. My program and the error follows. This program depends on CircStats
2003 Oct 24
1
first value from nlm (non-finite value supplied by nlm)
Dear expeRts, first of all I'd like to thank you for the quick help on my last which() problem. Here is another one I could not tackle: I have data on an absorption measurement which I want to fit with an voigt profile: fn.1 <- function(p){ for (i1 in ilong){ ff <- f[i1] ex[i1] <- exp(S*n*L*voigt(u,v,ff,p[1],p[2],p[3])[[1]]) } sum((t-ex)^2) } out <-
2010 Nov 13
1
Summing functions of lists
Hi I'm trying to sum functions of lists with different lengths. Here is a simplified example of the problem: r=list(1:3,1:5,1:2) r [[1]] [1] 1 2 3 [[2]] [1] 1 2 3 4 5 [[3]] [1] 1 2 x=function(i,j) sum(j*r[[i]]) # x is a function of two parameters: i & j y=function(j) # y is the sum of x over i + {
2010 Jan 26
1
newton method for single nonlinear equation
Hi r-users,   I would like to solve for z values using newton iteration method.  I 'm not sure which part of the code is wrong since I'm not very good at programming but would like to learn.  There seem to be some output but what I expected is a vector of z values.  Thank you so much for any help given.   newton.inputsingle <- function(pars,n) {  runi    <- runif(974, min=0, max=1)
2002 Oct 17
1
underflow handling in besselK (PR#2179)
The besselK() function knows about overflows/underflows internally; there is a constant xmax_BESS_K in src/nmath/bessel.h (and referred to only in bessel_k.c), equal to 705.342, which is checked if expon.scaled is FALSE. (The equivalent number for bessel_i.c is 709, defined as exparg_BESS in bessel.h.) However, besselK(x) silently returns +Inf if x>705.342. This behavior is reasonable for
2009 Jun 03
2
code for double sum
Hi R-users,   I wrote a code to evaluate double sum as follows:   ff2 <- function(bb,eta,z,k) { r <- length(z) for (i in 1:r) { sm1 <- sum((z[i]*bb/2)*(psigamma((0:k)+eta+1,deriv=0)/(factorial(0:k)*gamma((0:k)+eta+1))))  sm2 <- sum((besselI(z[i]*bb,eta)*log(z[i]*bb/2) - sm1)/besselI(z[i]*bb,eta))  sm2 } ff2(bb,eta,z,10)     but it gave me the following message:   >
2007 Sep 11
1
Fitting Data to a Noncentral Chi-Squared Distribution using MLE
Hi, I have written out the log-likelihood function to fit some data I have (called ONES20) to the non-central chi-squared distribution. >library(stats4) >ll<-function(lambda,k){x<-ONES20; 25573*0.5*lambda-25573*log(2)-sum(-x/2)-log((x/lambda)^(0.25*k-0.5))-log(besselI(sqrt(lambda*x),0.5*k-1,expon.scaled=FALSE))} > est<-mle(minuslog=ll,start=list(lambda=0.05,k=0.006))
2004 Dec 14
1
increase thr range in R
Hello Everybody in order to get some needed results out of my function i need to get my besselI function evaluated at some values which normally gave Inf or 0 (expon.scaled NAN) back. So I would like to increase the range in R from approxamittly 1e+320 to aabout 1e+500 or something like that. Is there any possibility or pacckage to do this easily? Thank You Sebastian Kaiser Institut for Statistics
2010 Feb 09
1
how to adjust the output
Hi R-users,   I have this code below and I understand the error message but do not know how to correct it.  My question is how do I get rid of “with absolute error < 7.5e-06” attach to value of cdf so that I can carry out the calculation.   integrand <- function(z) { alp  <- 2.0165   rho  <- 0.868   # simplified expressions   a      <- alp-0.5   c1     <-
2003 May 28
0
supplying the Hessian to "nlm"
Dear all, I am trying to minimize a function with 3 parameters using nlm. I have worked out the 2nd derivatives (incl the cross-product terms) and would like to supply them to nlm for evaluation. What I am not sure about is how to set up the Hessian matrix for nlm. That is, attr(lhat, "hessian") <- c(???) Do I have to enter all 9 of the entries or just the lower triangle of the
2007 Sep 22
0
error messages
Hi, I have a density that I need to get MLEs from, which includes definite integrals both in the denominator and in the numerator of the density function. It looks like the outcome depends on the initial values given. My program is shown below: library(circular) ######################################## 4 parameters ######################################## z<-rvonmises(100,0,1)
2002 Oct 23
1
vectorizing a function
Dear R-xperts I have just written a little hypergeometric function, included below [the hypergeometric function crops up when solving a common type of ODE]. It works fine on single values of the primary argument z, but vectorizing it is getting confusing. The best I have come up with so far just tests for z being longer than 1 and if so, uses sapply() recursively. This is fine, except that it
2003 Nov 06
1
some error messages using arm cpu with Debian
I have a small handheld pc having ARM process as a CPU. I installed debian and installed R using apt-get command. Everything worked great except for drawing even simple graphs x <- 1:10 plot(x) I got error messages 1: Nonfinite axis limits [GScale(nan,nan,1, .); log=0] 2: relative range of values = 9.0072e+15 * EPS, is small (axis 1). 3: Nonfinite axis limits
2002 Nov 26
2
Existence of non-vectorised functions
Dear R-Group: Recently, I ran into a problem. I was using a function called "I.1", which evaluates the first-order modified Bessel function of the first kind, in the package "CircStats". This function is not vectorized, since it uses a couple of "if" conditions. However, when I called this function with a vector argument, I got no error/warning messages in
2002 Dec 11
3
Modified Bessel Function - 2nd kind
In order to fit a probability distribution proposed by Sichel [Journal of the Royal Statistical Society. Series A (General), Vol. 137, No. 1. (1974), pp. 25-34], I need a modified Bessel function of the 2nd kind. I notice that the base package of "R" only has modified Bessel functions of the 1st and 3rd kind. Does a modified Bessel function of the 2nd kind exist anywhere? Many
2009 Mar 23
4
newton method
Hi R-users, Does R has a topic on newton's method? Thank you for the info.
2010 Jan 26
1
Newton method
Hi r-users,   I hope somebody can help me with this code. I would like to solve for z values using newton iteration method.  I 'm not sure which part of the code is wrong since I'm not very good at programming but would like to learn.  There seem to be some output but what I expected is a vector of z values.  Thank you so much for any help given.   newton.inputsingle <-