normalisation and reverse process _Forecasting _mean standard deviation

4 ビュー (過去 30 日間)
NN
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).
Please help as i dont understand where i did mistake ..
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"])
ylabel("SolarIrradiance")
title("Forecast with Updates")
rmse = sqrt(mean((YPred1-YTest).^2))
figure
plot(YPred)
hold on
plot(qn,'.-')
hold off
legend(["Observed" "Predicted"])
ylabel("SolarIrradiance")
title("Forecast with Updates")
rmse = sqrt(mean((YPred-qn).^2))

回答 (1 件)

Karan Nandankar
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.

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by