| View previous topic :: View next topic |
| Author |
Message |
jeff_sadowski Newbie

Joined: 05 Jul 2006 Posts: 2
|
Posted: Wed Jul 05, 2006 1:27 pm Post subject: Is there a way to use the gamma function? |
|
|
| 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 |
|
 |
jrkrideau Super User

Joined: 08 Aug 2005 Posts: 6733 Location: Kingston ON Canada
|
Posted: Wed Jul 05, 2006 1:38 pm Post subject: Re: Is there a way to use the gamma function? |
|
|
| 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 |
|
 |
Dale Super User

Joined: 21 Feb 2005 Posts: 1440 Location: Australia
|
Posted: Wed Jul 05, 2006 10:23 pm Post subject: |
|
|
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 |
|
 |
jrkrideau Super User

Joined: 08 Aug 2005 Posts: 6733 Location: Kingston ON Canada
|
Posted: Thu Jul 06, 2006 5:12 am Post subject: |
|
|
| 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 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 |
|
 |
jeff_sadowski Newbie

Joined: 05 Jul 2006 Posts: 2
|
Posted: Thu Jul 06, 2006 6:23 pm Post subject: |
|
|
Thank you dale
=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 |
|
 |
|