normalisation and reverse process _Forecasting _mean standard deviation

조회 수: 17(최근 30일)
NN 2020년 12월 8일
답변: Karan Nandankar 2020년 12월 28일
I am getting different rmse value for forecasted value for almost similar look plots.
please check the attached plot .
First one is plotted with standardised data(rmse= 0.2) and second one is plotted with reversed values(rmse=190).
Below is the code which i have used :
pn=normalize(XTrain);
tn=normalize(YTrain);
rn=normalize(XTest);
qn=normalize(YTest);
[Z,gpamean,gpastdev] = zscore(XTrain);
[Z,gpamean1,gpastdev1] = zscore(XTest);
net = trainNetwork(pn,tn,layers,options);
YPred=predict(net,rn);
YPred1 = gpastdev1.*YPred + gpamean1;
figure
plot(YPred1)
hold on
plot(YTest,'.-')
hold off
legend(["Observed" "Predicted"])
rmse = sqrt(mean((YPred1-YTest).^2))
figure
plot(YPred)
hold on
plot(qn,'.-')
hold off
legend(["Observed" "Predicted"])
rmse = sqrt(mean((YPred-qn).^2))

댓글을 달려면 로그인하십시오.

답변(1개)

Karan Nandankar 2020년 12월 28일
Hi,
As I can see you're trying to map z-score parameters of XTest to calculate inverse of normalized YPred. You may try the following code to compute normalized dependent variable and its inverse.
[qn, mean1, stdev1] = zscore(YTest); %Normalization
%
%
YPred = predict(net, rn);
YPred1 = stdev1*qn + mean1; % Inverse
However, it is expected to obtain higher values of RMSE on unscaled data (having higher range) with respect to Normalized data. The idea is to calculate performance measures in the same order of magnitude, i.e. order of your initial unscaled response variable.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by