Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Wow! Re: Slide rules at the ready!

Author: Eelco de Groot

Date: 06:57:34 04/21/05

Go up one level in this thread


I changed the Rtdiff routine so that it should now converge faster, using not a
slope of fixed 700 everytime but making use of the fact that I can calculate the
slope in Performance vs. Ratingdifference when assuming the normal distribution.
I believe this is similar to Newton's method, for finding the roots of a graph
or function numerically? But here I actually now the precise slope.

But if Hastings approximation is just not good enough or I have forgotten
another minus sign....it will of course not work... So I'll try to put this into
an actual program. I have never made macro's for Excel yet, I will certainly try
that now that you showed me how, Odd Gunnar! That is probably the easiest thing
to do.

These are the new routines, until further notice...:

FUNCTION phi(x:REAL):REAL;
CONST 	p=0.2316419;
	c1=0.31938153;
	c2=-0.356563782;
	c3=1.78147937;
	c4=-1.821255978;
	c5=1.330274429;
VAR t,sndf:REAL;
BEGIN
  sndf:=EXP(-SQR(x)/2)/SQRT(2*PI);
  t:=1/(p*x+1);
  phi:=-(((((c5*t+c4)*t+c3)*t+c2)*t+c1)*t*sndf)+1;
END;



FUNCTION Rtdiff(Performance:REAL):REAL;
CONST	tol=0.0001;
	sdev=200*SQRT(2);
VAR delta,slope:REAL;
BEGIN
  slope:=708;
  Rtdiff:=(Performance-0.50)*slope;
  delta:=1
  WHILE delta >= tol DO BEGIN
     Iteration:=phi(Rtdiff/sdev);
     delta:=Performance-Iteration;
     slope:=400*SQRT(PI)*EXP(SQR(Rtdiff/sdev)/2);
     Rtdiff:=Rtdiff+(delta*slope);
  END;
END;


Regards, Eelco

On April 21, 2005 at 06:14:05, Eelco de Groot wrote:

>Hi Odd Gunnar,
>
>It is extremely fascinating stuff! Thanks for the graphs. Wonderful!
>
>A bit embarrassing I can't yet see from the head where my new routine exactly
>goes wrong.
>Didn't yet have time to check myself. Turbo Pascal does not work on this
>computer. I can try the old 386, but Turbo pascal does not have such great
>accuracy anyway. First I will try to put it in TI-basic.
>
>You were absolutely right about the minus sign. That is equivalent to putting in
>phi = -(((((c5 * t + c4) * t + c3) * t + c2) * t + c1) * t * sndf)+1
>That is how the routine should have been...
>Since taking -Rtdiff gives the complementary surface under the normal curve that
>amounts to the same thing!
>
>The "groot" curve does follow the normal curve right up to about 0.9, so maybe
>tolerance factor is to blame. Tol can be a smaller number of course. More likely
>it simply does not converge at numbers close to one or zero.
>
> Eelco



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.