Matrix-formed empirical Bayesina Analysis for State-space Inference and Clustering