similar to: comment in src/nmath/dgamma.c

Displaying 20 results from an estimated 8000 matches similar to: "comment in src/nmath/dgamma.c"

2000 Apr 14
1
rgamma with negative shape and scale parameters works?
Dear R people, This is a possibly silly question, but the rgamma function takes the shape and scale arguments and simulates gamma rvs corresponding to those values, right? But the shape and scale parameters have to be positive, right? However, rgamma quite happily returns to me values for negative values of shape and scale, and in some cases returns negative values eg. > rgamma(1, 1, -1) [1]
2011 Sep 10
1
dgamma in jags within r
I define priors in jags within r using a gamma distribution. I would like to control the shape but I have problems. Any help will be usefull. From help of dgamma ___________________ The Gamma distribution with parameters shape = a and scale = s has density f(x)= 1/(s^a Gamma(a)) x^(a-1) e^-(x/s) and rate=1/scale From jags user manual ____________________ dgamma(r, mu) has a density of
2007 Apr 23
2
Problem with dgamma ?
Hi All, Here 's what I got using dgamma function : > nu<-.2 > nu*log(nu)-log(gamma(nu))+(nu-1)*log(1)-nu*(1) [1] -2.045951 > dgamma(1,nu,nu,1) [1] 0.0801333 > dgamma(1,nu,nu,0) [1] NaN Warning message: NaNs produced in: dgamma(x, shape, scale, log) Could anyone tell me what is wrong here ? I am using R-2.4.1 on windows XP. Thanks a lot.
2012 Jan 27
2
The following code (using rgamma) hangs
Hi, I'm seeing something that may be a bug in R's standalone math library, which is packaged by Debian as r-mathlib. I reported it to the Debian BTS as http://bugs.debian.org/657573 I'm using Debian squeeze, and the code was tested with r-mathlib 2.11.1-6 (default on stable) and 2.14.1-1 (from testing/unstable). I summarize this report below. The following code with the R math
2016 Nov 13
1
dgamma density values in extreme point
Dear R-Devel group, My name is Alexey, a data scientist from Moscow, currently working for Align Technology Inc. We have recently had a discussion of the results that the dgamma function (stats) returns for an extreme point (x == 0). <dgamma(0,1,1,log = FALSE) [1] 1 and <dgamma(0,0.5,1,log = FALSE) [1] Inf Density appears to be defined in point zero for the distribution with the
2008 Jun 25
1
dgamma in WinBUGS and JAGS (rjags)
Hello, In WinBUGS 1.4 manual (http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/manual14.pdf), the gamma density is presented as dgamma(r,mu) where r and mu are the shape and rate parameters, respectively. In JAGS (rjags) manual version 1.0.2, May 9, 2008 (http://www-fis.iarc.fr/~martyn/software/jags/jags_user_manual.pdf), on page 26 the gamma density is presented as dgamma(mu,r) instead of dgamma(r,mu).
2002 Jan 14
1
trouble using R Mathlib as standalone
Dear People, I am trying to use R's Math library as standalone, as documented in /src/nmath/standalone. I am using C++ in Debian testing, and the versions are as follows: ii g++-3.0 3.0.3-1 The GNU C++ compiler. ii r-mathlib 1.4.0-1 `GNU S' - Standalone R math library I have a file (rand.cc) as follows. I don't think that lattice.hh or mh.hh are very
2001 Oct 18
1
rsync logging and permission problems
Dear rsync people, I have just started using rsync for backups. I have had a couple of issues. Note I'm trying to use rsync as user using ssh between two machines both running Debian GNU/Linux potato (2.2r3). The local machine is currently running 2.4.6-1 and the remote 2.3.2-1.2. 1) When I run rsync with the vv option, stuff scrolls of my screen faster than I can read it. I was wondering if
2008 Apr 30
3
checking whether a file is empty
Hi, Is there a way to check whether a file is empty in R. I did the customary searches, but did not find anything. Please cc me on any reply. Thanks, Faheem.
2001 Feb 07
1
Re: failed rpm installation of R 1.2-1 (fwd)
On Wed, 7 Feb 2001, Faheem Mitha wrote: > Dear Albrecht, > > Just sent the following message out to r-help. Have you any idea what this > problem could be? > > Sincerely, Faheem Mitha. > > ---------- Forwarded message ---------- > Date: Wed, 7 Feb 2001 00:04:35 -0500 (EST) > From: Faheem Mitha <faheem at email.unc.edu> > To:
2001 Oct 21
3
generating a gamma random variable
Dear R People, This question has nothing to do with R directly, but it is a simulation question. I need to generate a random variable distributed as gamma(\alpha,\beta), with the additional proviso that it must be a function of random variable(s) which do not depend on \alpha, \beta. In this case, I have \alpha = (T-1)/2, where T is a positive integer. So, it seems reasonable to first simulate
2002 Jul 24
1
loading compiled C++ code as shared library
Dear People, Over the last few days I've been writing C++ to compile as a shared library (previously I have always used C). Not entirely to my surprise, I am getting errors. Specifically, when I try to load the shared library, I get Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library "/home/faheem/research/thesis/sim/ms/ms.so":
2001 Feb 24
5
testing for integer
Dear People, Consider the following fragment of R code choose <- function(n,r) { if( is.integer(n) && is.integer(r) && n > 0 && r >= 0 ) { .C("choose",as.double(n),as.double(r),comb = double(1))$comb } else stop("n must be a positive integer and r a non-negative integer.") } This is a practice function (n choose r), which I
2011 Jun 26
2
does rsync not preserve directory mtimes?
Hi, I'm running the following command as a local copy command. faheem at bulldog:/mnt/data$ sudo rsync -abvz --super /data/ . Origin directory faheem at bulldog:/data$ ls -la total 28 drwxr-xr-x 7 root root 4096 Jun 26 08:34 . drwxr-xr-x 25 root root 4096 Apr 13 17:09 .. drwxr-xr-x 2 owzar001 root 4096 Nov 6 2010 CTS drwxr-xr-x 2 owzar001 owzar001 4096 Aug 27 2010
2001 Feb 08
4
eps file not positioned properly in latex document
Dear People, I am trying to include a barplot (see code below), in a latex document. However, the plot appears in totally the wrong position. I know this is not an R question as such, but the eps file is produced by R and I thought that perhaps other people had had similar problems and could give me pointers. Am I doing anything obviously wrong? Sincerely, Faheem Mitha. PS.
2008 Aug 06
3
subsetting with column name as string
Hi, Consider the following > x = c(1,2) > y = c(3,4) > d = data.frame(cbind(x,y)) > d$x [1] 1 2 > d$"x" [1] 1 2 > > foo = function(val) + { + return(d$val) + } > > bar = function() + { + return(d$"x") + } > > foo("x") NULL > bar() [1] 1 2 I'm a little surprised that R accepts both the form d$x and d$"x", but
2003 Apr 29
4
thick plot lines
Dear People, In a qqplot I am doing, I get lines/points that are very thick. I've tried setting the lwd variable to 0.1, but it doesn't seem to have any effect. Also, I have set the value of lty to dashed, but I still get dots. The command looks like qqplot(cdf.inv(seq(0,1,length=size),theta,pos,len),empmargdistvec(len,theta,pos,size), xlim=c(-theta,theta), ylim=c(-theta,theta),
2001 Mar 13
1
passing arguments to R CMD SHLIB
Dear People, I want to run gcc with optimisation turned on (-O2), and with -Wall (all warnings) enabled, when using R CMD SHLIB. When I do make, which is R CMD SHLIB -Wall -O2 cftp.c mcmc.c latticefn.c -lm in this case, I get faheem ~/research/cftp>make R CMD SHLIB -Wall -O2 cftp.c mcmc.c latticefn.c -lm make[1]: Entering directory `/home/faheem/research/cftp' gcc -I/usr/lib/R/include
2001 Sep 23
1
plot with no tick marks
Dear R people, I have the following simple bit of code to make a plot. I want to suppress tick marks on the axes of the plot. I've been trying everything I can think of to do so, but have been unsuccessful. Can you help me? If you reply, please cc me, I'm not currently subscribed to the list. Thanks in advance. Sincerely, Faheem Mitha. num <- 1:i inc
2001 Mar 14
2
concatenating lists
Dear People, I have been trying to perform concatenation operations on lists without success. Consider the following example. > x <- runif(2) > y <- runif(2) > z <- runif(2) > xy <- list(x,y) > xyz <- list(x,y,z) I want to have a function foo such that foo(xy,z) is the same as xyz. This appears not to be as easy as I thought, though there must be a way. For example