Statistical Inference for Hidden Markov Tree Models and Application to Wavelet Trees