使用matlab进行分箱后的RMSE计算

时间:2016-12-14 12:10:18

标签: matlab binning goodness-of-fit

嗨我想计算RMSE,但似乎我犯了一些逻辑错误。这是我给出的以下代码:

topEdge = 20; % upper limit 
botEdge = 5; % lower limit
numBins = 40;   % define number of bins 
b_vector = speed; a_vector = power;
[N,edges,bins] = histcounts(b_vector,numBins);
Pow_means = [];
speed_means = [];

  For n = 1:numBins
    Pow_means(n,1) = mean(a_vector(bins==n,1));  % for each bins mean value calculation.
   speed_means(n,1) = mean(b_vector(bins==n,1));  % for each bins mean value calculation.
   pow_std(n,1) = std(a_vector(bins==n,1));       % for Standard deviation calculation
  end

residual = power -Pow_means; RMSE = rms(residual); variation = RMSE/mean(power);

我的计算RMSE的方法是否正确?或者我需要做些什么来计算RMSE

0 个答案:

没有答案