![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/472387/image.png)
normalisation and reverse process _Forecasting _mean standard deviation
5 ビュー (過去 30 日間)
古いコメントを表示
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))
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/454493/image.png)
0 件のコメント
回答 (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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/472387/image.png)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!