Skip to content

Instantly share code, notes, and snippets.

@jonasalmeida
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonasalmeida/73e9a5d1af95da43e093 to your computer and use it in GitHub Desktop.
Save jonasalmeida/73e9a5d1af95da43e093 to your computer and use it in GitHub Desktop.
Residua Distribution of signs
// One way to measure goodness of fit is to
// assess the even distribution of values arround
// the regression line. This is a non-parameric
// approach that is not sensitive to the magitude
// of the noise, only to its structure
RSD={
res2sign:function(r){ // counts same-sideness of residuals in array r
var rs = 0
for(var i=1;i<r.length;i++){rs+=((r[i]*r[i-1])>0)}
return rs
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment