g01aa calculates the mean, standard deviation, coefficients of skewness and kurtosis, and the maximum and minimum values for a set of ungrouped data. Weighting may be used.
Syntax
C# |
---|
public static void g01aa( int n, double[] x, ref int iwt, double[] wt, out double xmean, out double s2, out double s3, out double s4, out double xmin, out double xmax, out double wtsum, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g01aa ( _ n As Integer, _ x As Double(), _ ByRef iwt As Integer, _ wt As Double(), _ <OutAttribute> ByRef xmean As Double, _ <OutAttribute> ByRef s2 As Double, _ <OutAttribute> ByRef s3 As Double, _ <OutAttribute> ByRef s4 As Double, _ <OutAttribute> ByRef xmin As Double, _ <OutAttribute> ByRef xmax As Double, _ <OutAttribute> ByRef wtsum As Double, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g01aa( int n, array<double>^ x, int% iwt, array<double>^ wt, [OutAttribute] double% xmean, [OutAttribute] double% s2, [OutAttribute] double% s3, [OutAttribute] double% s4, [OutAttribute] double% xmin, [OutAttribute] double% xmax, [OutAttribute] double% wtsum, [OutAttribute] int% ifail ) |
F# |
---|
static member g01aa : n : int * x : float[] * iwt : int byref * wt : float[] * xmean : float byref * s2 : float byref * s3 : float byref * s4 : float byref * xmin : float byref * xmax : float byref * wtsum : float byref * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32On entry: , the number of observations.Constraint: .
- x
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: the sample observations, , for .
- iwt
- Type: System..::..Int32%On entry: indicates whether weights are to be supplied by you or not. In the latter case, the weights will be assumed equal and assigned the value in the method.
- Indicates no user-supplied weights.
- Indicates user-supplied weights are required, and they will be supplied in the array wt.
On exit: iwt is used to indicate the number of valid observations, ; see (g) in [Description] above.
- wt
- Type: array<System..::..Double>[]()[][]An array of size [n]
- xmean
- Type: System..::..Double%On exit: the mean, .
- s2
- Type: System..::..Double%On exit: the standard deviation, .
- s3
- Type: System..::..Double%On exit: the coefficient of skewness, .
- s4
- Type: System..::..Double%On exit: the coefficient of kurtosis, .
- xmin
- Type: System..::..Double%On exit: the smallest value in the sample.
- xmax
- Type: System..::..Double%On exit: the largest value in the sample.
- wtsum
- Type: System..::..Double%
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
The data consist of a single sample of observations, denoted by , with corresponding weights, , for .
If no specific weighting is required, then each is set to .
The quantities computed are:
(a) | The sum of the weights
|
||
(b) | Mean
|
||
(c) | Standard deviation
|
||
(d) | Coefficient of skewness
|
||
(e) | Coefficient of kurtosis
|
||
(f) | Maximum and minimum elements of the sample. | ||
(g) | The number of observations for which , i.e., the number of valid observations. Suppose observations are valid, then the quantities in (c), (d) and (e) will be computed if , and will be based on degrees of freedom. The other quantities are evaluated provided . |
References
None.
Error Indicators and Warnings
Errors or warnings detected by the method:
On entry, .
- The number of valid cases, , is . In this case, standard deviation and coefficients of skewness and of kurtosis cannot be calculated.
- Either the number of valid cases is , or at least one weight is negative.
Accuracy
The method used is believed to be stable.
Parallelism and Performance
None.
Further Comments
The time taken by g01aa is approximately proportional to .
Example
This example summarises an (optionally weighted) dataset and displays the results.
Example program (C#): g01aae.cs