[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Precision Errors



PureBytes Links

Trading Reference Links

> Of course, if you use 1000 or more maxbarsback settings, such side
> effects may appear. The question is: Who really uses 1000 or more
> bars is his current system development? 
> Value1= average(c, 1000) does make sense to you ?

Pierre, you seem to have a problem understanding what people have 
written.  I know English is not your native language but you should 
be more careful before you ridicule someone's post.

Neal Falkenberry wrote:
NF> With Currentbar > 1,000 the difference between TS's calculation of
NF> a 90 bar correlation versus Excel or C++ (which agree to 9
NF> decimals) is .32 versus .56.   

Note:  **CurrentBar** > 1000, not MaxBarsBack.  **90 bar** 
correlation.  Both of which are quite within the bounds of reasonable 
use.  (Though I'm not sure why CurrentBar is relevant, since the TS 
Correlation function doesn't accumulate anything.)

But I'm not certain we're looking at the same thing here.  Neal, did 
you test this with single-precision floats in C++?  I'm 99.9% certain 
Excel uses double-precision, so if C++ agrees with it to 9 decimal 
places, the C++ test was probably double-precision too.  You can't 
fault TS for not matching double-precision results when it's clearly 
documented that TS handles only singles.

Also, Pierre is right that TS's default correlation function bears no 
resemblance to the correlation function that you probably used in 
Excel, either CORREL() or PEARSON().  See how Brickey's correlation 
code -- which should match PEARSON() -- compares to C++ with single-
precision.  Better yet, test Brickey's EL code against a single-
precision C++ implementation of the same algorithm, so you know 
you're comparing apples to apples.  If THAT test shows radical 
differences, then there is a legitimate problem.

> Regarding to your  precision problem, there is always a workaround.
> ... I am always amazed to see how people are quick to bash without
> having the idea of trying to solve with what they have and adding
> some use of their brain. 

Pierre, let's imagine you've just bought a car.  It appears to work 
fine.  But then you discover that, due to a bad design, the fan belt 
rubs against the brake lines.  Occasionally the belt rubs through the 
brake lines, the brake fluid escapes, and you have no brakes.

Now let's say you went to the car company or a mechanic and they said 
"Well there's always a workaround.  You could replace the brake lines 
every morning, or you could reroute the brake lines, or you could 
redesign the fan belt so it doesn't rub on the brake lines any more.  
I am always amazed how people are quick to bash without ... " etc etc.

Would you consider that a reasonable response to the badly designed 
car?  If so, remind me never to buy a car -- or software -- from you.

Gary