calculating rmse between observations and estimates of different size
显示 更早的评论
I would like to calculate rmse between observations and estimates of different size. This are two timeseries, one 84084x1 and the second is 315360x1.
采纳的回答
更多回答(1 个)
Youssef Khmou
2013-9-3
编辑:Youssef Khmou
2013-9-3
You can padd the small vector with zero or Interpolate as mentioned by @Thomas :
% Given your vectors r1 r2
r1=randn(315360,1);
r2=randn(84084,1);
N1=length(r1);
N2=length(r2);
Ratio=floor(N1/N2);
r22=interp(r2,Ratio);
Diff=N1-length(r22);
r22=[r22;zeros(Diff,1)];
plot(r1), hold on, plot(r22,'r'),
RMSE=sqrt(mean(((r22-r1).^2)))
You can also use the functions downsample or upsample
2 个评论
Sergio
2013-9-3
Youssef Khmou
2013-9-3
编辑:Youssef Khmou
2013-9-3
Sergio, transpose vectors r1=r1'; r2=r2' or try again the edited code .
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Model Identification 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!