amidst / toolbox

A Java Toolbox for Scalable Probabilistic Machine Learning
http://www.amidsttoolbox.com
Apache License 2.0
119 stars 35 forks source link

Mark some variables as non temporal #84

Closed gowthamnatarajan closed 6 years ago

gowthamnatarajan commented 6 years ago

Is there a way to mark certain variables as non temporal? That is, their value does not change and remains the same as it was at Time 0.

andresmasegosa commented 6 years ago

Not really, this is also a nice extension. Mixing temporal and non-temporal variables.

But you can easily simulate these settings by using standard temporal variables which do not depend on any variable in the previous time step. When providing evidence you copy the value from Time 0 to all the following time steps.

gowthamnatarajan commented 6 years ago

Ok. But while generating samples, the value of non temporal variables keeps changing. This is another use case

andresmasegosa commented 6 years ago

OK. I think I get your point. I propose you the following hack:

a) Define your variable X at time 0 as you like.

b) Define you variable X_t conditioned to X_t-1 and hard code a deterministic relationship. E.g. if X_t is binary then p(x_t=0|x_t-1 = 0) = 1, p(x_t=1|x_t-1 = 0) = 0, p(x_t=0|x_t-1 = 1) = 0 and p(x_t=1|x_t-1 = 1) = 1.

Then, the sampled value at time 0 will not change in the time sequence.