Performance parameters - Mean square error (MSE) code question

6 views
Skip to first unread message

jw.lu...@gmail.com

unread,
Jun 24, 2022, 3:47:10 AM6/24/22
to netlogo-users
I have been using MSE and RMSE to assess performance of my model for calibration and validation purposes.

And the code that I use for MSE, which I got from a youtube channel, https://www.youtube.com/watch?v=wMR-CEv1MVc&t=497s, is as follows:

to-report compute-MSE [series 1 series 2]

let l1 length series1
let l2 length series2
let l min (list l1 l2)

let minlist []
let maxlist []
if (l = l1) [ set minlist series1 set maxlist series2 ]
if (l = l2) [ set minlist series2 set maxlist series1 ]

set maxlist sublist maxlist 0 l

let sqd-errors (map [  [?1 ?2] -> (abs ?1 - ?2) ^ 2 ] maxlist minlist)
let mse (sum sqd-errors) / l

report mse
end


I modified this code to fit my simulation model, but I am ashamed to admit that I do not fully understand the code, and currently, problems are arising as I try to modify it to code other error parameters such as "index of agreement" or "Model efficiency"


My questions are,

1) why is it not
let sqd-errors (map [  [?1 ?2] -> (abs (?1 - ?2)) ^ 2 ] maxlist minlist)

 instead of the original, which is 

let sqd-errors (map [  [?1 ?2] -> (abs ?1 - ?2) ^ 2 ] maxlist minlist)


2) how do you guys calculate or code model performance parameters like MSE/RMSE/IoA etc.?


Thank you for your help.
Luke Kho

Pradeesh Kumar K V

unread,
Jun 24, 2022, 9:25:56 AM6/24/22
to netlogo-users
Hello Luke Kho,

I don't see a reason why the abs function is required because the squaring operation will always yield a positive value. And providing abs only for one of the values (as shown in the video) may yield incorrect results.

Best,

Pradeesh


--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/6e4b35da-592c-41a5-b70d-d4780972d828n%40googlegroups.com.

James Steiner

unread,
Jun 26, 2022, 8:08:02 PM6/26/22
to jw.lu...@gmail.com, netlogo-users
Hey. To answer your question, I'd ha e to read up on what the MSE is, and look for other sources for the algorithm. I suggest you do the same. 

There are a few reasons the formula might be that way:

Perhaps The original expression was

 | a - b | ²

 and this was mis-translated to

( abs a - b ) ^ 2

The author thought that ABS would bind to the result of  a - b

Perhaps that's the correct formula:

( | a | - b ) ²


--
Reply all
Reply to author
Forward
0 new messages