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

FW: Array functions in TS2000i



PureBytes Links

Trading Reference Links

OM
	Thanks for the list.

	The point about the matrix functions is not about how "trivial" an
operation it is - it is very simple to loop through each individual element
of an array and multiply, divide etc. by a constant - but about speed of the
operation.  Looping through an array is relatively very slow in TS4.0.  If
you have to do this for one or more arrays of any significant length on
every bar in even a moderately-sized historical chart it quickly becomes
impractically slow.  I was thinking that matrix functions could maybe speed
it up.

	On another note has anyone tested the accuracy of these array functions.  I
find it hard to believe that they will be accurate using single-precision
without some kind of data preprocessing.

	For example, Variance, Covariance, Correlation etc., according to the
equations I have, are calculated by squaring the individual elements in a
time-series.  For values, such as stock prices, with only 3 or 4 significant
figures, single-precision might not be a problem.  According to my trusty
WinNT calculator squaring these numbers gives results in the 6 - 8
significant figure range.  Since single-precision uses a maximum of 7
significant figures, only the last decimal place risks being rounded off.
However, when using larger numbers, as one would typically use with the
indices like the Dow Jones (i.e. 10,320.49 etc.), squaring results in 10 or
more significant figures.  The rounding errors here will become much more
important as 3 or more significant figures will get rounded off.
	I know that in TS4.0, which also uses only single precision, doing
correlation on a 40-element array for the SP500 which has only 6 significant
figures (1,320.33) gave totally useless results.

	The only way I see doing this in TS2000 is to convert a 7 significant
figure number such as the Dow Jones into an "equivalent" 3 or 4 significant
figure number and then do the array calculation.  Or, if there existed
equivalent formulas for calculating Variance etc. that did not depend on
squaring such large numbers as one might find in index values, then one
might avoid the rounding-errors altogether.

-----Original Message-----
From: the_omega_man@xxxxxxxxxxxx [mailto:the_omega_man@xxxxxxxxxxxx]
Sent: Saturday, March 11, 2000 7:37 AM
To: marQ; Omega List
Subject: Re: Array functions in TS2000i

Here's the list:

Average_a(AvgArray, ArraySize)

AvgDeviation_a(AvgDevArray, ArraySize)

coeffR_a(IndArray, DepArray, ArraySize)

Correlation_a(IndArray, DepArray, ArraySize)

Covariance_a(IndArray, DepArray, ArraySize)

DevSqrd_a(DevSqrdArray, ArraySize)

HarmonicMean_a(HarMeanArray, ArraySize)

Highest_a(HighestArray, ArraySize)

Kurtosis_a(KurtosisArray, ArraySize)

Lowest_a(LowestArray, ArraySize)

LinRegForecast_a(IndArray, DepArray, ArraySize, X)

LinRegIntercept_a(IndArray, DepArray, ArraySize)

LinRegSlope_a(IndArray, DepArray, ArraySize)

Median_a(MedianArray, ArraySize)

Mode_a(ModeArray, ArraySize, Type)

NormalCumDensity_a(NDArray, ArraySize, Price)

NormalDensity_a(NDArray, ArraySize, Price)

NthHighest_a(NthHighArray, ArraySize, NthValue)

NthLowest_a(NthLowArray, ArraySize, NthValue)

Percentile_a(PcntileArray, ArraySize, Pcntile)

PercentRank_a(PcntileArray, ArraySize, RankVal)

Quartile_a(QuartileArray, ArraySize, Quart)

Rank_a(RankArray, ArraySize, Value2Rank, SortOrder)

RSquared_a(IndArray, DepArray, ArraySize)

Skew_a(SkewArray, ArraySize)

SortDown_a(SortArray, ArraySize)

SortUp_a(SortArray, ArraySize)

StandardError_a(IndArray, DepArray, ArraySize)

Standardize_a(StdizedArray, ArraySize, StdizedValue)

StdDevP_a(StdDevArray, ArraySize)

StdDevS_a(StdDevArray, ArraySize)

Summation_a(SummArray, ArraySize)

Trimmean_a(TrimmeanArray, ArraySize, PcntExcluded)

VarianceP_a(VarianceArray, ArraySize)

VarianceS_a(VarianceArray, ArraySize)


These are all functions for single dimensional arrays (vectors).  Thus,
they really are not "matrix" functions at all...  Thus, what you ask about,
 multiplying an array by a constant, is not an included function since it
is such a trivial operation when performed on a vector.


Good trading,

OM