In [1]:
using Distributions
include("VB.jl")
using VB
using PyPlot
srand(12345);
In [2]:
U = 10 # units
T = 100 # time points
K = 3 # HMM factors
J = 2 # HMM states
Out[2]:
Generate parameters of HMMs
In [3]:
π0_data = [rand(Dirichlet(2, 5)) for k in 1:K]
A_data = [rand(MarkovMatrix([7.0 4 ; 3 6])) for k in 1:K]
Out[3]:
In [4]:
z_data = [rand(MarkovChain(π0_data[k], A_data[k], T)) for k in 1:K]
Out[4]:
In [5]:
z_unique = vcat([z[1, :] for z in z_data]...)
Out[5]:
In [6]:
matshow(z_unique, cmap="gray", aspect="auto")
Out[6]:
In [ ]: