pooled_variance Interface

public interface pooled_variance

Computes the pooled estimate of variance.


Module Procedures

private pure function pooled_variance_1(si, ni) result(rst)

Computes the pooled estimate of variance.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in), dimension(:) :: si

An N-element array containing the estimates for each of the N variances.

integer(kind=int32), intent(in), dimension(size(si)) :: ni

An N-element array containing the number of data points in each of the data sets used to compute the variances in si.

Return Value real(kind=real64)

Pooled variance; empty inputs, nonfinite/negative variances, or groups with fewer than two observations give NaN.

private pure function pooled_variance_2(x) result(rst)

Computes the pooled estimate of variance.

Arguments

Type IntentOptional Attributes Name
type(array_container), intent(in), dimension(:) :: x

An array of arrays of data.

Return Value real(kind=real64)

Pooled variance; empty/unallocated groups or groups with fewer than two finite observations give NaN.

private pure function pooled_variance_column(si, ni) result(rst)

Pools variance estimates using the array implementation on a column copy. Unequal counts cause ERROR STOP with FS_ARRAY_SIZE_ERROR.

Arguments

Type IntentOptional Attributes Name
class(data_column), intent(in) :: si

Group variance estimates, unchanged; unallocated storage is empty.

integer(kind=int32), intent(in), dimension(:) :: ni

Group observation counts; must have si's count and each be at least two.

Return Value real(kind=real64)

Pooled variance; empty data, negative/nonfinite estimates, or invalid group sizes give NaN.

private pure function pooled_variance_columns(x) result(rst)

Pools sample variances from an array of columns, copying each group's data.

Arguments

Type IntentOptional Attributes Name
class(data_column), intent(in), dimension(:) :: x

Observation columns; groups may have different row counts.

Return Value real(kind=real64)

Pooled variance; no groups, undersized/unallocated groups, or nonfinite observations give NaN, as in the array-container overload.