Calculating Root Mean Square Error (RMSE)
5 views (last 30 days)
Show older comments
Hello,
I am rather new to MATLAB and need help calculating RMSE for single variable time series data. The data is cloud cover percentage from a weather model (predicted variable) and a camera (observed variable). I was able to calcluate the RMSE comparing the same times but now I want to compare different times of the predicted and observed data. I would like to do a 1 day ahead persistence forecast. A persistence forecast is a forecast in which assumes the future weather condition will be the same as the present condition. (Today equals tomorrow) The persistence forecast is often used as a standard of comparison in measuring the degree of skill of forecasts becasue the persistence forecast (non-skilled) should be much less accurate than the skilled forecast (weather model). Attached is a csv file of the cloud cover data. There are cloud cover percentages from the weather model "HRRR" and the camera. There are 3 cylces per day (15Z, 18Z, 21Z) for December 2018 through Februrary 2019.
I am interested in comparing and calculating the persistence RMSE for 1 day ahead. Meaning the 15z, 18z, 21z HRRR cloud cover percentage for December 1 2019 will be compared to the 15z, 18z, 21Zz December 2 2019 camera cloud cover percentage and so on. Any help or advice to approach this would be greatly appreciated! I can do it easily in Excel but I am trying to learn to do it in MATLAB so I can also do other winter and summer seasons much easier and quicker. Thanks!
3 Comments
David Hill
on 19 Jun 2020
Your data is not completely consistent. Some days have repeat values at various times and other dates are missing some times. If your data was consistent, you could easily just reshape the need table columns. If you clean up your data set then you could do the following.
t=readtable('data.csv');
hrrr=rms(reshape(t.hrrr_cloud_cover,3,[]),1);%row vector of every day's rms value
camera=rms(reshape(t.camera_cloud_cover,3,[]),1);
%then you could do a comparison
error=hrrr(1:end-1)-camera(2:end);%not sure what kind of comparison you want to do. This is simple difference.
Answers (0)
See Also
Categories
Find more on Weather and Atmospheric Science in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!