Skip to content

Multiscale entropy in the source code #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Datseris opened this issue Sep 27, 2022 · 2 comments · Fixed by #132
Closed

Multiscale entropy in the source code #102

Datseris opened this issue Sep 27, 2022 · 2 comments · Fixed by #132
Assignees
Labels
enhancement New feature or request that is non-breaking new entropy New entropy type new probabilities New probabilities estimator

Comments

@Datseris
Copy link
Member

In the current source we have

# TODO: What's this file? It's incomplete and with rogue code...

struct MultiscaleEntropy end

"""
    multiscale_entropy(x::AbstractVector)

"""
function multiscale_entropy end

function coarse_grain(x::AbstractVector{T}, τ) where T
    N = length(x)
    ys = Vector{T}(undef, 0)

    for j = 1:floor(Int, N/τ)
        yⱼ = 0.0
        for i = (j-1)*τ+1:j*τ
            yⱼ += x[i]
        end
        yⱼ *= 1/τ
        push!(ys, yⱼ)
    end
    return ys
end

x = rand(3 * 10^4 )
y1 = coarse_grain(x, 1)
y2 = coarse_grain(x, 2)
y3 = coarse_grain(x, 3)
y4 = coarse_grain(x, 4)
y5 = coarse_grain(x, 5)
y6 = coarse_grain(x, 6)
y7 = coarse_grain(x, 20)

I'm guessing that in the future can be used to estimate some multiscale entropy. But is it really an entropy or a probabilities estimator?

@Datseris Datseris added enhancement New feature or request that is non-breaking new probabilities New probabilities estimator new entropy New entropy type labels Sep 27, 2022
@kahaaga
Copy link
Member

kahaaga commented Sep 27, 2022

I'm guessing that in the future can be used to estimate some multiscale entropy. But is it really an entropy or a probabilities estimator?

This code is obviously not used for anything, because it is not finished yet. It must have slipped in unnoticed for some PR during this reorganization.

For now, we can just remove this file in #101. I'll have a PR with much nicer interface ready for multiscale entropy/probability once we finish the API reorganization.

@kahaaga
Copy link
Member

kahaaga commented Nov 3, 2022

This is solved in #132

@kahaaga kahaaga closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request that is non-breaking new entropy New entropy type new probabilities New probabilities estimator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants