Go to Post If you don't like contact, your robot is not built well enough. - sanddrag [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

 
 
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #8   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
 


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 14:04.

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