similar to: factorial(), modulus()

Displaying 20 results from an estimated 2000 matches similar to: "factorial(), modulus()"

2000 Sep 21
2
qqnorm(), is it "backwards"?
Hello R friends, I'm wondering why I get funny qqnorm() results. It seems that they should all be reflected in the normal qqline(). For instance: if I qqnorm() bimodal or uniform data I get a sigmoidal in which the qqnorm() points lie above the qqline() at -ve theoretical quantiles, and the qqnorm() points lie below the qqline() at +ve theoretical quantiles. Yet I expect such platykurtic
2000 Feb 08
1
Ancova in R?
How to Ancova in R? I know this has got to be an FAQ, because I see it asked in the lists, but I haven't seen an answer to it. I see the R-sm has the ancova thing happening, but I kind of doubt that what I'm trying to do is "smoothing"... -- Pete Hurd phurd at uts.cc.utexas.edu http://www.zo.utexas.edu/research/phurd Section of Integrative Biology, University of Texas, Austin
2000 Mar 31
1
R: one bananna aov() question
Hello world, I'm trying to do an anova on data in data.set, dependent variable is a column named "dep.var", grouping variable is in a column called "indep.var", and is.factor(indep.var) is TRUE... why can't I just do aov(dep.var ~ indep.var, data = data.set)? What have I done to deserve this?! What gives? Am I missing something totlly obvious? R-base-1.0.0-1,
2009 Dec 15
3
RFC: lchoose() vs lfactorial() etc
lgamma(x) and lfactorial(x) are defined to return ln|Gamma(x)| {= log(abs(gamma(x)))} or ln|Gamma(x+1)| respectively. Unfortunately, we haven't chosen the analogous definition for lchoose(). So, currently > lchoose(1/2, 1:10) [1] -0.6931472 -2.0794415 NaN -3.2425924 NaN -3.8869494 [7] NaN -4.3357508 NaN -4.6805913 Warning message: In
2002 Jan 16
1
factorials
I'm a total newbie at using R, and so there probably is a better way to do this. However, I couldn't find one, and so maybe this will help someone. I was calculating log-likelihoods using a multinomial model, and found that for large n, prod(n:1) wouldn't work to calculate factorials (e.g., prod(200:1) = Inf). The below function calculates the natural log of a factorial (e.g.
2009 Apr 22
5
large factorials
I am working on a project that requires me to do very large factorial evaluations. On R the built in factorial function and the one I created both are not able to do factorials over 170. The first gives an error and mine return Inf. Is there a way to have R do these larger calculations (the calculator in accessories can do 10000 factorial and Maple can do even larger) -- View this message in
2005 Apr 04
1
Handling very large integers with factorial and combinat (nCm)
Dear list, perhpas this question is more suitable for R-dev but since I am not really a developer I post it here first. Apparently the following lines do not create any problem in R: library(combinat) r <- 20; b <- 2; sum( sapply(0:r,function(x) nCm(r,x)^(2*b)) ) > 2^64 while in C I obtain an overflow of data even using unsigned long long and with long double I incurr in precision
2001 Sep 20
0
G-test : log-likelihood ratio test
I've written a g.test() aka log-likelihood ratio test function for my opwn use. It's something I've seen requested (and looked to find myself) on this list a few times. It has the same basic syntax as chisq.test(). It does both goodness of fit tests and tests of independence. Yates' and Williams' corrections are implemented. I've put some examples from Sokal & Rohlf
2004 Nov 08
4
About 'choose' function
Hello R-users, When I didn't know about the internal 'choose' function, I made such function, 'my.choose' below. But when I used them instead of choose(6000,20), they didn't give me any answer. What is the difference between 'choose', 'my.choose1', and 'my.choose2' below? That is, what is behind 'choose' function and what's the problem
2011 May 09
1
Stirlings Approximation
I have some big combinations like: 4444444444444444444444444444 choose 784645433 Can R compute these? Is there any package that does stirlings approximation in R? -- Thanks, Jim. [[alternative HTML version deleted]]
2000 Apr 25
2
Recursive Computation in R
Hi there, I have written a function to calculate factorials as follows: fact <- function(x) { recurse <- x > 1 x[!recurse] <- 1 if( any(recurse) ) { y <- x[recurse] x[recurse] <- y * fact( y - 1 ) } x } I want to be able to do the famous birthday problem, which will involve the computation of 365!, however it shall get cancelled
2001 Dec 04
3
factorial() not here (PR#1194)
Version 1.3.1 (2001-08-31) factorial() is not in R. It is in S-Plus with the definition factorial <- function(n) gamma(n + 1) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not
2011 Feb 11
3
How can we make a vector call a function element-wise efficiently?
Hello I have a time-comsuming program which need to simplify, I have tested the annotated program as follow: > #define function which will be call > calsta <- function(c, n=100000) + { + i <- seq(from=0, length=c) + logx <- lchoose(NT-n, CT-i) + lchoose(n, i) + logmax <- max(logx) + logmax + log(sum(exp(logx - logmax))) + } > CT=6000 #assignment to CT >
2004 Sep 30
1
Vectorising and loop (was Re: optim "a log-likelihood function")
>From: Sundar Dorai-Raj <sundar.dorai-raj at PDF.COM> >Reply-To: sundar.dorai-raj at PDF.COM >To: Zhen Pang <nusbj at hotmail.com> >CC: r-help at stat.math.ethz.ch >Subject: Vectorising and loop (was Re: [R] optim "a log-likelihood >function") >Date: Wed, 29 Sep 2004 18:21:17 -0700 > > > >Zhen Pang wrote: > >> >>I also use
2011 Jan 07
4
how to calculate this natural logarithm
Hello I want to calculate natural logarithm of sum of combinations as follow: (R code) { com_sum=choose(2000000,482)*choose(1000000,118)+choose(2000000,483)*choose(1000000,117)+...+choose(2000000,i)*choose(1000000,600-i)+...+choose(2000000,600)*choose(1000000,0) #calculate the sum result=log(com_sum) #calculate the log of the sum } But
2008 Feb 27
1
dhyper, phyper (PR#10853)
Aloha all, I know too little about what I'm about to write and hope I'm not wasting your time. For a class I'm teaching in archaeological data analysis, I'm trying to put together a routine that calculates the so-called Petersen index and, especially, confidence intervals for the index. This was introduced to archaeologists by N.R.J. Fieller and A. Turner in an article
2007 Oct 26
5
help
hello, please can anyone help me out. Am a new user of R program. Am having problem with this code below, not getting the expected results. 1. Each m, the cumulative sum should be 1.000 but the 2nd and 3rd m returned 2.000 and 3.000 instead of 1.000. 2. to get the LCL(m) and UCL(m) for each m base on these instructions if out.cum > 0.025 then LCL(m)= y-1 if out.cum >0.975
2011 Nov 18
3
Permutations
Hi all, why factorial(150) shows the error out of range in 'gammafn'? I have to calculate the number of subset formed by 150 samples taking 10 at a time. How is this possible? best [[alternative HTML version deleted]]
2008 Sep 28
5
birthday problem (factorial limit)
Hi, I tried to calculate the formula for the birthday problem (the probability that at least two people out of a group of n people share the same birthday) But the factorial-function allows me only to calculate factorials up to 170. So is there a way to push that limit? to solve this formula: (factorial(365) / factorial((365-23))) / (365^23) (n=23)
2005 Jul 03
2
over/under flow
I am porting some FORTRAN to R in which an Inf triggers an if(). The trigger is infinite on exp(lgamma(OVER)). What is the canonical R style of determining OVER when exp(OVER)== Inf? The code structure that I am porting is best left intact--so I need to query R somehow to the value of OVER that causes exp(lgamma(OVER)) to equal Inf. On my system, exp(lgamma(171)) is about first to equal Inf.