0

I need help with gamma distribution in R, I want to choose randomly N samples (N=1200) in different sizes n (n=10, n=100 etc.) from gamma distribution where alpha=4.3 and beta=2.1.

I have to set.seed(a) where a is number of four digits, and I have to find the Maximum likelihood estimation for both alpha a beta and also with the Method of moments for both of them.( in interval (0.1,100)) I'm having a problem with how to start the simulation code; do I start by defining X as a seq and then set a seed? If so, where/ how to put the N and different values of n in consideration? And the alpha and beta ...?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
data_girl
  • 1
  • 1
  • 2
    Look at the manual page for `rgamma` (`?rgamma). That should get you started. Set the seed (?set.seed) and then draw a sample. Then use that sample with the maximum likelihood and method of moments. Once you figure out how to do it with, it will not be difficult to repeat the process many times. – dcarlson May 09 '21 at 22:45
  • Thanks for the suggestion. On further investigating, this seems to be already answered - [How would you fit a gamma distribution to a data in R?](https://stackoverflow.com/questions/45536234/how-would-you-fit-a-gamma-distribution-to-a-data-in-r). – dcarlson May 19 '21 at 16:57
  • Does this answer your question? [How would you fit a gamma distribution to a data in R?](https://stackoverflow.com/questions/45536234/how-would-you-fit-a-gamma-distribution-to-a-data-in-r) – Peter O. May 20 '21 at 11:32

0 Answers0