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

[amibroker] T3 Question



PureBytes Links

Trading Reference Links

The common solution for these 3 examples is the Harmonic average.
I. 2/(1/100+1/200)=133.33 mph
II. 5*4/(1/4+1/3+1/6+1/4)=20 km
III. 70/(1/188+1/189+1/194+...+1/204+1/205)
We may have an elegant AFL definition 
function HarmonicMean(array,n)
{
return n/Sum(1/array,n);
}
or the equivalent
function HarmonicMean(array,n)
{
return 1/MA(1/array,n);
}
The 3 averages are at
http://finance.groups.yahoo.com/group/amibroker-ts/files/3%20means/
where the T/A analysis applications will be added.
Dimitris Tsokakis

--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Montoya example was rather simple.
> Common sense  usually goes to arithmetic average, but it was not 
the 
> case.
> The average speed follows some different rules than the average 
> length or the average weight.
> The solution was 133.33, which, BTW, is 2/(1/100+1/200)
> The next example is more complicated:
> 
> Example II
> Johnnie, the well known walker, was walking last Sunday afternoon 
for 
> 5h.
> The 1st part AB was horizontal and he was moving with 4km/h.
> The 2nd part BC was ascending with 3km/h.
> He was tired and he decided to come back, following the same path.
> The 3rd part CB was, of course, descending with 6km/h.
> The last way to home BA was horizontal like before with 4km/h.
> What was the total lenght ABCBA of the walk ?
> [you dont need more info to find the unique solution]
> The next is closer to reality and we have to set aside any tricks.
> 
> Example III
> Michael ran the 70 Bahrein laps with average speed per lap
> v1=188
> v2=189
> v3=194
> ...
> ...
> v69=204
> v70=205
> If all the speeds are well known, what was the average Ferrari 
speed ?
> The speed V  is an array now and the solution *IS NOT* MA(V,70) as 
> the common sense may suppose. We need a different averaging method.
> Dimitris Tsokakis 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
<TSOKAKIS@xxxx> 
> wrote:
> > Juan Pablo Montoya in the recent Bahrein trials ran the first lap 
> at 
> > 100mph and then the 2nd lap at 200mph.
> > What was the average speed ?
> > [the answer is not 150mph and it is not included at 
> > http://www.jpmontoya.com/jpmontoya2002/En/index.asp]
> > Dimitris Tsokakis



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/