I am trying to create this function in MATLAB. From a previous question, I have solved for a as "agrid2" and f(a) as "fx", whose dimensions are 6001 and 6002- these two vectors are absolutely correct:
%calculating gini coefficent m=600; for i=1:m %expanded length of kgrid of ai previously calculated in invarden.m mu= sum(agrid2.*fx(m,:)); gini= sum(fx(m,1)*(fx(m,2))*abs(fx(m,1)-fx(m,2)))./(2*mu); end
However, my code is returning all blank answers- what did I do wrong? Any advice is greatly appreciated!
https://stackoverflow.com/questions/65402689/dimensional-problem-with-simple-coefficient-equation December 22, 2020 at 10:56AM
没有评论:
发表评论