similar to: Error message for infinite probability parameters in rbinom() and rmultinom()

Displaying 20 results from an estimated 2000 matches similar to: "Error message for infinite probability parameters in rbinom() and rmultinom()"

2023 Apr 08
1
Error message for infinite probability parameters in rbinom() and rmultinom()
>>>>> Christophe Dutang >>>>> on Sat, 8 Apr 2023 14:21:53 +0200 writes: > Dear all, > Using rmultinom() in a stochastic model, I found this function returns an error message 'NA in probability' for an infinite probability. > Maybe, a more precise message will be helpful when debugging. >> rmultinom(1, 3:5, c(1/2, 1/3,
2023 Apr 08
1
Error message for infinite probability parameters in rbinom() and rmultinom()
On 08/04/2023 5:53 p.m., Martin Maechler wrote: >>>>>> Christophe Dutang >>>>>> on Sat, 8 Apr 2023 14:21:53 +0200 writes: > > > Dear all, > > > Using rmultinom() in a stochastic model, I found this function returns an error message 'NA in probability' for an infinite probability. > > > Maybe, a more
2016 Mar 10
3
rmultinom.c error probability not sum to 1
Hi all, I should have given a better explanation of my problem. Here it is. I extracted from my code the bit that gives the error. Place this in a file called test.c #include <math.h> #include <R.h> #include <Rmath.h> #include <float.h> #include <R_ext/Print.h> int main(){ double prob[3] = {0.0, 0.0, 0.0}; double prob_tot = 0.; prob[0] = 0.3*dnorm(2, 0,
2016 Mar 10
2
rmultinom.c error probability not sum to 1
Dear all, I have a questions regarding using the c function rmultinom.c. I got the following error message "rbinom: probability sum should be 1, but is 0.999264" Which is thrown by: if(fabs((double)(p_tot - 1.)) > 1e-7) MATHLIB_ERROR(_("rbinom: probability sum should be 1, but is %g"), (double) p_tot); I understand my probabilities do not sum to one close enough. I
2016 Mar 10
0
rmultinom.c error probability not sum to 1
> On 10 Mar 2016, at 21:25 , M.van_Iterson at lumc.nl wrote: > > Hi all, > > I should have given a better explanation of my problem. Here it is. > > I extracted from my code the bit that gives the error. Place this in a file called test.c Aha. Missing info #1, C not R... > > #include <math.h> > #include <R.h> > #include <Rmath.h> >
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 Jan 20
3
Troubles with the function rmultinom.c of the R's Random Number Generator
Hi, I'm simulating a Markov chain in Fortran interfaced with R-2.2.1 in order to generate data according to a Markov Random Field called the Potts model. R Version: platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 2.1 year 2005 month 12 day 20 svn rev 36812 Each loop of my Fortran calls the function rmultinom.c
2003 Jan 27
1
rmultinom() -- how \\ via own C code?
I've had a need for multinomial "random number generation" occasionally. And other people too. The following code is currently in the (very small ``not very high importance'') CRAN package normix --- which I will rename to "nor1mix" very seen because of a ``name registration'' problem I want to add "this" (well the functionality) to a
2016 Mar 10
0
rmultinom.c error probability not sum to 1
On 10 Mar 2016, at 12:47 , M.van_Iterson at lumc.nl wrote: > Dear all, > > I have a questions regarding using the c function rmultinom.c. > > I got the following error message "rbinom: probability sum should be 1, but is 0.999264" > > Which is thrown by: > > if(fabs((double)(p_tot - 1.)) > 1e-7) > MATHLIB_ERROR(_("rbinom: probability sum should
2006 Dec 09
1
Error in rmultinom(n, size, prob) : too few positive probabilities
// R 2.3.1 Can someone please explain why this error returns? > y=numeric(100) > x=matrix(runif(16),4,4) > for(i in 2:100) + { + y[i]=which(rmultinom(1, size = 1, prob = x[y[i-1], ])==1) + } Error in rmultinom(n, size, prob) : too few positive probabilities thx much ej
2002 Aug 08
0
RE: rmultinom
Hi Mark: I had also used sample and tabulate for generating multinomial and found it to be quite slow. So I had written a multinomial random numbers generator based on the GENMUL subroutine from "ranlib", which in turn is based on the algorithm from Luc Devroye's book on "Non-Uniform Random Variate Generation" You may want to compare this with your hybrid algorithm and
2002 Aug 08
0
RE: rmultinom
Dear newsgroup, There was a recent post suggesting the incorporation of a standard rmultinom(...). This seems like a good idea, but I wasn't sure about basing this on tabulate( sample( ...)). Despite the attractive succinctness, this could be very slow and use lots of memory if n or size is large. Instead, I've tended to use a loop over the boxes of the multinomial, taking successive
2020 Jan 20
3
[External] Re: rpois(9, 1e10)
On 1/20/20 4:26 AM, Martin Maechler wrote: > Coming late here -- after enjoying a proper weekend ;-) -- > I have been agreeing (with Spencer, IIUC) on this for a long > time (~ 3 yrs, or more?), namely that I've come to see it as a > "design bug" that rpois() {and similar} must return return typeof() "integer". > > More strongly, I'm actually pretty
2020 Jan 20
3
[External] Re: rpois(9, 1e10)
Ugh, sounds like competing priorities. * maintain type consistency * minimize storage (= current version, since 3.0.0) * maximize utility for large lambda (= proposed change) * keep user interface, and code, simple (e.g., it would be easy enough to add a switch that provided user control of int vs double return value) * backward compatibility On 2020-01-20 12:33 p.m., Martin Maechler
2020 Jan 22
2
[External] Re: rpois(9, 1e10)
>>>>> Martin Maechler >>>>> on Tue, 21 Jan 2020 09:25:19 +0100 writes: >>>>> Ben Bolker >>>>> on Mon, 20 Jan 2020 12:54:52 -0500 writes: >> Ugh, sounds like competing priorities. > indeed. >> * maintain type consistency >> * minimize storage (= current version, since 3.0.0) >> *
2000 May 12
1
Geometric Distribution at prob=c(0,1)
Dear all, I''m working with the geometric distribution for the time being, and I''m confused. This may have more to do with statistics than R itself, but since I''m getting results from R I find counterintuitive (well, yeah, my statistical intuition has not been properly sharpened), I feel like asking. The point first: If I do > rgeom(1,prob=1) I get: [1] NaN Warning
2007 Apr 22
0
rmultinom
Hi Can anyone help me? I am not an experienced R user (or statistician!). If I use rmultinom to generate random outcomes of a multinomial distribution, how do i use these in a way to help conduct an exact chi-squared test? woozles48 -- View this message in context: http://www.nabble.com/rmultinom-tf3626954.html#a10127600 Sent from the R help mailing list archive at Nabble.com.
2004 Sep 05
1
Biased calculations from using rmultinom?
Dear R users, This is a problem that has puzzled me for quite some time, and I wonder if anyone could offer me an insight to what is happening? I generated a multinomial matrix by using A<-rmultinom(100,1,c(0.4,0.3,0.2,0.1), and multiply this matrix by a set of values say B<-runif(n,100,50). I then calculate var(colSums(A*B)). I was able to work out the theoretical mean of
2008 Mar 05
1
Question on "assign(paste.."
Hello, I'm having trouble in using "assign(paste ..." command . I could create several dataframes following trinomial distribution using it but it could not be used to check their row means of the created dataframe. For example, the following works: probTrt=matrix(0,4,3); probTrt; #malf, death, normal probTrt[1,]=c(0.064,0.119,0.817);#for Trt 1 probTrt[2,]=c(0.053,0.125,0.823);#for
2020 Jan 23
1
[External] Re: rpois(9, 1e10)
On 1/20/20 12:33 PM, Martin Maechler wrote: > > It's really something that should be discussed (possibly not > here, .. but then I've started it here ...). > > The NEWS for R 3.0.0 contain (in NEW FEATURES) : > > * Functions rbinom(), rgeom(), rhyper(), rpois(), rnbinom(), > rsignrank() and rwilcox() now return integer (not double) > vectors.