How to calculate mean average percentage error in Matlab? (single array division)

11 views (last 30 days)
I have 2 variables A(1200x1 double),B(1200x1 double), and I want to get the mean value of their division result :
C=A./B; M=mean(C)
Is it correct to calculate this way?
Thank you and wish you will have a nice Christmas!
  1 Comment
Image Analyst
Image Analyst on 19 Dec 2016
A division is simply a division - a ratio. So what is the error? What are you considering to the "the error" in that division operation? Is something the "true" value? If so, what? What are the actual values? The C values? So are we supposed to get the difference between C and some "true" (ground truth) values? How can we compute the error(s) if we don't have both the true values and the estimated/noisy/guessed values?

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 18 Dec 2016
Edited: Star Strider on 19 Dec 2016
It would be nice to know how ‘A’ and ‘B’ relate to all this.
Assuming that ‘A’ is ‘experience_value’ and ‘B’ is ‘theoretical_value’, your equation becomes:
experience_value = A;
theoritical_value = B;
percentage error = (experience_value-theoritical_value)./theoritical_value*100;
Make appropriate changes to reflect the actual significance of your vectors.
___________________
EDIT Answering with respect to the information suppied in the edited Question:
‘Is it correct to calculate this way?’
Yes.

More Answers (1)

John BG
John BG on 19 Dec 2016
Edited: John BG on 19 Dec 2016
'a priori' i see 4 possibilities, i hope you don't mind me using horizontal A and B instead of vertical:
A=[1:10];B=1:2:20;m1=mean(A\B)
sz1=size(A/B)
A=[1:10];B=1:2:20;m2=mean(A.\B)
sz2=size(A./B)
A=[1:10];B=1:2:20;m3=mean(A/B)
sz3=size(A\B)
A=[1:10];B=1:2:20;m4=mean(A./B)
sz4=size(A.\B)
m1 =
Columns 1 through 3
0.010000000000000 0.030000000000000 0.050000000000000
Columns 4 through 6
0.070000000000000 0.090000000000000 0.110000000000000
Columns 7 through 9
0.130000000000000 0.150000000000000 0.170000000000000
Column 10
0.190000000000000
sz1 =
1 1
m2 =
1.707103174603175
sz2 =
1 10
m3 =
0.537593984962406
sz3 =
10 10
m4 =
0.606662776507978
sz4 =
1 10
or the actual value that you may need is
m5=nean(A)/mean(B)
m5 =
0.550000000000000
m6=mean(A)\mean(B)
m6 =
1.818181818181818
i hope you don't mind asking the following questions:
1. what is it the objective of your calculations?
2. what are A and B?
3. what is your choice, my guess woudl be, from your question, m1
but since in your question you are already guessing, a guess of a guess doesn't reduce the uncertainty, does it?
awaiting answer to complete my answer
John BG

Community Treasure Hunt

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

Start Hunting!