This paper addresses the problem of state estimation in the case where the prior distribution of the states is not perfectly known but instead is parameterized by some unknown parameter. Thus in order to support the state estimator with prior information on the states and improve the quality of the state estimates, it is necessary to learn this unknown parameter first. Here we assume a parameterized Gaussian Markov random field to model the prior distribution of the states and propose an algorithm that is able to learn its parameters from given observations on these states. The effectiveness of this approach is proven experimentally by simulations.