[R] Acceptance rate in metrop

2008-09-29 Thread Xia Wang
Hi I am using metrop in MCMC library.  Since some times the prior density is 0 and the log prior density would be –Inf, I ask the return value for loglikelihood equal to Min.log, which is defined as log(.Machine$double.xmin)-400, whenever a –Inf occurs to the logdensity.  However, I noticed if

Re: [R] Problem with Integrate for NEF-HS distribution

2008-08-26 Thread xia wang
ealth/People/Faculty/Varadhan.html ---- From: xia wang [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 12:59 PM To: Ravi Varadhan Cc: r-help@r-project.org Subject: RE: [R] Problem with Integrat

Re: [R] Problem with Integrate for NEF-HS distribution

2008-08-26 Thread xia wang
[EMAIL PROTECTED] > Subject: Re: [R] Problem with Integrate for NEF-HS distribution > To: [EMAIL PROTECTED] > > Shouldn't you define > integrand <- function(X,theta) .. > and not > integrand <- function(X) ..... > > > --- On Tue, 26/8/08, xia wang <[EMA

Re: [R] Problem with Integrate for NEF-HS distribution

2008-08-26 Thread xia wang
t; Fax: (410) 614-9625 > > Email: [EMAIL PROTECTED] > > Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html > > > > -------- > > > > -Original Message- >

[R] Problem with Integrate for NEF-HS distribution

2008-08-25 Thread xia wang
I need to calcuate the cumulative probability for the Natural Exponential Family - Hyperbolic secant distribution with a parameter theta between -pi/2 and pi/2. The integration should be between 0 and 1 as it is a probability. The function "integrate" works fine when the absolute value of th