similar to: strange behaviour of negative binomial

Displaying 20 results from an estimated 2000 matches similar to: "strange behaviour of negative binomial"

2008 Feb 10
1
Error while using fitdistr() function or goodfit() function
Try changing your method to "ML" and try again. I tried the run the first example from the documentation and it failed with the same error. Changing the estimation method to ML worked. @List: Can anyone else verify the error I got? I literally ran the following two lines interactively from the example for goodfit: dummy <- rnbinom(200, size = 1.5, prob = 0.8) gf <- goodfit(dummy,
2008 Oct 19
1
number of required trials
Dear Experts, Probably trivial, but I am struggling to get what I want: I need to know how the number of required trials to get a certain number of successes. By example: How many trials do I need to have 98% probability of 50 successes, when the a priory probability is 0.1 per trial. The Negative binomial function may do the job (not sure): NegBinomial {stats} The Negative Binomial
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the order of the arguments. This is an example: > rpois(n=1,lambda=2) [1] 3 > rpois(lambda=2,n=1) [1] 2 0 It obviously uses the first argument as the number of samples to be drawn, which is wrong. I used Version 0.49 Beta (April 23, 1997). Fredrik
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the order of the arguments. This is an example: > rpois(n=1,lambda=2) [1] 3 > rpois(lambda=2,n=1) [1] 2 0 It obviously uses the first argument as the number of samples to be drawn, which is wrong. I used Version 0.49 Beta (April 23, 1997). Fredrik
2006 Jul 14
2
Negative Binomial: Simulation
Hi R-Users! I fitted a negative binomial distribution to my count data using the function glm.nb() and obtained the calculated parameters theta (dispersion) and mu. I would like to simulate values from this negative binomial distribution. Looking at the function rnbinom() I was looking at the relationship between the two possible parametrizations of the negative binomial and found that for this
2005 Jan 04
1
quantiles for geometric distribution
Dear list, I have got an array with observational values t and I would like to fit a geometric distribution to it. As I understand the geometric distribution, there is only one parameter, the probability p. I estimated it by 1/mean(t). Now I plotted the estimated density function by plot(ecdf(t),do.points=FALSE,col.h="blue"); and I would like to add the geometric distribution. This
2004 Jun 15
1
AIC in glm.nb and glm(...family=negative.binomial(.))
Can anyone explain to me why the AIC values are so different when using glm.nb and glm with a negative.binomial family, from the MASS library? I'm using R 1.8.1 with Mac 0S 10.3.4. >library(MASS) > dfr <- data.frame(c=rnbinom(100,size=2,mu=rep(c(10,20,100,1000),rep(25,4))), + f=factor(rep(seq(1,4),rep(25,4)))) > AIC(nb1 <- glm.nb(c~f, data=dfr)) [1] 1047 >
2008 May 16
1
gam negative.binomial
Dear list members, while I appreciate the possibility to deal with overdispersion for count data either by specifying the family argument to be quasipoisson() or negative.binomial(), it estimates just one overdispersion parameter for the entire data set. In my applications I often would like the estimate for overdispersion to depend on the covariates in the same manner as the mean. For example,
2009 Mar 17
3
R does not compile any more on FreeBSD 8.0-CURRENT
On a recent FreeBSD 8.0-CURRENT (i386) building R (any version) breaks with the following messages: ---------------------------------------------------------------------- [...snip...] gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c wilcox.c -o wilcox.o gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include
2006 Mar 30
1
warning message in hand-made function
Dear Rusers, I tried to implement a function comparing mean scores between one subject (the patient) and a group a control subjects. The function returns attended results, but I also obtained the following warning : Warning message: the condition has length > 1 and only the first element will be used in: if (substr(fp, 1, 1) == "<") fp else paste("=", fp) Maybe
2009 Apr 04
1
summary for negative binomial GLMs (PR#13640)
Full_Name: Robert Kushler Version: 2.7.2 OS: Windows XP Submission from: (NULL) (69.246.102.98) I believe that the negative binomial family (from MASS) should be added to the list for which dispersion is set to 1.
2005 Dec 11
1
Quantile function for the generalized beta distribution of the 2nd kind
I have succeded in defining the cdf of the generalized beta of the second kind, eg. pgbeta2 <- function(quint,b,a,p1,p2) { integrate(function(x) {exp(log(a)+(a*p1-1)*log(x)-(a*p1)*log(b)-log(beta(p1,p2))-(p1+p2)*log(1+(x/b)^a))},0,quint)$value } but I'm facing problems with the quantile function. I tried something like qgbeta2 <- function(proba,b,a,p1,p2) { optimize(function(z)
2020 Aug 10
2
qnbinom with small size is slow
Thanks Ben for verifying the issue. It is always reassuring to hear when others can reproduce the problem. I wrote a small patch that fixes the issue (https://github.com/r-devel/r-svn/pull/11): diff --git a/src/nmath/qnbinom.c b/src/nmath/qnbinom.c index b313ce56b2..d2e8d98759 100644 --- a/src/nmath/qnbinom.c +++ b/src/nmath/qnbinom.c @@ -104,6 +104,7 @@ double qnbinom(double p, double size,
2001 Feb 08
2
dnbinom(,size<1,)=0 (PR#842)
This came up on r-help but indicates a bug. dnbinom(x,n,p) calls dbinom_raw(n-1,...) which returns 0 for n<1. -thomas ---------- Forwarded message ---------- Date: Thu, 08 Feb 2001 17:10:23 +0000 From: Yudi Pawitan <yudi@stat.ucc.ie> To: Mark Myatt <mark@myatt.demon.co.uk> Cc: R-Help <r-help@stat.math.ethz.ch> Subject: Re: [R] Goodness of fit to Poisson / NegBinomial
2008 Apr 17
2
pnbinom.c qnorm.c
Dear R users, I was wondering from where I could get the C source code to compute pnbinom() and qnorm() ? (I would use R in batch mode but I find the startup time prohibitive, unless there is a way to speed it up) I searched the Web and it clearly is part of the R distribution, I just don't know how to extract them. Thanking you ! Markus Loecher Princeton, NJ [[alternative HTML version
2005 Apr 25
6
Proba( Ut+2=1 / ((Ut+1==1) && (Ut==1))) ?
Dear all, First I apologize if my question is quite simple, but i'm very newbie with R. I have vectors of the form v = c(1,1,-1,-1,-1,1,1,1,1,-1,1) (longer than this one of course). The elements are only +1 or -1. I would like to calculate : - the frequencies of -1 occurences after 2 consecutives -1 - the frequencies of +1 occurences after 2 consecutives +1 It looks probably something like
2005 Oct 11
2
Problems with plot function
Hello all R users, My simulation function works correctly, but I have problems with plot function. You will find the following code using it. Thank you for your help ##################################################" simulation <- function(k, n){ conc <- seq(0,10,by=0.5) #choixg <- seq(1, length(conc)) choixg <- rep(0,length(conc)) for (i in 1:length(conc)){ choixg[i]
2005 Oct 13
1
problems with loop and plot function
Hi all R users, I have problems with my second loop for drawing the three curves in the same graphic. I need help please Thank you in advance ######################################################################### simulation <- function(k, n){ conc <- seq(0,100,by=0.5) #choixg <- seq(1, length(conc)) choixg <- rep(0,length(conc)) for (i in 1:length(conc)){ choixg[i] <- (k
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about how I can get R to use all 8 cores of a mac pro would be most useful and very appreciated... (2) spent the last few hours trying to get pnmath to compile under os- x 10.5.4... using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from CRAN, xcode 3.0... ...xcode 3.1 installed over top of above after
2003 May 16
1
--csum-length ?!
>From the manpage: --csum-length=LENGTH By default the primary checksum used in rsync is a very strong 16 byte MD4 checksum. In most cases you will find that a trun- cated version of this checksum is quite efficient, and this will decrease the size of the checksum data sent over the link, mak- ing things faster. You can choose the