Skip to content
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

How to remove noise from an observed sequence #10

Open
fenaux opened this issue Feb 23, 2025 · 0 comments
Open

How to remove noise from an observed sequence #10

fenaux opened this issue Feb 23, 2025 · 0 comments

Comments

@fenaux
Copy link

fenaux commented Feb 23, 2025

I try to remove noise from an observed sequence

Image

The observed points are the blue points.
They correspond to team_id[in_track]

The desired behaviour corresponds to the orange curve with only one change around index 600
The I use
a = mc.HiddenMarkovModel().from_seq(team_id[in_track], team_id[in_track])
and get
a.tp

array([[ 0.94824, 0.018484, 0.033272],
[ 0.018692, 0.9486, 0.03271],
[ 0.12931, 0.2069, 0.66379]])

As I know
transition form state 0 to 1 or 1 to 0 are rare divide by 10 correspondings terms
transitions form state 0 or 1 to 2 should not occur corresponding terms are changed to 1e-9

Leading to
atp_hat

array([[ 0.99815, 0.0018484, 1e-09],
[ 0.0018692, 0.99813, 1e-09],
[ 0.12931, 0.2069, 0.66379]])

I then apply
vs, vsi = a.viterbi(obs_seq=team_id[in_track], tp=atp_hat)
but both vs and vsi are exactly indentical to blue points.

Is there a way to get what I expect ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant