Curve Fitting A Gamma function
Curve Fitting A Gamma function
(OP)
Can Excel curve fit discrete data points which when plotted produce a rough gamma curve. I am trying to get a smooth curve from my data points.
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
Curve Fitting A Gamma function
|
RE: Curve Fitting A Gamma function
But, you should be able to fit the data by using the solver routine to adjust the gamma function coefficients to reduce the residual errors (differences between the fitted function and the data points).
You may want to look at using a Weibull function to fit the data also; although statisticall analysis with a Weibull function is a little more work, it can be useful for other reasons.
RE: Curve Fitting A Gamma function
Function gammaln2(xx As Double)
' Returns the natural log of the Gamma Function
' Is equivalent to Application.WorksheetFunction.GammaLn
Dim ser As Double, stp As Double, tmp As Double, x As Double, y As Double
Dim cof(6) As Double
Dim j As Integer
cof(1) = 76.1800917294715
cof(2) = -86.5053203294168
cof(3) = 24.0140982408309
cof(4) = -1.23173957245015
cof(5) = 1.20865097386618E-03
cof(6) = -5.395239384953E-06
stp = 2.506628274631
x = xx
y = x
tmp = x + 5.5
tmp = (x + 0.5) * Log(tmp) - tmp
ser = 1.00000000019001
For j = 1 To 6
y = y + 1#
ser = ser + cof(j) / y
Next j
gammaln2 = tmp + Log(stp * ser / x)
End Function
RE: Curve Fitting A Gamma function
My Gamma function is :I(t)=P*t^s*e^(-f*t)
The natural log is :ln(t)=lnP+s*ln(t)-f*t
The linear equivalent:y= B(0)+ B(1)X(1)+B(2)X(2)
Now how do you propose the use your method with the above.
I should also mentioned that I did a regression for two independent variables which in my case would be X(1) and
X(2) and my result was 962*t^(4.12E-04)*e^(-8.52E-17). When plotted this equation looked atrocious. I did not even bother doing an error computation.
RE: Curve Fitting A Gamma function
Gamma(n)=integral(t^(n-1)*exp(-t)).
The only other forms for Gamma function I have found are asymptotic series expansions.
I don't understand what the question; I just checked the function--it returns ln(Gamma). Just use exponent "e" to convert to Gamma.
RE: Curve Fitting A Gamma function
http://of
search for "gamma" and they list GAMMADIST, GAMMAINV, AND GAMMALN
I think you can use these by typing in
Application.WorksheetFunction.GAMMADIST(x,alpha,beta,cumulative)
same as the normal distribution functions NORMDIST, etc.
RE: Curve Fitting A Gamma function
I think chicopee is needing a Gamma distribution, which apparently Excel can now provide
RE: Curve Fitting A Gamma function