OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Is there a way to use the gamma function?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
jeff_sadowski
Newbie
Newbie


Joined: 05 Jul 2006
Posts: 2

PostPosted: Wed Jul 05, 2006 1:27 pm    Post subject: Is there a way to use the gamma function? Reply with quote

I would like to have the capabilities of using the gamma function like I can with gnome's version of a spred sheet. It would be useful as a factorial function to use in higer percition graphing of things that use the factorial function. the problem with graphing using the factorial function is that it jumps at the integer where as the gamma function is smooth.
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6732
Location: Kingston ON Canada

PostPosted: Wed Jul 05, 2006 1:38 pm    Post subject: Re: Is there a way to use the gamma function? Reply with quote

jeff_sadowski wrote:
I would like to have the capabilities of using the gamma function like I can with gnome's version of a spred sheet. It would be useful as a factorial function to use in higer percition graphing of things that use the factorial function. the problem with graphing using the factorial function is that it jumps at the integer where as the gamma function is smooth.


Help GAMMADIST function ?
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
Back to top
View user's profile Send private message
Dale
Super User
Super User


Joined: 21 Feb 2005
Posts: 1440
Location: Australia

PostPosted: Wed Jul 05, 2006 10:23 pm    Post subject: Reply with quote

JRK - the gamma function is the non-integer and complex value analogue of the factorial function. It is different to the Gamma Distribution although they are related. Wikipedia has articles on the Gamma Function and Gamma Distribution - just in case you're interested.

+ + + + + +

I suspect that you could fiddle the parameters of the Gamma Distribution to get it to return something like the reciprocal of the Gamma Function provided a) you know what you're doing (I don't) and b) the algorithm Calc uses for the Gamma Distribution is accurate enough (who knows?)

I've had a look at the available functions, and there does not seem to be one for the Gamma Function. Likewise I couldn't see anything promising at ooomacros.org . There might be something at 8daysaweek's or richhill's sites. Have a look at oooforum's links page (there's a link on the left side of the home page) as well and see if there is anything helpful there.

Looking a bit further in the help file, there is a GAMMALN function that returns the log of the gamma function. A quick and dirty =EXP(GAMMALN(<number>)) seemed to give approximately correct values for small integers (there is a small error - about 1 in 10^10 - possibly rounding).
Aside - So why do we have a GAMMALN function but not a GAMMA function...?


If all you're after is a smooth line on a chart, when you choose your chart type, select a "Cubic Spline" or "B-Spline" sub-type of a line chart. This will plot smoothed lines.
_________________
Dale
To err is human, but to destroy your slippers in the process takes a real son of a bitch: Me!

OOo documentation from the source
http://documentation.openoffice.org
Guides, FAQ, How Tos
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6732
Location: Kingston ON Canada

PostPosted: Thu Jul 06, 2006 5:12 am    Post subject: Reply with quote

Dale wrote:
JRK - the gamma function is the non-integer and complex value analogue of the factorial function. It is different to the Gamma Distribution although they are related. Wikipedia has articles on the Gamma Function and Gamma Distribution - just in case you're interested.


Close enough for government work Smile Thanks, I did not read the post closely enough.
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
Back to top
View user's profile Send private message
jeff_sadowski
Newbie
Newbie


Joined: 05 Jul 2006
Posts: 2

PostPosted: Thu Jul 06, 2006 6:23 pm    Post subject: Reply with quote

Thank you dale Smile
=EXP(GAMMALN(<number>)) works good.

funny why they have gammaln and not gamma

I used it like so

=EXP(GAMMALN(A1+1))

I'll look into it more. Factorials seem to get out of control real fast so I'll see what happens.
This will probably be good enough for things I deal with thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group