0

嗨,我想计算 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

4

0 回答 0