Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Generate random number from inverse gamma distribution

Asked by khatereh

khatereh (view profile)

on 27 May 2012

Hi, I want to get the sample from the inverse gamma distribution with two parameter a and b and I am wondering how I can do that in matlab? Please help me ! Thanks

0 Comments

khatereh

khatereh (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Tom Lane

Tom Lane (view profile)

on 27 May 2012

If I understand the inverse gamma correctly, you can generate from x=gamrnd(a,1./b) and then take y=1./x. This would require the Statistics Toolbox.

0 Comments

Tom Lane

Tom Lane (view profile)

Answer by mengfei

mengfei (view profile)

on 19 May 2013

agree

0 Comments

mengfei

mengfei (view profile)

Contact us