Displaying 20 results from an estimated 11000 matches similar to: "About 'choose' function"
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]]
2000 Oct 04
2
gamma and lgamma functions (PR#684)
The following seems very strange:
> lgamma(-0.04)
[1] 3.243307
> gamma(-0.04)
[1] -25.61830
Jim
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 the subject !) To:
2010 May 05
1
testInstalledBasic question
Hi,
I'm currently in the process of writing an R-installation SOP for my
company. As part of that process I'm using the recommendations from the 'R
Installation and Administration' document, section 3.2, "Testing an
installation". This is done on an XP machine, using the latest binary of
2.11.0.
The binary is downloaded and then installed from the installer. I then
2011 Feb 09
3
precision of gamma function
Dear R users,
I have to calculate gamma functions for negative numbers beyond -171.4.
e.x. gamma(-500.4)
I got following:
> gamma(-170.4)
[1] -5.824625e-308
> gamma(-171.4)
[1] 0
Warning message:
underflow occurred in 'gammafn'
I have tried to use a recursion getting values a little futher -180.
How could I solve this problem? Thank you beforehand.
Chuse.
2010 Jul 05
2
Function to compute the multinomial beta function?
Dear R-users,
Is there an R function to compute the multinomial beta function? That is, the normalizing constant that arises in a Dirichlet distribution. For example, with three parameters the beta function is Beta(n1,n2,n2) = Gamma(n1)*Gamma(n2)*Gamma(n3)/Gamma(n1+n2+n3)
Thanks in advance for any assisstance.
Regards,
Greg
[[alternative HTML version deleted]]
2005 Dec 05
3
The gamma function and infinity
I have to calculate some formula like:
gamma(x)/(gamma(x+y)
and I observed that for relatively big values of x, R
returns infinity and so cannot compute the formula. Is
it possible to force R to give the real value of
gamma(x) instead of Inf ?
thanks
2008 Apr 18
3
help me to debug this part of code?
I am trying to solve the integration equation, for different values of K from
4 to 25, the integration is with respect to u,
Here is the equation: gamma(k/2) / ( sqrt(k-1)*gamma((k-1)/2) ) *
integrate(f= (1+u^2/k-1)^(-k/2), lower=0, upper= sqrt(a^2*k/(k+1-a^2)) ) =
the similar expression as te left hand except k becomes k+1
my code is below, I don't know why R keep telling me the syntax
2004 Jun 26
1
S4 group "Math", "getGroupMembers", "genericForPrimitive"
Hi,
I found the following on Windows 2000/NT
R Version 1.9.1 (2004-06-21) (also Version 1.9.0):
The S4 group "Math" doesn't work as documented; i.e., "log", "log10",
"gamma" and "lgamma" are included
in the documentation but don't work. See example code below.
Moreover, what about 'genericForPrimitive' which is used
in
2009 Apr 22
2
integrate lgamma from 0 to Inf
Dear R users,
i try to integrate lgamma from 0 to Inf. But here i get the message "roundoff error is detected in the extrapolation table", if i use 1.0e120 instead of Inf the computation works, but this is against the suggestion of integrates help information to use Inf explicitly. Using stirlings approximation doesnt bring the solution too.
## Stirlings approximation
lgammaApprox
2009 Oct 24
2
Implementation of gamma function for large number
Hi - I ran into a problem when the argument to gamma function is
large. Says, if I do the following:
> gamma(17000)
[1] Inf
Warning message:
value out of range in 'gammafn'
Is there anyway to get around this or other implementation? Thank you.
-rc
2009 Jul 15
1
GLM Gamma Family logLik formula?
Hello all,
I was wondering if someone can enlighten me as to the difference
between the logLik in R vis-a-vis Stata for a GLM model with the gamma
family.
Stata calculates the loglikelihood of the model as (in R notation)
some equivalent function of
-1/scale * sum(Y/mu+log(mu)+(scale-1)*log(Y)+log(scale)+scale*lgamma(1/scale))
where scale (or dispersion) = 1, Y = the response variable, and mu
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
2009 Nov 20
1
Bessel function with large index value
I am looking for a method of dealing with the modified Bessel function
K_\nu(x) for large \nu.
The besselK function implementation of this allows for dealing with
large values of x by allowing for exponential scaling, but there is no
facility for dealing with large \nu.
What would work for me would be an lbesselK function in the manner of
lgamma which returned the log of K_\nu(x) for large
2002 Dec 22
1
lgamma(-0.8)=?
Dear R users:
I wonder anyone is aware of such a thing from lgamma()
> lgamma(-0.8)
[1] 1.747207
I thought it should be NA as in S-PLUS. Both R-1.3.1 and R-1.5.1
report this result. I don't have the latest R-1.6.1 so I don't
know whether this is corrected or not.
Happy holidays,
Paul.
2008 Apr 02
3
Fwd: Re: Nonlinear equation
> > >From: robert-mcfadden w o2.pl
> > >Date: 2008/04/02 Wed AM 09:58:28 CDT
> > >To: r-help w r-project.org
> > >Subject: [R] Nonlinear equation
> >
> > hi: you need to give an example and details or
> > you won't get much response, if any.
Equation e.g. (A, B are known constants):
3log(gamma(x))-log(gamma(x)*gamma(2x))+(x-1)*A+B=0
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
2007 Oct 14
1
Extending deriv3()
Hello,
I was wondering if the functions deriv3(), deriv() etc. could be extended
to handle psigamma() and its special cases (digamma(), trigamma()
etc.). From the error message it seems that 'psigamma' needs to be
added to the derivatives table.
This might be easy since psigamma() has a deriv argument.
Additionally, this error message is also obtained when requesting for
the Hessian of
2005 Dec 29
1
trouble with S4 methods for group "Summary"
Hello. This question concerns the Methods package. I have created a
new class and am trying to set a method for it for S4 group generic
"Summary". I have run into some signature problems. An example:
> setClass("track", representation(x="numeric", y="character"))
[1] "track"
> setGeneric("max", group="Summary")
2010 Sep 29
1
how to to if a calculation is out range?
for example, when I am calculating a posterior density, I need to calculate
gamma(75*3+5)=gamma(220) which is out of the bound of gamma function. what
shall I do for this condition>
Thank you
[[alternative HTML version deleted]]
2007 Sep 10
1
MLE Function
I am just trying to teach myself how to use the mle function in R because it is much better than what is provided in MATLAB. I am following tutorial material from the internet, however, it gives the following errors, does anybody know what is happening to cause such errors, or does anybody know any better tutorial material on this particular subject.
>