-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SimpleMeasurementInitiator new state definition #774
Comments
So the result should be that for the mapped elements from the measurement, the values from the measurement are used. And the elements that are not mapped, they are taken from the prior. import datetime
import numpy as np
from stonesoup.initiator.simple import SimpleMeasurementInitiator
from stonesoup.models.measurement.linear import LinearGaussian
from stonesoup.types.detection import Detection
from stonesoup.types.state import GaussianState
timestamp = datetime.datetime.now()
detection = Detection([1, 2], timestamp)
prior = GaussianState([10, 20, 30, 40], np.diag([10, 20, 30, 40]))
model = LinearGaussian(4, [0, 2], np.diag([100, 200]))
tracks = SimpleMeasurementInitiator(prior, model).initiate({detection}, timestamp)
track = tracks.pop()
print(track.state_vector)
print(track.covar) Results in:
|
I guess my confusion is in how I should interpret the Here, for
it indicates that the mapped dimensions are the 'x', 'y', 'z' components of the state vector (i.e., [0, 2, 4]). But, I get the impression from elsewhere that it should be the components of the state vector that the measurement model contributes an estimate for. This latter interpretation explains the code block here: Stone-Soup/stonesoup/initiator/simple.py Line 140 in 68f5dd9
in that the measurement-estimated But currently, this is not the case for
|
So the idea behind the mapping was identify the relevant components between the state space and the measurement space, primarily, and initially, for translating the state space to measurement space for the predicted measurement. I think it's probably a assumption by the measurement initiator that the mapping is present and correct for this; and we probably need to double check the models. So there is an issue with the |
I'm not sure I follow the intent of the existing implementation of
SimpleMeasurementInitiator.initiate
. It establishesprior_state_vector
from the prior state passed during init andstate_vector = measurement_model.inverse_function(detection)
as the state vector implied by the measurement, which makes sense. But, then the it zeros out themapped_dimensions
component fromprior_state_vector
andprior_covar
Stone-Soup/stonesoup/initiator/simple.py
Line 140 in 68f5dd9
and then simply adds
prior_state_vector
andstate_vector
to form the new state:Stone-Soup/stonesoup/initiator/simple.py
Line 145 in 68f5dd9
For the
mapped_dimensions
, this takes the values entirely fromstate_vector
, but for the other dimensions, they are summed.Currently, you can happen to achieve somewhat reasonable behavior if you just pass in all zeros for the prior state vector. But otherwise, you can get strange results.
The text was updated successfully, but these errors were encountered: