RMSE calculation after binning using matlab

264 views Asked by At

Hi I want to calculate the RMSE but it seems that I am making some logical mistake.This is my given below code :

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);

Is my approach to calculate RMSE is correct ?? or what correction I have to make to calculate RMSE

0

There are 0 answers