
This post has NOT been accepted by the mailing list yet.
Hi. I need to calculate an aggregated distribution as the populationweighted sum of the subgroup densities. The underlying distributions are assumed to be Weibulls. I have Weibull parameters (a,b) and population weights (w) in vectors as in:
a=c(1.12,1.44,1.56,...);
b=c(3345.5,4667.2,12987.1,...);
w=c(0.227,0.217,0.05,..);
To calculate the aggregated (y) i used the following codes:
p=seq(0,100000,length.out=500000);
y= rep(0,length(p));
for (i in 1:n)
{ y = y + w[i]*dweibull(p, shape=a[i], scale=b[i] }
However, I am not perfectly sure of my results. I expected to see more "humps" where bigger subgroups' scale parameters are located.
Any suggestions for improvements?
