Distance Measure

This function allows to measure the distance between a real series and a predicted or estimated one.
220 Downloads
Updated 9 Jun 2015

View License

distmeasure Distance Measure
err = distmeasure(Y,Yf,type) gives the distance between the real series Y
and the predicted or estimated one Yf. Y and Yf must be two column or row
vectors with the same lenght and size. They must contain only real
values.
The kind of distance is chosen through the input string type.

Y = Real series

Yf = Estimated series

type = Type of distance measure, namely: Mean Absolute Error (MAE), Mean
Absolute Percentage Error (MAPE), Root Mean Square Error (RMSE), Root
Mean Square Percentage Error (RMSPE), Mean Error (ME), Mean Percentage
Error (MPE), Mean Square Error (MSE), Mean Square Percentage Error
(MSPE).

Sample usage:

Y = rand(1,1000);
Yf = rand(1,1000);

err = distmeasure(Y,Yf,'RMSE')

Cite As

Flavio Prattico (2024). Distance Measure (https://www.mathworks.com/matlabcentral/fileexchange/51126-distance-measure), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Conditional Mean Models in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0