Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Standard Deviations with different Average
Collapse
X

Standard Deviations with different Average
Hello,
I have developed custom Standard Deviation based on different average like the:
1. Geometrical average
2. Harmonic average
3. Quadratic average
As shown in the attached pic, i would like to understand why, for the same Period:
1. The Regular Stdev is almost equal to the Harmonic StdDev
2. The Geom Stdev is almost equal to the Quadratic StdDev
It's more like a maths problem but i would be interested to have a feedback...
ThanksLast edited by cbadr; 06122018, 01:12 AM. 
Originally posted by cbadr View PostThe issue is about understanding the result of the StdDev from a Geometric VS Harmonic VS Squared Mean.
From wikipedia i found that the formula to get the Geometric Std is mention there:
https://en.wikipedia.org/wiki/Geomet...dard_deviation
Thats a first thing i have to update on the script.
Then really i am wondering if the Std formala is the same for the other Mean?
Why do you think that a geometric mean may be more appropriate for what you are trying to do, if I may ask.

The issue is about understanding the result of the StdDev from a Geometric VS Harmonic VS Squared Mean.
From wikipedia i found that the formula to get the Geometric Std is mention there:
https://en.wikipedia.org/wiki/Geomet...dard_deviation
Thats a first thing i have to update on the script.
Then really i am wondering if the Std formala is the same for the other Mean?
Leave a comment:

Originally posted by cbadr View PostThanks for the answer.
Here the code i used for the Geometrical Average:
But after investigations on google, i realized i couldn't used the same Std calculation once the Mean is calculated.
I'll have to update the formula accordingly.
Any thoughts on this?
Code:protected override void OnBarUpdate() { if (CurrentBar < 1) { Value.Set(0); sumSeries.Set(Input[0]); } else { sumSeries.Set(Input[0] * sumSeries[1] * (CurrentBar >= Period ? 1/Input[Period]: 1)); double avg = Math.Pow(sumSeries[0],1/Math.Min(CurrentBar + 1, Period)); double sum = 0; for (int barsBack = Math.Min(CurrentBar, Period  1); barsBack >= 0; barsBack) sum += (Input[barsBack]  avg) * (Input[barsBack]  avg); Value.Set(Math.Sqrt(sum / Math.Min(CurrentBar + 1, Period))); } }
Leave a comment:

Thanks for the answer.
Here the code i used for the Geometrical Average:
But after investigations on google, i realized i couldn't used the same Std calculation once the Mean is calculated.
I'll have to update the formula accordingly.
Any thoughts on this?
Code:protected override void OnBarUpdate() { if (CurrentBar < 1) { Value.Set(0); sumSeries.Set(Input[0]); } else { sumSeries.Set(Input[0] * sumSeries[1] * (CurrentBar >= Period ? 1/Input[Period]: 1)); double avg = Math.Pow(sumSeries[0],1/Math.Min(CurrentBar + 1, Period)); double sum = 0; for (int barsBack = Math.Min(CurrentBar, Period  1); barsBack >= 0; barsBack) sum += (Input[barsBack]  avg) * (Input[barsBack]  avg); Value.Set(Math.Sqrt(sum / Math.Min(CurrentBar + 1, Period))); } }
Leave a comment:

Originally posted by cbadr View PostHello,
I have developed custom Standard Deviation based on different average like the:
1. Geometrical average
2. Harmonic average
3. Quadratic average
As shown in the attached pic, i would like to understand why, for the same Period:
1. The Regular Stdev is almost equal to the Harmonic StdDev
2. The Geom Stdev is almost equal to the Quadratic StdDev
It's more like a maths problem but i would be interested to have a feedback...
Thanks
Leave a comment:
Latest Posts
Collapse
Topics  Statistics  Last Post  

Started by afoschini, Today, 02:57 AM

0 responses
1 view
0 likes

Last Post
by afoschini
Today, 02:57 AM


Started by jecoyeko, Today, 12:45 AM

0 responses
6 views
0 likes

Last Post
by jecoyeko
Today, 12:45 AM


Started by Newtrader101, Yesterday, 06:31 PM

1 response
9 views
0 likes

Last Post Yesterday, 09:11 PM  
Started by Tyler7498, Yesterday, 07:34 PM

0 responses
4 views
0 likes

Last Post
by Tyler7498
Yesterday, 07:34 PM


Started by Woomera, Yesterday, 07:24 PM

2 responses
10 views
0 likes

Last Post
by Woomera
Yesterday, 11:12 PM

Leave a comment: