hello
I just find a mistake on "SampleStandardDeviation" . here is the code again
// Standard Deviation AND Sample Standard Deviation
// http://www.mathsisfun.com/data/standard-deviation-calculator.html
EnableTextOutput( 0 );
X = MxFromString( "{{ 600, 470, 170, 430, 300}}"); //printf( MxToString( X ) );
col = MxGetSize( x, 1 );
sumX = sXsq= SampleVar= 0;
for( i = 0; i < col; i++ ) {
sumX += x[ 0 ][i ]; // sum of Row Χ
// variance Of X
sXsq += x[ 0 ][i ] ^2 ; // sum of square Χ
// printf( "\n sXsq X =\t" + sXsq );
}
MeanX=sumX/col;
VarianceOfX = (sXsq/col)-MeanX^2;
// Standard Deviation is a measure of how spread out numbers are
StandardDeviation = sqrt(varianceOfX); // Population Standard Deviation= The formula is the square root of the Variance
// ====== To find the Sample Standard Deviation ======
for( i = 0; i < col; i++ ) {
// take each number, subtract the Mean and square the result: then Sum of Differences^2
SampleVar += ( x[ 0 ][i]-MeanX) ^2; //printf( "\n Sample Variance X =\t" + SampleVar );
}
// Now calculate the Variance: (Sum of Differences^2 / (Count-1)) then square root
// Sample Standard Deviation= divide by N-1 when calculating Sample Variance
SampleStandardDeviation= sqrt( SampleVar/(col-1) ) ;
printf( "\n Sum X= \t%g", sumX );
printf( "\n Mean Of X = \t%g", MeanX );
printf( "\n sum of square = %g", sXsq );
printf( "\n Variance Of X = \t%g", varianceOfX );
printf( "\n Standard Deviation \t"+ StandardDeviation );
printf( "\n Sample Data \t"+ SampleStandardDeviation );
Panos
On 10-07-16 5:00 AM, 'TA' tagroups@sbcglobal.net [amibroker] wrote:
Thanks Panos. I came up with similar solution.
From: amibroker@yahoogroups.com [mailto:amibroker@yahoogroups.com]
Sent: Saturday, July 09, 2016 8:21 PM
To: amibroker@yahoogroups.com
Subject: Re: [amibroker] Standard deviation of matrix elements
Hello.
Me too i was playing 3 days ago and i went up to this code
The output is correct, but i dont know is there is a sorter version. have a fun and i hope it helps.
Panos
Posted by: Panos Boufardeas <panosbouf@gmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
2 komentar
It is not easy to derive the right answers to standard deviation problems. It may have a hard time getting a grip on all the properties and formulas related to this topic. Don’t panic; standard deviation calculator will make your task 10times easier. Myassignmenthelp.com is the best online platform to get academic writing services i.e. adobe flash assignment help, tafe assignment help, Proposal Essay Topics and many more.
People have argued that digital content is very expensive (Marx). assignment help
EmoticonEmoticon