![](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!