Moment, Skew and Kurtosis? How to use this Math function

R

Raj

Hello Coders- For calculating the Moment, Skew and Kurtosis, i found
the following function in the help of C++ builder; But i couln't
understand this, of how to use this;

What i have is the data in a 1-d array;, say, Data[200]

Can somebody tell me how to use this to find the MomentSkewKurtosis ?

Copied from C++ help;

extern PACKAGE void __fastcall MomentSkewKurtosis(const double * Data,
const int Data_Size, Extended &M1, Extended &M2, Extended &M3, Extended
&M4, Extended &Skew, Extended &Kurtosis);

Extended offers greater precision than other real types but is less
portable. Be careful using Extended if you are creating data files to
share across platforms.

Thanks
Raj
 
K

Konstantin Miller

Hi!

Use it like this:

Extended M1; // first moment
Extended M2; // second moment
Extended M3; // third moment
Extended M4; // fourth moment
Extended Skew; // skew
Extended Kurtosis; // kurtosis

MomentSkewKurtosis(Data, 200, M1, M2, M3, M4, Skew, Kurtosis);

Now you have the moments in M1, M2, M3, M4, the skew in Skew and kurtosis in
Kurtosis.

Konstantin
 
R

Raj

Hi

My data is an array, how do i pass my array here.? IS it i should pass
my data array by reference?

I am confused in this.
thanks
Raj
Konstantin said:
Hi!

Use it like this:

Extended M1; // first moment
Extended M2; // second moment
Extended M3; // third moment
Extended M4; // fourth moment
Extended Skew; // skew
Extended Kurtosis; // kurtosis

MomentSkewKurtosis(Data, 200, M1, M2, M3, M4, Skew, Kurtosis);

Now you have the moments in M1, M2, M3, M4, the skew in Skew and kurtosis in
Kurtosis.

Konstantin


Hello Coders- For calculating the Moment, Skew and Kurtosis, i found
the following function in the help of C++ builder; But i couln't
understand this, of how to use this;

What i have is the data in a 1-d array;, say, Data[200]

Can somebody tell me how to use this to find the MomentSkewKurtosis ?

Copied from C++ help;

extern PACKAGE void __fastcall MomentSkewKurtosis(const double * Data,
const int Data_Size, Extended &M1, Extended &M2, Extended &M3, Extended
&M4, Extended &Skew, Extended &Kurtosis);

Extended offers greater precision than other real types but is less
portable. Be careful using Extended if you are creating data files to
share across platforms.

Thanks
Raj
 
H

Howard

Raj said:

Please don't top-post. Replies belong at the bottom, or interspersed with
what you're replying to, as appropriate. I've re-arranged the conversation:
Hello Coders- For calculating the Moment, Skew and Kurtosis, i found
the following function in the help of C++ builder; But i couln't
understand this, of how to use this;

What i have is the data in a 1-d array;, say, Data[200]

Can somebody tell me how to use this to find the MomentSkewKurtosis ?

Copied from C++ help;

extern PACKAGE void __fastcall MomentSkewKurtosis(const double * Data,
const int Data_Size, Extended &M1, Extended &M2, Extended &M3, Extended
&M4, Extended &Skew, Extended &Kurtosis);

Extended offers greater precision than other real types but is less
portable. Be careful using Extended if you are creating data files to
share across platforms.

Use it like this:

Extended M1; // first moment
Extended M2; // second moment
Extended M3; // third moment
Extended M4; // fourth moment
Extended Skew; // skew
Extended Kurtosis; // kurtosis

MomentSkewKurtosis(Data, 200, M1, M2, M3, M4, Skew, Kurtosis);

Now you have the moments in M1, M2, M3, M4, the skew in Skew and kurtosis
in
Kurtosis.

My data is an array, how do i pass my array here.? IS it i should pass
my data array by reference?

Did you _try_ doing it like you were shown?

It's perfectly normal to pass an array using just its name to a function
expecting a pointer to the type the array holds. You don't have to do
anything special. The array simply gets passed as a pointer. You _could_
pass the address of the first element of the array, using &(Data[0]), but
there's no need. Just give it the array name, and you'll be fine.

-Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top