Displaying 20 results from an estimated 2000 matches similar to: "a quick question about "rbinom""
2000 Feb 17
2
bug in rbinom? (PR#448)
# Your mailer is set to "none" (default on Windows),
# hence we cannot send the bug report directly from R.
# Please copy the bug report (after finishing it) to
# your favorite email program and send it to
#
# r-bugs@biostat.ku.dk
#
######################################################
In version 0.99.0 for Windows NT I get the following:
> .Random.seed
[1] 0 21012
2005 Aug 16
2
quirky behavior from rbinom (PR#8071)
Full_Name: Chris Paulse
Version: 2.1.1
OS: WinXP
Submission from: (NULL) (129.98.60.134)
This seems strange. I have a small block of code that repeatedly calls rbinom.
I put a break in there in case it returns NaN, as I've been having problems with
this. Here is a transcript from the debug session:
Browse[1]> theP
[1] 1
Browse[1]> yleft[dataIndex]
[1] 3
Browse[1]> rbinom(1,3,1)
2008 Jul 09
3
rbinom for a matrix
I have a large matrix full of probabilities; I would like to convert each
probability to a 1 or a 0 using rbinom.
How can I do this on the entire matrix? The matrix was converted from a
raster ArcMap dataset, so the matrix is essentially a map. Because of this,
I have no column headings.
Thanks!
--
View this message in context: http://www.nabble.com/rbinom-for-a-matrix-tp18366867p18366867.html
2001 Dec 02
1
bug in rbinom? (PR#1190)
Full_Name: Kert Viele
Version: 1.3
OS: Windows ME and 2000
Submission from: (NULL) (65.6.218.65)
Hello! Thanks for all your efforts on R. They are appreciated!
I was simulating the central limit theorem in class,
but found that repeated use of
mean(rbinom(100000,500,0.4))
resulted in values less than 200 (the expected mean), for example
> mean(rbinom(100000,500,0.4))
[1] 199.0294
>
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,
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
2014 Jan 15
1
rbinom in RcppArmadillo?
What is the RcppArmadillo way to make binomial draws from a vector of probs,
similar to what rbinom does in R?
Thanx!
--
View this message in context: http://r.789695.n4.nabble.com/rbinom-in-RcppArmadillo-tp4683593.html
Sent from the R devel mailing list archive at Nabble.com.
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,
2007 Nov 23
2
rbinom with computed probability
Hello,
I have a loop with probability computed from a logistic model like this:
for (i in 1:300){
p[i]<-exp(-0.834+0.002*x[i]+0.023*z[i])/(1+exp(-0.834+0.002*x[i]+0.023
+z[i]))
x and z generated from normal distribution.
I get 300 different probabilities And I want to generate variables from
bernulli distribution
with P for every observation:
T[i]<-rbinom(1,1,p[i])
But i get missing
2008 May 28
5
"rbinom" not using probability of success right
I am trying to simulate a series of ones and zeros (1 or 0) and I am using "rbinom" but realizing that the number of successes expected is not accurate. Any advice out there.
This is the example:
N<-500
status<-rbinom(N, 1, prob = 0.15)
count<-sum(status)
15 percent of 500 should be 75 but what I obtain from the "count" variable is 77 that gives the probability of
2006 Jun 29
1
using "rbinom" in C code gives me erroneous results... random variable is not random (always zero)...
Dear Listers,
I am trying to use "rbinom" in my C code, but i always get zeros as output no matter the probability. Am not sure what I am doing wrong because the function has worked before. Attached in an example. Noticed that "rbinom" expects 'n' to be REAL.
Regards, Vumani
R 2.3.1 (2006-06-01)
Windows XP
Gcc
/* Called this file binom.c and then ran rcmd shlib on it
2012 Jan 03
1
nls and rbinom function: step factor 0.000488281 reduced below 'minFactor' of 0.000976562
I am trying to learn nls using a simple simulation. I assumed that the binomial prob varies linearly as 0.2 + 0.3*x in x {0,1},
and the objective is to recover the known parameters a=0.2, b=0.3
..data frame d has 1000 rows...
d$x<-runif(0,1)
d$y<-rbinom(1000,1,0.2+0.3*d$x)
table(d$y,cut(d$x,breaks=5));
(-0.000585,0.199] (0.199,0.399] (0.399,0.599] (0.599,0.799]
2011 Feb 04
1
rbinom and probability
Hello compadRes,
I'm developing a script that selects "cells" over a certain metabolic rate to kill them. A rate between 9 and 12 means that the cells are candidates for death.
I'll show you what I mean:
# a would be a vector of cell metabolic rates.
a<-c(8, 7, 9, 6, 10, 11, 4, 5, 6)
#now identify which cells will be candidates for death, namely those cells with metabolic
2011 Dec 27
1
rbinom
I have the following code (which I did not write) that generates
data based on a logistic model.? I'm only getting a single record
with y=1.? It seems implausible that in 50k cases that have a
single y=1.? Does that ring alarm bells for anyone else?
?
beta<-c(-1.585600,-0.246900)
betasize<-length(beta)
meanpred<-c(0,35.900000)
varpred<-c(0,1.000000)
#loop code
2002 Mar 12
1
rbinom silently rounds size argument (PR#1377)
rbinom (in R-1.4.1) silently rounds its "size" argument.
The C code contains
n = floor(nin + 0.5);
I would argue that this should this either be documented or changed (to
return NA). (The behavior is inconsistent with dbinom).
I sent this in to the devel list a couple of weeks ago to
provoke discussion; no disagreement (or agreement) so I'm
submitting it as a bug.
2013 May 23
1
sample(c(0, 1)...) vs. rbinom
Greetings.? My wife is teaching an introductory stat class at UC Davis.? The
class emphasizes the use of simulations, rather than mathematics, to get
insight into statistics, and R is the mandated tool.?? A student in the class
recently inquired about different approaches to sampling from a binomial
distribution.? I've appended some code that exhibits the idea, the gist of
which is that using
2003 Jul 09
3
`acting' on variables
Dear list,
How can one "from within a function" act
on these variables ("outside" a function)
that were given as arguments.
If I have e.g. this beginning of a function:
foo <- function(tiro){
app.tiro <- 3 * tiro
[...]
}
How can I from within the curly brackets
e.g. concatenate the app.tiro to
the particular variable I passed as the
argument `tiro' ?
What is
2012 Apr 30
1
Dovecot dsync mail replication issues
Hi,
I'm trying to set up some dsync based replication between two hosts on
my network. The current topology is a single server running Postfix
with a single dovecot installation with a Maildir per user (only 4 users
including myself). No NFS, just local system users on ext4. I am only
using system users, ie no virtual users. I am using dovecot deliver to
deliver mails into the
2018 May 01
3
Compiling CUDA with clang on Windows
Dear all,
In the official document <https://llvm.org/docs/CompileCudaWithLLVM.html>,
it is mentioned that CUDA compilation is supported on Windows as of
2017-01-05. I used msys2 to install clang 5.0.1. Then I installed cuda 8.0.
However, I basically could not compile any code of cuda by the prescribed
setting. I wounder if anyone can successfully compile cuda code by the
clang on Windows.
2006 Jun 14
3
A question about stepwise procedures: step function
Dear all,
I tried to use "step" function to do model selection, but I got an error massage. What I don't understand is that data as data.frame worked well for my other programs, how come I cannot make it run this time. Could you please tell me how I can fix it?
***************************************************************************************************