Displaying 20 results from an estimated 10000 matches similar to: "inaccuracy in qbinom with partial argument matching"
2005 Nov 23
1
qbinom returns NaN
Hi, All:
For most but not all cases, qbinom is the inverse of pbinom.
Consider the following example, which generates an exception:
> (pb01 <- pbinom(0:1, 1, .5, log=T, lower.tail=FALSE))
[1] -0.6931472 -Inf
Since "lower.tail=FALSE", Pr{X>1} = 0 in this context, and log(0) =
-Inf, consistent with the documentation.
However, the inverse of this does NOT
2009 May 20
3
qbinom (PR#13711)
Full_Name: Wolfgang Resch
Version: R 2.8.1 GUI 1.27
OS: OS X 10.4.11
Submission from: (NULL) (137.187.89.14)
Strange behavior of qbinom:
> qbinom(0.01, 5016279, 1e-07)
[1] 0
> qbinom(0.01, 5016279, 2e-07)
[1] 16
> qbinom(0.01, 5016279, 3e-07)
[1] 16
> qbinom(0.01, 5016279, 4e-07)
[1] 16
> qbinom(0.01, 5016279, 5e-07)
[1] 0
2003 Dec 18
1
qbinom when probability is 1 (PR#5900)
Full_Name: Jonathan Swinton
Version: 1.8.0
OS: Windows 2000
Submission from: (NULL) (193.132.159.34)
Calling qbinom with a sample probability of 1 returns NaN
> qbinom(p=0.95,size=10,prob=1)
[1] NaN
I believe that this is wrong and that qbinom(p,size,prob=1) should always be
size for 0<p<=1.
The documentation says that
The quantile is defined as the smallest value x such that F(x)
2004 Jun 11
1
qbinom(p, size, prob = 0, lower.tail = FALSE) hangs (PR#6972)
Full_Name: Jon McAuliffe
Version: 1.9.0
OS: Mac OS X 10.3.4
Submission from: (NULL) (64.166.16.252)
a call like qbinom(0.3, 10, prob = 0, lower.tail = FALSE) hangs R. prob = 0 does
not
look interesting, but it can be useful for completeness when qbinom is part of
other general routines.
please see PR#5900 (Accuracy-fixed).
jon.
--please do not edit the information below--
Version:
2000 Apr 07
4
Bug in qbinom? (PR#511)
n_10;p_0.5;jjx_0:n;qbinom(pbinom(jjx,n,p),n,p) # This one works as
expected
n_100;p_0.5;jjx_0:n;qbinom(pbinom(jjx,n,p),n,p) # This one causes
severe problems
I cannot interrupt using ESC and I finally have to resort to the Windows
Task manager to kill the R session.
A friend of mine told me that he faced similar problems under Unix.
--please do not edit the information below--
Version:
2012 Nov 30
4
qbinom
a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)
b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1)
cor(a,b)= -1
a'=qbinom(a, 1, 0.5)
b'=qbinom(b, 1, 0.5)
why cor(a',b') becomes -0.5 ?
--
View this message in context: http://r.789695.n4.nabble.com/qbinom-tp4651460.html
Sent from the R help mailing list archive at Nabble.com.
2011 Nov 01
1
Sample size calculations for one sided binomial exact test
I'm trying to compute sample size requirements for a binomial exact test.
we want to show that the proportion is at least 90% assuming that it is
95%, with 80% power so any asymptotic approximations are out of the
questions. I was planning on using binom.test to perform the simple test
against a prespecified value, but cannot find any functions for computing
sample size. do any exist?
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
2001 Jul 01
1
(PR#1007) ks.test doesn't compute correct empirical
On Sun, 1 Jul 2001 mcdowella@mcdowella.demon.co.uk wrote:
> Full_Name: Andrew Grant McDowell
> Version: R 1.1.1 (but source in 1.3.0 looks fishy as well)
> OS: Windows 2K Professional (Consumer)
> Submission from: (NULL) (194.222.243.209)
Please upgrade: we've found a number of Win2k bugs and worked around them
since then, let alone teh bug fixes and improvements in R ....
>
2003 Jan 22
2
small bug in binom.test?
Hi all,
I am wondering whether there is a small bug in the binom.test function of
the ctest library (I'm using R 1.6.0 on windows 2000, but Splus 2000 seems
to have the same behaviour). Or perhaps I've misunderstood something.
the command binom.test(11,100,p=0.1) and binom.test(9,100,p=0.1) give
different p-values (see below). As 9 and 11 are equidistant from 10, the
mean of the
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
2009 Apr 04
1
Problem with sample()
Hi,
I'm having a problem using sample() within a function.
Basically I get an error reading:
Error in sample(v, 1, prob = h) : non-positive probability
Can anyone advise me as to the possible origin of this error?
Here is my code
#Discretised Gillespie algorithm function (From SMfSB, D.J. Wilkinson)
gillespied=function (N, T=100, dt=1, ...)
{
tt=0
n=T%/%dt
x=N$M
2010 Sep 23
2
Error: attempt to apply non-function
This code worked fine for me, then did some cleaning up of formatting using ESS (Emacs) and now I get this error, no idea what is causing it, all the brackets/parentheses seem to be balanced. What have I done wrong?
Thanks
Jim
p0.trial01 <- 0.25
TruOR01 <- 0.80
num.patients.01 <- 50
num.trials.01 <- 5
LOR01.het.in <- 0.00
num.sims <- 1
simLOR01 <-
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
2010 Apr 29
1
BB package
Hi I would like to solve a system of nonlinear equations below using dfsane function
mn <- 142.36; vr <- 9335.69 ; sk <- 0.81; kur <- 0.25
test_fn <- function(p)
{ f <- rep(NA, length(p))
f[1] <- p[1]*(p [2]+p[3])- mn
f[2] <- - vr + 2*p[1]*p[2]*p[3]*(p[4]-1)+p[1]*(p[2]+p[3])^2
f[3] <- - sk + (p[1]*(p [2]+p[3])^3*(p[1]+1)*(p[1]+2)-6*p[1]*p[2]*p[3]*(p[2]+
2012 May 31
1
inverse binomial in R
Hello!
I'm having some trouble
trying to replicate in R a Stata function
invbinomial(n,k,p)
Domain n: 1 to 1e+17
Domain k: 0 to n - 1
Domain p: 0 to 1 (exclusive)
Range: 0 to 1
Description: returns the inverse of the cumulative binomial; i.e., it
returns the probability of success on one trial such
2005 May 04
1
Calculate median from counts and values
I am tangled with a syntax question. I want to calculate basic statistics
for a large dataset provided in weights and values and I can't figure out
an elegant way to expand the data.
For example here are the counts:
> counts
n4 n3 n2 n1 p0 p1 p2 p3 p4
1 0 0 0 1 1 3 16 55 24
2 0 0 0 0 2 8 28 47 15
3 1 17 17 13 4 5 12 24 8
...
and the values:
> values
2003 Sep 27
2
CI on median
Dear friends, I'm probably wrong but is there anything better than
bootstrap to get a confidence interval of the median from a population with
unspecified distribution ?
Best wishes
Troels Ring, Aalborg, Denmark
2011 Jun 16
1
lines(..., lwd=3) inaccuracy
Using a line width > 1 results in not only a thicker line but also some fuzz
in the other direction, as shown in this example program. You will see that
the thick vertical black lines extend below the gray scale horizontal lines.
Does anyone know whether this is intended or is it a bug? The application
is for displaying a correlation matrix (here just some random U(0,1)s).
Thanks -Frank