central_moment with provided mean

Entry point to compute central moments up to the 4th order with the provided mean values.

Description and Assumptions

The oneapi::mkl::stats::central_moment function is used to compute an array of central moments up to the 4th order (central moments for each dataset’s dimension) with the provided mean values.

central_moment with provided mean supports the following precisions for data:

T

float

double

central_moment with provided mean (buffer version)

Syntax

namespace oneapi::mkl::stats {
template<method Method = method::fast, typename Type, layout ObservationsLayout>
    void central_moment(sycl::queue& queue,
    sycl::buffer<Type, 1> mean,
    const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
    sycl::buffer<Type, 1> central_moment_2,
    sycl::buffer<Type, 1> central_moment_3 = {0},
    sycl::buffer<Type, 1> central_moment_4 = {0});
}

Template Parameters

Method

Method which is used for estimate computation. The specific values are as follows:

  • oneapi::mkl::stats::method::fast

Type

Data precision.

ObservationsLayout

Data layout. The specific values are described in dataset.

Input Parameters

queue

The queue where the routine should be executed.

mean

sycl::buffer to the array of provided mean values.

data

Dataset which is used for computation.

Output Parameters

central_moment_2

sycl::buffer array of 2nd order central moment values.

central_moment_3

Optional parameter. sycl::buffer array of 3rd order central moment values.

central_moment_4

Optional parameter. sycl::buffer array of 4th order central moment values.

Throws

oneapi::mkl::invalid_argument

Exception is thrown when central_moment_2.get_count() == 0 & central_moment_3.get_count() == 0 & central_moment_4.get_count() == 0, or mean.get_count() == 0, or dataset object is invalid

central_moment with provided mean (USM version)

Syntax

namespace oneapi::mkl::stats {
template<method Method = method::fast, typename Type, layout ObservationsLayout>
    sycl::event central_moment(sycl::queue& queue,
    Type* mean,
    const dataset<ObservationsLayout, Type*>& data,
    Type* central_moment_2,
    Type* central_moment_3 = nullptr,
    Type* central_moment_4 = nullptr,
    const sycl::vector_class<sycl::event> &dependencies = {});
}

Template Parameters

Method

Method which is used for estimate computation. The specific values are as follows:

  • oneapi::mkl::stats::method::fast

Type

Data precision.

ObservationsLayout

Data layout. The specific values are described in dataset.

Input Parameters

queue

The queue where the routine should be executed.

mean

Pointer to the array of provided mean values.

data

Dataset which is used for computation.

dependencies

Optional parameter. List of events to wait for before starting computation, if any.

Output Parameters

central_moment_2

Pointer to the array of the 2nd order central moment values.

central_moment_3

Optional parameter. Pointer to the array of the 3rd order central moment values.

central_moment_4

Optional parameter. Pointer to the array of the 2nd order central moment values.

Throws

oneapi::mkl::invalid_argument

Exception is thrown when central_moment_2 == nullptr & central_moment_3 == nullptr & central_moment_4 == nullptr or mean == nullptr, or dataset object is invalid

Return Value

Output event to wait on to ensure computation is complete.

Parent topic: Summary Statistics Routines