Displaying 20 results from an estimated 1000 matches similar to: "RE: rmultinom"
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
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
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
2023 Apr 08
1
Error message for infinite probability parameters in rbinom() and rmultinom()
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, Inf))
Error in rmultinom(1, 3:5, c(1/2, 1/3, Inf)) : NA in probability vector
> rmultinom(1, 3:5, c(1/2, 1/3, NA))
Error in rmultinom(1,
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>
>
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
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.
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
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
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
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
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
2003 Oct 14
2
different results depending of variable position.
Hi,
I make an analysis and depending of the order of the variables, the
significance change, look.
m1 <- glm((infec/ntot)~idade+sexo+peso,family=binomial,weights=ntot)
> anova(m1,test="F")
Analysis of Deviance Table
Model: binomial, link: logit
Response: (infec/ntot)
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev F Pr(>F)
2011 Oct 24
3
Create a matrix with increment and element with zero subscript
Hello,
Does anyone knows how to deal with zero subscript in R. I have this code:
for (i in 1:nitems){
+ for (j in 1:ncat-1) {
+ draw<-matrix(rnorm(nitems*(ncat-1),seed1,seed2),nitems,(ncat-1))
+ d<-( sigma_d*draw ) + mu_d
+ draw<-matrix(rtnorm((nitems*(ncat-1)),mean = seed1, sd = seed2, lower = .1, upper = 1.5),nitems,(ncat-1))
+
2006 Mar 27
0
Graded Response Model Simulation (SAS code conversion)
I have used R a lot in the past, but never for simulation. I have a code in SAS for the Graded Response Model (GRM), also known as Samejima's model. This code simulates an ordinal response, provided item characteristics (A=item discrimination, BB(G) are thresholds between various categorical responses). It is a macro file. I am thinking that I can write this as a function, and call it up
2016 Mar 08
1
[PATCH] sleuthkit availability check renamed
>From 'available icat' to 'available sleuthkit'.
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
---
daemon/tsk.c | 6 +++---
generator/actions.ml | 2 +-
tests/tsk/test-icat.sh | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/daemon/tsk.c b/daemon/tsk.c
index 647d1e7..0fe1250 100644
--- a/daemon/tsk.c
+++ b/daemon/tsk.c
@@ -31,12
2005 Apr 07
2
about mantelhaen.test (PR#7779)
Full_Name: Chien-yu Peng
Version: 2.0.1
OS: Windows XP Professional
Submission from: (NULL) (140.109.72.181)
Dear all:
Although I don't know you, I am thankful for your help.
When I use the function mantelhaen.test for R x C x K (R, C > 2) table,
the output is not the same as SAS's. I don't know that the result consist with
one of SAS's. But it works correctly for 2
2009 Mar 09
1
Zero distance error in corSpatial - correlation structure using lme
Hello,
I am having a problem specifying the correlation structure in lme which
leads to the error: Error in getCovariate.corSpatial(object, data =
data) : Cannot have zero distances in "corSpatial". I have specified a
grouping variable which is the only fix I could find by searching this
error on R-help.
ISee the below example. When my samples (tran) - which are transects
2016 Mar 30
0
[PATCH 1/3] Rename icat command in download_inode
The "icat" name comes from the employed command line tool which might be
replaced at any time with a different implementation.
The command name is a bit confusing because it's similar to "cat" but
act as "donwload".
download_inode is more clear and descriptive.
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
---
daemon/sleuthkit.c | 2