Go to Post As usual, I mistakenly look for a technical solution to a social problem. - MrForbes [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 10-03-2015, 11:15
ArtemusMaximus's Avatar
ArtemusMaximus ArtemusMaximus is offline
Enginerd
FTC #11722
Team Role: Coach
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Canada
Posts: 248
ArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to all
Re: Math: How to solve ranking equation

Quote:
Originally Posted by Alan Anderson View Post
That formula is only relevant for district events. It converts ranking to "District Qualification Points". A comprehensive explanation of the Inverse Error Function belongs in an advanced statistics class. All you need to know is that it is built in to tools like Matlab.
I was curious about the function, did a little digging found someone already made one for Excel VBA. I hope this helps.
http://www.mrexcel.com/forum/excel-q...ml#post1146833
Code:
Function invERF(y As Double) As Double
Dim pi As Double, x As Double, d As Double
pi = 3.14159265358979
If y < 0 Then
    invERF = 0 'interval includes the mean only
    Exit Function
ElseIf y >= 1 Then
    invERF = 10 'makes the interval include everything
    Exit Function
'for my purposes, I only want the function to process input from 0 to 1
ElseIf y < 0.596 Then
    x = sqr(pi) / 2 * y * (1 + (pi / 12) * y * y)
Else
    x = sqr(-Log((1 - y) * sqr(pi)))
End If
d = (y - ERF(x)) / (2 * Exp(-x * x) / sqr(pi))
x = x + d
Do While Abs(d) >= 0.00000001
    d = (y - ERF(x)) / (2 * Exp(-x * x) / sqr(pi))
    x = x + d
Loop
invERF = x
End Function

Function ERF(x As Double) As Double

Dim f As Double, c As Double, pi As Double
Dim j As Integer
c = 0
pi = 3.14159265358979
If 1.5 < x Then
    c = 2 - c
    j = 3 + Int(32 / x)
    f = 0
    Do While j <> 0
        f = 1 / (f * j + x * sqr(2))
        j = j - 1
    Loop
    f = f * c * (3 - c * c) * Exp(-x * x) / sqr(2 * pi) + (c - 1) * (3 * c * c + c - 8) / 6
Else
    j = 3 + Int(9 * x)
    f = 1
    Do While j <> 0
        f = 1 + f * x * x * (0.5 - j) / j / (0.5 + j)
        j = j - 1
    Loop
    f = c + f * x * (2 - 4 * c) / sqr(pi)
End If
    ERF = f
End Function
Reply With Quote
  #2   Spotlight this post!  
Unread 10-03-2015, 14:21
MasterMentor's Avatar
MasterMentor MasterMentor is offline
TheGreatGonzo
AKA: George Gonzo
no team
Team Role: Alumni
 
Join Date: Jan 2015
Rookie Year: 2004
Location: Kansas
Posts: 29
MasterMentor will become famous soon enough
Re: Math: How to solve ranking equation

Quote:
Originally Posted by ArtemusMaximus View Post
I was curious about the function, did a little digging found someone already made one for Excel VBA. I hope this helps.
http://www.mrexcel.com/forum/excel-q...ml#post1146833
You just have to be careful about this, the input into InvERF with the District Qual Points Formula will be negative on one side of the [-1, 1] range, and this function can only handle positive input values. Also at the midpoint it's possible to get a divide-by-zero error with this function too. Both issues are easily worked around with a little formula/programming magic, but it's important to know this isn't a perfect drop-in solution.

-MM
Reply With Quote
  #3   Spotlight this post!  
Unread 10-03-2015, 15:42
who716's Avatar
who716 who716 is offline
Registered User
AKA: Stephen Kalogiannis
FRC #0716 (Who'sCTEKS)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Falls Village Connecticut
Posts: 424
who716 is a splendid one to beholdwho716 is a splendid one to beholdwho716 is a splendid one to beholdwho716 is a splendid one to beholdwho716 is a splendid one to beholdwho716 is a splendid one to beholdwho716 is a splendid one to beholdwho716 is a splendid one to behold
Re: Math: How to solve ranking equation

Basically the formula is given you just have to plug and chug, some calculators will have an inverse error function ability, if your does you find it use it and plug in the necessary values for the variables, N= number of teams at event, R=your final ranking position and alpha is a constant set by the committee based on averages of event size at 1.07. The lines on each end tell you just to round up to the nearest whole number give it a shot for our first event it would look like this:

invERF[( 33-2x13+2)/(1.07*33)]X(10/(invERF 1/1.07)+12) 13. ....... rounded up to nearest whole integer =14

remember inverse is NOT the same as going to the power of -1 if you don't have a calculator with the function already...

if you don't have this function at all on your calculator then it gets much more complicated solving for invERF as its a function itself requiring integrals and such
__________________
2014-
-WPI number one seed
-Innovation in controls award
- NECMP#4 seed semifinalist
- 9th in NEW ENGLAND

2008- Connecticut regional winners
2004-UTC new England regional Winners
2001 highest rookie seed award winner

Last edited by who716 : 11-03-2015 at 15:05.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-03-2015, 17:56
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,071
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Math: How to solve ranking equation

Quote:
Originally Posted by who716 View Post
invERF[( 33-2x13+2)/(1.07*33)]X(10/(invERF 1/1.07)+12) 13. ....... rounded up to nearest whole integer =14

remember inverse is the same as going to the power of -1 if you don't have a calculator with the function already...
The inverse of a function f(x) is not 1/f(x).

The inverse of f(x) is g(x), such that g(f(x))=x

For example, the inverse of f(x)=x2 is g(x)=sqrt(x), not 1/x2

Code:
octave-3.6.4.exe:10> erfinv(0.33)
ans =  0.301332146133706
octave-3.6.4.exe:11> 1/erf(0.33)
ans =  2.78335488667249

Reply With Quote
  #5   Spotlight this post!  
Unread 10-03-2015, 18:09
MooreteP's Avatar
MooreteP MooreteP is offline
Zen Archer
AKA: Senor Mas
FRC #0571 (Team Paragon)
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 1998
Location: Windsor CT
Posts: 808
MooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond reputeMooreteP has a reputation beyond repute
Re: Math: How to solve ranking equation

Plus, for Qualifications, if the number of teams is not divisible by six, there are surrogate matches, which are the third match for teams that fill the surrogate role.

More Math!
Reply With Quote
  #6   Spotlight this post!  
Unread 11-03-2015, 06:48
ATannahill ATannahill is offline
Registered User
AKA: Alex Tannahill
no team
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Southfield, Michigan
Posts: 3,258
ATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond repute
Re: Math: How to solve ranking equation

Quote:
Originally Posted by MooreteP View Post
Plus, for Qualifications, if the number of teams is not divisible by six, there are surrogate matches, which are the third match for teams that fill the surrogate role.

More Math!
Not quite correct.

If the number of teams * the number of matches per team is not a multiple of six, then you will have surrogates.

Michigan (and I believe most other district systems) gives each team 12 matches. A benefit to this is that there will never be a surrogate.
Reply With Quote
  #7   Spotlight this post!  
Unread 10-03-2015, 18:10
ArtemusMaximus's Avatar
ArtemusMaximus ArtemusMaximus is offline
Enginerd
FTC #11722
Team Role: Coach
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Canada
Posts: 248
ArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to all
Re: Math: How to solve ranking equation

Quote:
Originally Posted by Ether View Post
The inverse of a function f(x) is not 1/f(x).

The inverse of f(x) is g(x), such that g(f(x))=x

For example, the inverse of f(x)=x2 is g(x)=sqrt(x), not 1/x2

Code:
octave-3.6.4.exe:10> erfinv(0.33)
ans =  0.301332146133706
octave-3.6.4.exe:11> 1/erf(0.33)
ans =  2.78335488667249

I knew Ether would show up and clear all this up
Reply With Quote
  #8   Spotlight this post!  
Unread 10-03-2015, 18:15
Richard Wallace's Avatar
Richard Wallace Richard Wallace is offline
I live for the details.
FRC #3620 (Average Joes)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1996
Location: Southwestern Michigan
Posts: 3,646
Richard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond repute
Re: Math: How to solve ranking equation

Quote:
Originally Posted by ArtemusMaximus View Post
I knew Ether would show up and clear all this up
When the student is ready, the master appears.
__________________
Richard Wallace

Mentor since 2011 for FRC 3620 Average Joes (St. Joseph, Michigan)
Mentor 2002-10 for FRC 931 Perpetual Chaos (St. Louis, Missouri)
since 2003

I believe in intuition and inspiration. Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution. It is, strictly speaking, a real factor in scientific research.
(Cosmic Religion : With Other Opinions and Aphorisms (1931) by Albert Einstein, p. 97)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi