Hi,
the formula for Theil's U that you get in gretl's fcstats() doesn't work
if (some of) the values of y are zero (division by zero problem). I'm
not an expert in these measures and haven't spent much time on this, but
I came across a claim that another formula would also represent Theil's
U; for that other formula zeros are not a problem, and below I include a
straightforward function implementation of that other formula. Haven't
checked yet whether for non-zero y the two approaches produce the same
value.
Can anybody clarify the relationship between these approaches?
thanks,
sven
function scalar manualTheilU(matrix y, matrix f)
numerator = sqrt(mean((y-f).^2))
denom1 = sqrt(mean(f.^2))
denom2 = sqrt(mean(y.^2))
return numerator/(denom1+denom2)
end function