Description
When calculating MSE using this package, I encountered the following issue. According to the original algorithm by Costa et al., 2005, the tolerance (
However, I didn't find the approach to change the
Function entropy_multiscale
accepts arguments tolerance
to set
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
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. 😊