Displaying 20 results from an estimated 800 matches similar to: "R-function available for noncentral hypergeometric distribution"
2001 Sep 04
2
fastest way to multiply each column of a matrix by a single vlaue
Let A be a m by n matrix and b a length n vector. What is the fastest
vectorized code for doing
for(j in 1:n) A[, j] <- A[, j]/b[j] ?
solution 1:
t(t(A)/b)
solution 2:
B <- matrix( rep(b, m), byrow=T, nrow=m )
A/B
anything else?
I have a program that uses this kind of operation million of times and
I appreciate your input.
Thanks.
Jason Liao
=====
Jason G. Liao
Department of
2001 May 01
2
6 times faster by eliminating apply
This is some kind of follow-up to my previous posts. I have further
improved the speed of my program 6 times by eliminating all the
apply(). It turns out that apply is slow, is slower than direct loop,
it is an order slower than a matrix operation alternative.
Here is one example. The first apply version runs 19 seconds, the
second loop version runs 13 seconds, the third matrix version runs 1
2001 Apr 17
1
fastest R platform: follow-up and summary
The following runs in an eyeblink on my 700Mhz Thinkpad T-20 (256 MB RAM)
with Windows NT:
var(matrix(rnorm(4000000),ncol=4,nrow=1000000))
This also has the virtue of being quite readable. You could allow an
arbitrary covariance matrix and mean vector and it increases the time
slightly, but still only about 5 seconds.
Regarding performance, having tons of RAM is crucial. My Windows NT and the
2005 Sep 19
3
Extended Hypergeometric Distribution
Dear R Users,
There exists a non-central hypergeometric distribution function in the (MCMCpack) package, and a hypergeometric distribution function in the (stats) package.
Is there a function for sampling from an extended hypergeometric distribution?
Thanks,
Narcyz
This message is intended for the addressee named and may con...{{dropped}}
2008 Sep 25
1
What distribution is related to hypergeometric?
I have been reading, in various sources, that a poisson distribution is
related to binomial, extending the idea to include numbers of events in a
given period of time.
In my case, the hypergeometric distribution seems more appropriate, but I
need a temporal dimension to the distribution.
I have weekly samples of two kinds of events: call them A and B. I have a
count of A events. These change
2008 Dec 03
1
hypergeometric
Hi,
I hope somebody can help me on how to use the hypergeometric function.
I did read through the R documentation on hypergeometric but not really
sure what it means.
I would like to evaluate the hypergeometric function as follows:
F((2*alpha+1)/2, (2*alpha+2)/2 , alpha+1/2, betasq/etasq).
I'm not sure which function should be used- either phyper or qhyper or
dhyper
Where
2010 Mar 30
1
Multivariate hypergeometric distribution version of phyper()
Dear R Users,
I employed the phyper() function to estimate the likelihood that the
number of genes overlapping between 2 different lists of genes is due to
chance. This appears to work appropriately.
Now i want to try this with 3 lists of genes which phyper() does not
appear to support.
Some googling suggests i can utilize the Multivariate hypergeometric
distribution to achieve this. eg.:
2011 Aug 31
0
Fitting the negative hypergeometric distribution
I'd like to fit the (1-displaced) negative hypergeometric distribution
to data samples such as the following:-
x <- c(370, 311, 299, 266, 265, 232, 197, 198, 170, 154, 133, 123, 120,
103, 80, 72, 69, 67, 67, 50, 36, 35, 26, 23, 15, 11, 9, 6, 5, 3, 3, 2,
2, 2)
i.e., I want to estimate the parameter values of K and M (with my data,
n would usually be the same as the length of the data
2012 Mar 19
2
hypergeometric function in ‘ mvtnorm’
Is there any way to know how the "dmvt" function computes the hypergeometric
function needed in the calculation for the density of multivariate t
distribution?
--
View this message in context: http://r.789695.n4.nabble.com/hypergeometric-function-in-mvtnorm-tp4483730p4483730.html
Sent from the R help mailing list archive at Nabble.com.
2010 Jun 08
1
hypergeometric series in R
Hello.
Somebody knows how to compute generalized hypergeometric series in R?
(see
http://functions.wolfram.com/HypergeometricFunctions/HypergeometricPFQ/02/
to understand what I mean)
Thanks in advance,
Arnau.
2008 Feb 07
1
Appell Hypergeometric function
Dear All,
I am looking for an implementation in R of the Appell Hypergeometric
function.
Any suggestions will be more than appreciated!
GP
--
dr. Giovanni Parrinello
External Lecturer
Medical Statistics Unit
Department of Biomedical Sciences
Viale Europa, 11 - 25123 Brescia Italy
Tel: +390303717528
Fax: +390303717488
email: parrinel at med.unibs.it
1997 May 12
1
R-alpha: Hypergeometric Distribution
A cut and paste typo has crept in and is rendering all values returned
for the hypergeometric distribution incorrect. The problem is in
src/main/arithmetic.c in the function "math4". The lines
PROTECT(sy = allocVector(REALSXP, n));
a = REAL(sa);
b = REAL(sb);
c = REAL(sc);
d = REAL(sc); /* <-- change this line */
y = REAL(sy);
should
2010 Aug 13
1
hypergeometric vs fisher.test
Dear R team,
I have a simple question.
I tried this command:
phyper(17,449,19551,181, FALSE)
[1] 1.47295e-07
and then I tried this command:
(fisher.test(matrix(c(17,449,181,19551),2,2),
alternative='greater'))$p.value
[1] 3.693347e-06
Shouldn't be identical the results of the two commands ?
What is the difference ?
Thx a lot
--
View this message in context:
2009 Oct 26
0
MLE for noncentral t distribution
Hi,
Actually I am facing a similar problem. I would like to fit both an ordinary (symmetric) and a non-central t distribution to my (one-dimensional) data (quite some values.. > 1 mio.).
For the symmetric one, fitdistr or funInfoFun (using fitdistr) from the qAnalyst package should do the job, and for the non-central one.. am I right to use
gamlss(x ~ 1, family=GT()) ?
Anyway, I am a little
2008 Jan 15
0
FDR for hypergeometric tests
Dear list,
I have performed several tests for the hypergeometric distribution
using phyper() for some gene annotation categories as follows
>phyper(26,830,31042,337, lower.tail=F)
>phyper(16,387,31042,337, lower.tail=F)
.
.
.
I am only running some selected categories but I would like to correct
this value for multiple testing since I
have 3121 possible tests according to 3121
1998 Feb 23
0
R-beta: Hypergeometric Probabilities
In both versions of R to which I currently have access (R-0.16.1 and
R-0.61.1), "phyper" stops returning correct cumulative probabilities as the
parameters of the hypergeometric distribution get large. For example, when
N1=1345, N2=1055, and n=1330, phyper returns either 0 or 1, and nothing in
between.
Looking at phyper.c, it's clear what's happening. First a term (called
2002 Aug 05
0
Question regarding hypergeometric 2f1 function
Hi,
I'm an R newbie and I've got a question regarding a certain function in R. I
need to calculate values of the hypergeometric 2f1 function (hyp2f1 in
cephes math library, Hypergeometric2f1 in Mathematica) and I'm wondering if
anyone has tried to implement it in R or S-Plus. If not, what would be the
prefered way to do so? Should I rather try to use an external C module or
implement
2012 Oct 01
1
Retrieve hypergeometric results in large scale
I'm going to use
dhyper(x, m, n, k)
to get a 95% coverage. Let me use an example to explain my problem:
Suppose I have a urn containing 90 red and 10 black balls.
Now I wanna remove 3 from the urn. By the following codes:
m<-90;n<-10;k<-3;
x<-0:3
dhyper(x,m,n,k)
I can obtain the probability that 0,1,2,3 red balls will be removed.
0.000742115 0.025046382 0.247680891
2006 Dec 10
1
Noncentral t & F distributions
Dear List:
The square of the noncentral t-statistic with noncentrality parameter
\delta is a noncentral F with noncentrality parameter \lambda=\delta^2.
So, t^2_{\nu,\delta} = F_{1,\nu,\lambda=\delta^2}. Consequently, it
should follow that t^2_{1-\alpha/2,\nu,\delta} =
f_{1-alpha,1,\vu,\lambda=\delta^2}. However, this is not what is
happening with the following code. The central
2003 Oct 01
1
hypergeometric & population estimates
"help"
We want to estimate the number of caribou in Jasper. We recently conducted
an aerial survey and saw 70 uncollared caribou and 8 of 11 collared
caribou. We want to estimate the number of caribou in this population with
95% confidence limits. Gary White uses the hypergeometric distribution and
determines the population estimates using maximum likelihood and 95%CL as