Skip to content

Questions about tolerance methods in Multiscale Entropy (MSE) ❓  #1059

Open
@DongCheninmuenster

Description

@DongCheninmuenster

When calculating MSE using this package, I encountered the following issue. According to the original algorithm by Costa et al., 2005, the tolerance ($r$) is defined as a percentage (sometimes denoted as $\rho$) of the standard deviation (SD) of the original time series. In the referenced paper, a value of 15% is used, though this can be adjusted.

However, I didn't find the approach to change the $\rho$ in this package. Additionally, the comments within the corresponding functions are unclear and may lead to confusion.

Function entropy_multiscale accepts arguments tolerance to set $r$ for MSE:

tolerance : float
Tolerance (often denoted as r), distance to consider two data points as similar. If "sd" (default), will be set to :math:0.2 * SD_{signal}. See :func:complexity_tolerance to estimate the optimal value for this parameter.

As mentioned in the comments above, tolerance can accepts a float in addition to the default string "sd".


    # Store parameters
    info = {
        "Method": method,
        "Algorithm": algorithm.__name__,
        "Coarsegraining": coarsegraining,
        "Dimension": dimension,
        "Scale": _get_scales(signal, scale=scale, dimension=dimension),
        "Tolerance": complexity_tolerance(
            signal,
            method=tolerance,
            dimension=dimension,
            show=False,
        )[0],
    }

    # Compute entropy for each coarsegrained segment
    info["Value"] = np.array(
        [
            _entropy_multiscale(
                signal,
                scale=scale,
                coarsegraining=coarsegraining,
                algorithm=algorithm,
                dimension=dimension,
                tolerance=info["Tolerance"],
                refined=refined,
                **kwargs,
            )
            for scale in info["Scale"]
        ]
    )

As shown in code above, tolerance is provided by info dict and is calculated using the function complexity_tolerance. And the parameter tolerance is passed to the argument method.


Within the function complexity_tolerance:

method : str
Can be "maxApEn" (default), "sd", "recurrence", "neighbours", "nolds", "chon2009", or "neurokit".

, however, the argument method can only accept str and Not float. As a result, it is not possible to adjust the tolerance by simply modifying $\rho$, such as setting $\rho$ = 0.15 as done by Costa et al.

I'm not sure if I've missed something important, so I would appreciate any help in solving my question. Otherwise, an additional method like "Costa" should be added. 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions