Hi Dennis, Sorry for not being considerate. I should have at least mentioned I was using MCMCpack. I have no idea about traceback() though.
I appreciate your suggestion. Best, Zhongyi On Wed, Sep 29, 2010 at 5:00 PM, Dennis Murphy <djmu...@gmail.com> wrote: > Hi: > > It might be helpful to inform the list which package you're using - > evidently it's MCMCpack, but I had to search to learn that. > You may also want to include the following information: > > > > samp <- MCMCmetrop1R(dexp, theta.init=1, rate=2, > + mcmc=5000, burnin=500, > + thin=10, verbose=500, logfun=FALSE) > Error in optim(theta.init, maxfun, control = optim.control, lower = > optim.lower, : > non-finite finite-difference value [1] > > traceback() > 2: optim(theta.init, maxfun, control = optim.control, lower = optim.lower, > upper = optim.upper, method = optim.method, hessian = TRUE, > ...) > 1: MCMCmetrop1R(dexp, theta.init = 1, rate = 2, mcmc = 5000, burnin = 500, > thin = 10, verbose = 500, logfun = FALSE) > > along with the results of sessionInfo(). You may also want to cc the > package maintainer in case this happens to be a bug: > > maintainer('MCMCpack') > [1] "Andrew D. Martin <admar...@wustl.edu>" > > I don't know enough about the package to help you, but providing this > information to the list will increase the probability of a successful > resolution in a shorter period of time. > > Cheers, > Dennis > > On Wed, Sep 29, 2010 at 2:19 PM, Zhongyi Yuan <zhongyi-y...@uiowa.edu>wrote: > >> Dear R users, >> >> I am leaning MCMC sampling, and have a problem while trying to sample >> exponential r.v.'s via the following code: >> >> samp <- MCMCmetrop1R(dexp, theta.init=1, rate=2, >> mcmc=5000, burnin=500, >> thin=10, verbose=500, logfun=FALSE) >> >> I tried other distribtions such as Normal, Gamma with shape>1, it works >> perfectly fine. Can someon tell me why? >> Thank you for your help. >> >> Best, >> Zhongyi >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help@r-project.org mailing list >> 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. >> > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.