フィルターのクリア

Please help me understand what happens to the matrices bellow

1 回表示 (過去 30 日間)
farzad
farzad 2015 年 3 月 15 日
回答済み: Greg Heath 2015 年 3 月 16 日
Hi All
I have a matrix t [3 1000]
and then these lines :
y00 = repmat( mean(t,2), 1, size(t,2))
MSE00 = mse( t - y00 )
MSE00 = mean(var(t',1))
nperf = mse(t-y)/MSE00
what does each line do ??
  4 件のコメント
Roger Stafford
Roger Stafford 2015 年 3 月 15 日
The line "repmat( mean(t,2), 1, size(t,2))" first takes the mean value of each of the three rows of matrix 't', giving a 3-by-1 column vector as a result. Then the 'repmat' operator repeats this vector along the second dimension so that it is again of size 3-by-1000. Each of its thousand columns will then be the same.
dpb
dpb 2015 年 3 月 15 日
NB: that bsxfun will allow writing the following lines w/o the explicit expansion, too...highly recommended as long as the version in use incorporates it (which is getting to be quite some time ago now altho I don't recall just when that was).

サインインしてコメントする。

採用された回答

Greg Heath
Greg Heath 2015 年 3 月 16 日
The significance of the code is that MSE00 is a very special reference normalization value for mean-square-error.
Consider a net that yields the same output, regardless of input. Given a target matrix, what constant will minimize mean-square error?
When you work it out you will find that the constant should be the row-wise mean value of the target matrix.
Furthermore, the corresponding minimum mean-square-error is just the mean of the biased (i.e., divide by N, not N-1) row-wise variances.
If you consider the mean variance as a measure of how much information is in the target, the normalized MSE of any design
NMSE = mse(target-output)/MSE00
is a measure of the fraction of that target information that is NOT modelled by the design and correspondingly the coefficient of determination
Rsquare = 1- NMSE
is a measure of the fraction of that target information that IS modelled by the design.
http://en.wikipedia.org/wiki/Coefficient_of_determination
I typically try to obtain a Rsquare value that corresponds to modeling at least 99% of the mean target variance.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by