Skip to content

How to remove noise from an observed sequence #10

@fenaux

Description

@fenaux

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions