# How to model sample change?

I have a sequence of binary samples and I want to model how this sequence is changing. The change should reflect whether it's a positive or negative change.

For example, sequence 1:

1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1


is changing positively since we're confident in appearance of 1's before and become even more confident after some point. However, sequence 2:

1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0


is changing negatively since the number of 0's is increasing, as opposed to our prior confidence in 1. Is there a metric that models this behavior?

I've been looking into sample entropy but it seems to model change of frequency but does not distinguish positive and negative changes. The reason why I'd like to model this difference is I want to know whether there is a positive or negative effect on the underlying graphical model that generates these samples so that I can detect these underlying changes. Thanks!

-
Are you analyzing a sequence whose length is changing or are you just considering the last, say, $k$ elements? This seems very much like a coin toss problem, where your coin has a stochastic probability $p(t)$. In the easiest case, I think you can just update an estimate of this probability and see where it changes significantly (say, via the Bayes theorem). – Néstor Jul 17 '12 at 2:14
I'm considering the last $k$ elements and want to know whether $p(x)$ is changing based on these samples. I have many random variables and want to map them to a real number so that I can know which random variables are changing most rapidly so that I can generate more samples for them. (these random variables are nodes of a graphical model) – Yang Jul 17 '12 at 3:23
Possibly related: this question. – MånsT Jul 17 '12 at 7:47
Yes, it is. Thank you. – Yang Jul 17 '12 at 14:35