1. A method of estimating the state of a modeled dynamic system, the method comprising: generating an observer in an electronic device for estimating of at least one state variable associated with the system, wherein said observer defines a covariance matrix statistically relating the at least one state variable; receiving sensor data at a electronic device from a sensor, the sensor data being associated with the at least one state variable; updating, in a memory of the electronic device, the at least one state variable based on the received sensor data and the generated observer; updating, in a memory of the electronic device, the covariance matrix based on the updated at least one state variable; determining whether an element of the main diagonal of the updated covariance matrix has a value that is less than zero; and storing a specified value to the covariance matrix in the memory of the electronic device based on the determining.