Displaying 20 results from an estimated 6000 matches similar to: "qbinom"
2012 Nov 30
1
Choleski decomposition
m <- matrix(nrow=5, ncol=5)
m <- ifelse(row(m)==col(m), 1, 0.2)
c <- chol(m) # Choleski decomposition
u <- matrix(rnorm(2000*5), ncol=5)
uc <- u %*% c
cr <- pnorm(uc)
cr <- qbinom(cr,1,0.5)
cor(cr)
I expected that the cor(cr) to be 0.2 as i set in m, but the result is
around 0.1.
Why is that? Thanks
--
View this message in context:
2007 Jun 28
2
inaccuracy in qbinom with partial argument matching
Hi,
I found the following strange effect with
qbinom & partial argument matching
p0 <- pbinom(0, size = 3, prob = 0.25)
qbinom(p0, size = 3, prob = 0.25) ## 0 o.k.
qbinom(p0-0.05, size = 3, prob = 0.25) ## 0 o.k.
## positional matching:
qbinom(p0, 3, 0.25) ## 0 o.k.
## partial argument matching:
qbinom(p0 , s = 3, p = 0.25) ## 1 ???
qbinom(p0-0.05,
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)
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:
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:
2012 Sep 27
2
Generating an autocorrelated binary variable
Hi R-fellows,
I am trying to simulate a multivariate correlated sample via the Gaussian copula method. One variable is a binary variable, that should be autocorrelated. The autocorrelation should be rho = 0.2. Furthermore, the overall probability to get either outcome of the binary variable should be 0.5.
Below you can see the R code (I use for simplicity a diagonal matrix in rmvnorm even if it
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
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
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
2009 Apr 27
1
Passing Bablok
Hi,
is there any R-package providing a Passing Bablok regression procedure?
This Question seems to have occurred once or twice before, but I never saw
an answer to the previous inquiries.
Best regards
Benjamin Otto
======================================
Benjamin Otto
University Hospital Hamburg-Eppendorf
Institute For Clinical Chemistry
Martinistr. 52
D-20246 Hamburg
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
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
2011 Jul 14
1
recursive function - finding connections
Dear all,
I'm having some problems getting my recursive function to work. At first I though that maybe my data was too big and I increase option(expressions=50000). Then I thought that I would try it on some smaller data. Still not working. :(
I would have thought there should be a function for this already, so any suggestions are welcomed for other methods. I did try igraph but couldn't
2016 Mar 18
3
Redundant load in llvm's codegen compares to gcc when accessing escaped pointer?
On 2016.03.17 at 16:35 -0700, Chris Lattner via llvm-dev wrote:
>
> > On Mar 15, 2016, at 7:58 AM, Chuang-Yu Cheng via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> >
> > Hi,
> >
> > Please look at this c code:
> >
> > typedef struct _PB {
> > void* data; /* required.*/
> > int f1_;
> > float f2_;
> > } PB;
2016 Mar 18
4
Redundant load in llvm's codegen compares to gcc when accessing escaped pointer?
1. Same question as David, why &c - 8 is invalid? Is it related to below
statements In C99 standard?
6.5.3.3:
"Among the invalid values for dereferencing a pointer by the unary *
operator are a null pointer, an
address inappropriately aligned for the type of object pointed to, and the
address of an object after the
end of its lifetime."
2. We are trying to preserve 1st load and
2016 Mar 15
2
Redundant load in llvm's codegen compares to gcc when accessing escaped pointer?
Hi,
Please look at this c code:
typedef struct _PB {
void* data; /* required.*/
int f1_;
float f2_;
} PB;
PB** bar(PB** t);
void qux(PB* c) {
bar(&c); /* c is escaped because of bar */
c->f1_ = 0;
c->f2_ = 0.f;
}
// gcc-5.2.1 with -fno-strict-aliasing -O2 on x86
call bar
movq 8(%rsp), %rax
movl $0, 8(%rax)
movl $0x00000000, 12(%rax)
// llvm
2008 May 08
2
anova p value extraction
hello all,
Quick question, how do I get the p value out of the anova?
Thanks,
Paul
> pb<-aov(as.numeric(diff[5,16:33]) ~ grF)
> summary(pb)
Df Sum Sq Mean Sq F value Pr(>F)
grF 3 2.7860e+10 9.2867e+09 4.2236 0.02534 *
Residuals 14 3.0783e+10 2.1988e+09
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 '