Skip to content
Prev 165489 / 398506 Next

Non-finite finite difference error

Hi Jason,

The error message indicates that there was problem in estimating the gradient of objective function.  It has nothing to do with your second data point.  This could happen for a variety of reasons, but the most proximate cause of the problem seems due to a parameter being negative during the iteration.  The best solution, most often, is to provide a better (or atleast a different) starting value.  Look at the example in the help page for "fitdistr":

fitdistr(x, dgamma, list(shape = 1, rate = 0.1), lower = 0.01)

Note that the above command specifies lower bounds on both the shape and the rate parameter (hence a different optimziation algorithm will be used in "optim").

Best,
Ravi.
____________________________________________________________________

Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University

Ph. (410) 502-2619
email: rvaradhan at jhmi.edu


----- Original Message -----
From: JS.Augustyn at gmail.com
Date: Tuesday, December 23, 2008 11:27 pm
Subject: [R] Non-finite finite difference error
To: r-help at r-project.org