I am implementing my own discrete Kalman filter to estimate velocity from acceleration and position measurements (using Matlab ).
I think I managed to deal with the $R$ matrix (measurements noise covariance matrix) in this way:
M = [x;x2dot];
R = cov(M);
What I am not sure about is the matrix $Q$.
In all the examples I found on the web and on this website also, the values inside that matrix are really really small. Moreover, I found here this statement:
if you select an overly large Q, then it doesn’t seem like the Kalman filter would be well-behaved.
The fact is that, in my model, to obtain acceptable results I used values in the order of $1e6$ on the diagonal of the $Q$ matrix.
In this way I got the estimated displacement equal to the measured one and the estimated acceleration equal to the measured one. The velocity is in the right range of values but it still looks noisy.
So the question is: is there a limit for the values to be used in $Q$?
And also, are there guidelines to choose those values?
EDIT
Last question, does the $Q$ matrix have to be diagonal or it can be full also?