how can i estimate parameters of two independent gamma distributed variables with one same parameter in matlab?

2 次查看(过去 30 天)
Suppose we have two independent random variables $X_1$ and $X_2$ where $X_1 \sim (\alpha_1, \beta)$ and $X_2 \sim (\alpha_2, \beta)$. how can i estimate three parameters $(\alpha_1, \alpha_2, \beta)$ from given data for $X_1$ and $X_2$?

采纳的回答

Akira Agata
Akira Agata 2018-3-9
I think one possible way to do this is to use maximum likelihood estimation method, like:
% Sample data
X1 = gamrnd(2,10,1000,1);
X2 = gamrnd(5,10,1000,1);
% Fit each data to Gamma distribution
pd1 = fitdist(X1,'Gamma');
pd2 = fitdist(X2,'Gamma');
% Assume beta = (beta1 + beta2)/2, and estimate alpha1 and alpha2
beta = (pd1.b + pd2.b)/2;
alpha1 = mle(X1,'pdf',@(X1,alpha1) gampdf(X1,alpha1,beta),'start',pd1.a);
alpha2 = mle(X2,'pdf',@(X2,alpha2) gampdf(X2,alpha2,beta),'start',pd2.a);
  7 个评论
xosro
xosro 2018-3-9
编辑:xosro 2018-3-9
I'm sorry. As it is mentioned above (Walter Roberson and Torsten), conditions 1 and 2 are correct. I was trying to describe the question in the form of simple, But it is possible that b is replaced with (1-a) but this is not used in general form (l1*X1+l2*X2+...+ln*Xn).
I may use the following form:
y=l(1)/sum(l)*X1+...+l(n)/sum(l)*Xn
I should try this.
Torsten
Torsten 2018-3-9
You shouldn't do that since it makes your problem nonlinear in the l's.
You should work with
Y = l1*X1+...+ln*Xn
sum(li) = 1
li >= 0
and use lsqlin to estimate the li's.
Best wishes
Torsten.

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by