initialChecks: Initial Checks for ProbKMA

View source: R/checks.R

initialChecksR Documentation

Initial Checks for ProbKMA

Description

This function performs various input checks on the parameters provided by the user to ensure they are valid for running the ProbKMA algorithm. It verifies the structure and content of the input data, including curves, derivatives, initial membership probabilities, shift matrices, and various parameters.

Usage

initialChecks(Y0, Y1, P0, S0, params, diss, V_init)

Arguments

Y0

A list of matrices or vectors representing the curves.

Y1

A list of matrices or vectors representing the derivatives of the curves.

P0

A numeric matrix representing initial membership probabilities. Rows correspond to curves, and columns correspond to clusters.

S0

A numeric matrix representing the initial shift matrix.

params

A list containing various parameters for ProbKMA, including:

  • standardize Logical indicating whether to standardize the curves.

  • K Number of motifs.

  • c Minimum motif length.

  • c_max Maximum motif length.

  • iter_max Maximum number of iterations.

  • quantile Quantile value for stopping criterion.

  • alpha A numeric value related to the dissimilarity measure.

  • w Weights used in the algorithm.

  • stopCriterion Stopping criterion for the algorithm.

  • m Weighting exponent.

  • tol Tolerance level for stopping criteria.

  • iter4elong Maximum iterations for elongation.

  • tol4elong Tolerance for elongation.

  • max_elong Maximum elongation allowed.

  • trials_elong Number of trials for elongation.

  • deltaJK_elong Threshold for elongation.

  • max_gap Maximum gap allowed.

  • iter4clean Number of iterations for cleaning.

  • tol4clean Tolerance for cleaning.

  • quantile4clean Quantile for cleaning.

  • return_options Options for returning results.

  • seed Seed for random number generation.

  • exe_print Boolean to control printing of execution messages.

  • set_seed Boolean to control whether to set a random seed.

  • transformed A logical value indicating whether to normalize the curve segments to the interval [0,1] before applying the dissimilarity measure. Setting 'transformed = TRUE' scales each curve segment between 0 and 1, which allows for the identification of motifs with consistent shapes but different amplitudes. This normalization is useful for cases where motif occurrences may vary in amplitude but have similar shapes, enabling better pattern recognition across diverse data scales.

  • n_threads Number of threads for parallel processing.

diss

A character string indicating the type of dissimilarity measure to be used. Possible values are: 'd0_L2', 'd1_L2', 'd0_d1_L2'.

V_init

A list containing initial values for the clusters. If provided, it must match the expected structure based on K.

Value

A list containing:

FuncData

A list of processed curves and derivatives after performing the checks.

Parameters

A list of validated parameters ready for use in initializing the ProbKMA object.


funMoDisco documentation built on April 16, 2025, 1:10 a.m.