Re: Altering Gamma Distribution scale and shape parameters
- From: "Tom Lane" <tlane@xxxxxxxxxxxxx>
- Date: Thu, 28 May 2009 11:35:48 -0400
Thabo, the solution is not going to be unique, since you have two parameters
to play with.
Try fixing the first (shape) parameter at a value larger than 1. The value 5
worked for me. It gives a distribution that has a
positive mode (in contrast with the value 1 which has the mode at 0).
You might find it convenient to create and play with the following two
functions:
f = @(p) gamcdf(200,5,p)-gamcdf(100,5,p); % try plotting this
g = @(p) f(p) - 0.5; % try using this with the fzero function
-- Tom
"Thabo" <thabotharan@xxxxxxxxx> wrote in message
news:27e526c3-a371-411d-b45c-2ce39ed44968@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,
I am sending this mail with the hope of that someone suggest me a good
solution.
In one of my case studies I would like to find the difference between
the probabilities of two points say 100 and 200 in a gamma
distribution so that my expected probability (say 0.50 or the area
under the curve = 0.5) is found between these two points. I want to
find the shape and the scale parameters that produce a gamma
distribution such that the prob= 0.50 between 100 and 200. I also want
to use these shape and scale values to reproduce a set of numbers
using the MATLAB gamrnd function so that 50% of such numbers lie
between 100 and 200.
In order to accomplish this, I started with the scale and shape
parameters 0.1 and 0.1 respectively and increase them. I keep on
increasing the scale value by 0.1 in a loop until it reaches 1000 and
then bring it back to 0.1 and increase the shape by 0.1 and put both
of them in the same previously mentioned loop until I find the
difference between the probability is equal to 0.5.
I was able to find the values of scale and shape values successfully.
Now when I input these two values of shape and scale values in the
MATLAB gamrnd function and generate 10000 numbers, I do not get number
values to lie in the interval as I expected.
What am I doing wrong here. Or is it the sample space (10000 numbers
is too small to observe any variations.?)
Any help is really appreciated.
Thanks,
Thabo
.
- References:
- Prev by Date: Advancing line
- Next by Date: Re: undefined function
- Previous by thread: Altering Gamma Distribution scale and shape parameters
- Next by thread: How to check alphanumeric string
- Index(es):
Relevant Pages
|
Loading