Displaying 20 results from an estimated 8000 matches similar to: "factorial() not here (PR#1194)"
2012 Mar 24
1
Solving the equation using uniroot
Hello all,
I was going to solve (n-m)! * (n-k)! = 0.5 *n! * (n-m-k)!
for m when values of n and k are provided
n1<-c(10,13,18,30,60,100,500) # values of n
kx<-seq(1,7,1); # values of k
slv2<-lapply(n1,function(n){
slv1<-lapply(kx,function(k){
lhs<-function(m)
{
2002 Mar 13
1
several bugs (PR#918) lists and matrices
### I got bit again by the same bugs I wrote about a year ago.
### The bugs are related to matrices and arrays of lists.
### 1. There is a clear inconsistency in how R handles two
### functionally equivalent statements.
### array() is able to take a list and create a matrix.
### matrix() is unable to create that matrix.
> vector("list", 2)
[[1]]
NULL
[[2]]
NULL
>
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
2001 Dec 11
4
crash bug in get("function.name")() (PR#1211)
R : Copyright 2001, The R Development Core Team
Version 1.3.1 (2001-08-31)
> tmp <- factor(1:3)
> get("print.factor")(tmp)
[1] 1 2 3
Levels: 1 2 3
> print.a <- function(x,...) {
+ print("this is a")
+ NextMethod("print", x, quote = FALSE, right = TRUE, ...)
+ }
>
> get("print.a")
function(x,...) {
print("this is a")
2006 Jul 22
1
ifelse command
Dear:
I try to revise the maximum likelihood function below using something constrains. But it seems something wrong with it. Becasue R would not allow me to edit the function like this. It is very appreciate if you can help.
function (parameters,y,x1,x2)
{
p<-parameters[1]
alpha1<-parameters[2]
beta1<-parameters[3)]
delta1<-parameters[4]
alpha2<-parameters[5]
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]]
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
2006 Jul 22
1
Why the contrain does not work for selecting a particular range of data?
Dear:
Continuing the issue of 'ifelse'! I selecting the data whose 'x2'=1 for maximizing likelihood. I used two way to do this but the results are different.
1.Way one I use the data for x2=1 and run the program. It works for me. Tthe program is described as below:
function (parameters,y1,x11)
{
p<-parameters[1]
alpha1<-parameters[2]
beta1<-parameters[3]
2000 Jul 06
1
factorial(), modulus()
Dear R friends,
I was wondering if there were factorial and modulus functions out there
that I've somehow overlooked?
-P.
--
Peter L. Hurd, Ph.D.
phurd at uts.cc.utexas.edu
http://www.zo.utexas.edu/research/phurd fax 512.471-3878
Section of Integrative Biology, University of Texas, Austin TX 78712 USA
2003 Mar 02
2
bug in bwplot (PR#2595)
> tmp <- data.frame(y=rnorm(12), g=factor(rep(1:2,6)))
> bwplot(g ~ y, data=tmp)
Error in segments(x1 = structure(c(-1.68373790592731, 0.159038997376781, :
Argument "x0" is missing, with no default
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 1
2008 Jul 09
1
Loglikelihood for x factorial?
Hi Rers,
I have a silly question. I don't know how to express the loglikelihood
function of
1/(x!) where x=x1,x2,....xn in R.
Could anyone give me a hint?
Thank you in advance.
Chunhao Tu
2002 Aug 07
1
ESS assigns .Last.value to the wrong place in R
I repeat my emails of 11/15/01 and 2/26/02, since it looks like this ESS bug is
still not fixed in ESS 5.1.23, and I think some resolution is needed.
When help() is invoked, ESS makes a copy of .Last.value in the .GlobalEnv,
which is *not* where R normally stores it (R stores it in package:base).
When this copy becomes stale it leads to wrong answers. The bug is in
essd-r.el, lines 63-64:
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.
2003 Mar 04
3
question on latticeParseFormula (PR#2602)
This feels like inconsistent behavior. latticeParseFormula works the
way I anticipated for factor, but not for ordered. I want the
behavior I see with tmp2, but not with tmp. My next step is to use
the right.name to isolate the tmp2[,c("a","b")] columns.
tmp <- data.frame(y=(1:12)+.1,
a=factor(rep(1:3,4)),
b=ordered(rep(1:4,
2006 Nov 15
1
OPTIM--non finite finite different [13]
Dear All:
I used optim() to minimise the loglikelihood function for fitting data to negative binomial distribution. But there initial value of log-likelihood and iteration 10 value are reasonable. for example:
initial value 1451657.994524
iter 10 value 47297.534905
iter 20 value -623478636.8236478
Then the iter 20 vlaue suddelnly changes to a negative value and in the end the error mesage is
2011 Feb 01
6
help
PLEASE HELP
I actually want to do the following:
a[j] = (1/(j!))*Π (i-1-d), j = 500, Π means product i = 1 to
j
Yet, j! will stop at 170 and Π (i-1-d) at 172; so, a[j] will
not exceed 170.
I would like to have at least 200 a[j].
WHAT SHOULD I DO?
PLEASE SEE MY CODE FOR DETAIL!!
####################################################
R CODE:
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
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 Apr 23
1
several bugs (PR#918)
# 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@r-project.org
#
######################################################
1. as.numeric behaves differently in R than in S and I think this
shows a bug in how S3
2000 Mar 17
1
optim: problem with additional arguments (PR#493)
The R function "optim" fails when a function requires additional
arguments, if the option "hessian=T" is specified. I am using R Version
1.0.0 on Windows 98.
Here is an example of the Rosenbrock Banana function from the optim help
example, with the function and gradient modified to take an additonal
argument. Note that the call to optim works fine unless a hessian is