gamma function with two parameters

23 views (last 30 days)
Dr. Shri Ramtej
Dr. Shri Ramtej on 28 Mar 2024
Edited: John D'Errico on 28 Mar 2024 at 12:00
i have to evaluate gamma function with two parameters. if i attempt to use gamma(a,b) i am getting error in matlab as too many input arguements. it is taking only one arguement. as per the attachment , how can i find the received power?
  2 Comments
VBBV
VBBV on 28 Mar 2024
Edited: VBBV on 28 Mar 2024
it uses single parameter for defining a characteristic, Beta function uses two parameters. Do you mean beta instead of gamma ? May be you mean incomplete gamma function , if thats what you want, then try this
Dyuman Joshi
Dyuman Joshi on 28 Mar 2024
"how can i find the received power?"
I don't understand what this means in the context of this question.
The mathematical definition of gamma function includes a single independent variable only, subsequently so does the matlab function gamma.
It's not clear what exactly you want to do.

Sign in to comment.

Answers (2)

Voss
Voss on 28 Mar 2024
Is this the function you mean to use?

John D'Errico
John D'Errico on 28 Mar 2024 at 11:57
Edited: John D'Errico on 28 Mar 2024 at 12:00
There is no common definition of a two parameter gamma "function" in mathematics. So whatever you are asking, you need to be more specific, if you have some specific thing you need to compute.
The two possibilities I can think of (and I am sure I may have missed something else, as there are infinitely many things you MIGHT want to do) are:
  1. A two parameter gamma probability distribution
  2. An incomplete gamma function
Each of those possibilities is available in MATLAB.
You can find the two parameter gamma PDF in the form of
help gampdf
GAMPDF Gamma probability density function. Y = GAMPDF(X,A,B) returns the gamma probability density function with shape and scale parameters A and B, respectively, at the values in X. The size of Y is the common size of the input arguments. A scalar input functions as a constant matrix of the same size as the other inputs. Some references refer to the gamma distribution with a single parameter. This corresponds to the default of B = 1. See also GAMCDF, GAMFIT, GAMINV, GAMLIKE, GAMRND, GAMSTAT, GAMMA, GAMMALN. Documentation for gampdf doc gampdf Other uses of gampdf distributed/gampdf gpuArray/gampdf
And the incomplete gamma function, which is really an integral where the second parameter is the upper limit for that integral. MATLAB normalizes this integral by then dividing by gamma(x), because most of the time, that is how you will be using it.
help gammainc
GAMMAINC Regularized incomplete gamma function. Y = GAMMAINC(X,A) evaluates the regularized incomplete gamma function for corresponding elements of X and A. The elements of A must be nonnegative. X and A must be real and the same size (or either can be a scalar). The regularized incomplete gamma function is defined as: gammainc(x,a) = 1 ./ gamma(a) .* integral from 0 to x of t^(a-1) exp(-t) dt For any a>=0, as x approaches infinity, gammainc(x,a) approaches 1. For small x and a, gammainc(x,a) ~ x^a, so gammainc(0,0) = 1. Y = GAMMAINC(X,A,TAIL) specifies the tail of the regularized incomplete gamma function when X is non-negative. Choices are 'lower' (the default) to compute the integral from 0 to X, or 'upper' to compute the integral from X to infinity. These two choices are related as GAMMAINC(X,A,'upper') = 1 - GAMMAINC(X,A,'lower'). When the upper tail value is close to 0, the 'upper' option provides a way to compute that value more accurately than by subtracting the lower tail value from 1. Warning: When X is negative, Y can be inaccurate for abs(X) > A+1. Y = GAMMAINC(X,A,'scaledlower') and GAMMAINC(X,A,'scaledupper') return the regularized incomplete gamma function, scaled by GAMMA(A+1)*EXP(X)/X^A. These functions are unbounded above, but are useful for values of X and A where GAMMAINC(X,A,'lower') or GAMMAINC(X,A,'upper') underflow to zero. See also GAMMAINCINV, GAMMA, GAMMALN, PSI. Documentation for gammainc doc gammainc Other uses of gammainc codistributed/gammainc gpuArray/gammainc tall/gammainc
Again, you may want to do something else. I've only made my two best guesses at what you may be thinking about.

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!