Covariances Class |
Namespace: Imsl.Stat
The Covariances type exposes the following members.
Name | Description | |
---|---|---|
Covariances |
Constructor for Covariances.
|
Name | Description | |
---|---|---|
Compute |
Computes the matrix.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetIncidenceMatrix |
Returns the incidence matrix. Note that the Compute method
must be invoked first before invoking this method. Otherwise, the
method throws a NullReferenceException exception.
| |
GetMeans |
Returns the means of the variables in x.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
SetFrequencies |
The frequency for each observation.
| |
SetWeights |
Sets the weight for each observation.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
MissingValueMethod |
Sets the method used to exclude missing values in x from the
computations.
| |
NumberOfProcessors |
Perform the parallel calculations with the maximum possible number of
processors set to NumberOfProcessors.
| |
NumRowMissing |
Returns the total number of observations that contain any missing values
(Double.NaN). Note that the Compute method
must be invoked first before invoking this method. Otherwise, the
return value is 0.
| |
Observations |
Returns the sum of the frequencies. Note that the Compute
method must be invoked first before invoking this method. Otherwise,
the return value is 0.
| |
SumOfWeights |
Returns the sum of the weights of all observations. Note that the
Compute method must be invoked first before invoking this
method. Otherwise, the return value is 0.
|
Class Covariances computes estimates of correlations, covariances, or sums of squares and crossproducts for a data matrix x. Weights and frequencies are allowed but not required.
The means, (corrected) sums of squares, and (corrected) sums of crossproducts are computed using the method of provisional means. Let denote the mean based on i observations for the k-th variable, denote the frequency of the i-th observation, denote the weight of the i-th observations, and denote the sum of crossproducts (or sum of squares if j = k) based on i observations. Then the method of provisional means finds new means and sums of crossproducts as shown in the example below.
The means and crossproducts are initialized as follows:
where p denotes the number of variables. Letting denote the k-th variable of observation i + 1, each new observation leads to the following updates for and using the update constant :
The default value for weights and frequencies is 1. Means and variances are computed based on the valid data for each variable or, if required, based on all the valid data for each pair of variables.