-
Notifications
You must be signed in to change notification settings - Fork 0
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
Systematic error in the indirect identification #4
Comments
Hmm, I just ran the notebook with a = 0 and w being large. If our theory is that the ratio of a / w needs to be large for the identification to work, then this debunks it. The error in the gain id seems to decrease when a / w decreases...not when it increases. |
Nice to have a simpler test case. The 1 DOF pendulum is what van der Kooij also used. I am looking at the notebook and I see a with an amplitude of about 1 m/s^2 and w with an amplitude of about 20 deg. w introduce a torque noise of a about 1/5 rad x k = 20 Nm. This is much larger than the effect of a (which is equivalent to m_a_L = 1 Nm), so the system is dominated by the process noise. But still there should be no bias, just random error (if my original understanding is correct...) I did not see the a=0 case, but did you find that the results were less biased in that case? I had some questions/comments:
Since the linear system already seems to demonstrate the problem, let's focus on that one. This is just a harmonic oscillator, right? If we set some constants to 1, this reduces to: xdd = -k*x + w(t) + a(t) And we do the system identification by fitting the observed movement of this system to a model without process noise, and the known a(t): xdd = -k*x + a(t) I feel like this can be solved analytically to prove whether or not the k estimate is biased. I am going to look again at van der Kooij's paper for some ideas. Maybe my questions/comments trigger some new thoughts on your side. |
I believe I can prove analytically for this linear system that there is no bias when estimating k by least-squares. I will post the proof here as soon as I have a chance to write it down. If that holds up, any remaining issue you see must be caused by numerics. I see two potential causes:
But I'm getting ahead of myself. You need to see the proof first. More later. |
The notebook is interactive, I've just been trying out numbers. I didn't post this.
Yes, I just chose random numbers to start.
You can get numbers above and below the known gain by rerunning the notebook.
Not sure.
I'm using midpoint integration in this problem. |
With low process noise, more nodes equates to exact identification of the parameter. With high process noise, more nodes equates to improving the identification but you never get to the correct solution.
I was using the interpolation because I had white noise for the additive reference noise. If I switch that to a sum of sines, you're right the interpolation is not needed. |
After playing around with the notebook last night I noticed that if you make a=0 and w=something, then the only way the identification model can have motion is to adjust the initial conditions. So the identification process essentially finds the best k and the best initial conditions such that the difference in the trajectories is minimized. If I were to constrain the initial conditions to the measured initial conditions, there wouldn't be a solution because the identification model has no external inputs when a=0. But when this identification solves, it interestingly turns out that the identified gain is still close to the known gain. I think this is simply because both systems have the same natural frequency. It just fits the best sine wave that it can to the data. |
That's cool. But I still don't understand how this could possibly be true. If the id model doesn't have the noise term and you set a=0 and w=something when creating the data, it is impossible to identify the correct gain. But you seem to be suggesting that if I run that identification enough times the mean will be the known gain (i.e. the error I see is random). I can run that test to see. From running it a handful of times, it seems like it may be true. |
I understand now why the simulation model does not blow up: the sum of sines does not contain the exact natural frequency of the system. With a random signal, it would blow up eventually. But the sum of sines should be fine for identification. To test whether the error is random, run everything N times (with new random seeds for a and w), but the same system parameters. If the mean of the identified k's is within the standard error of the mean (SEM=SD/sqrt(N)), there is no bias, only random errors. If the bias is small, you will need a high N to detect it, but at some point you can say: "the bias was less than ... (the SEM value)". Proof will come soon. If it goes as I expect, it will convince you. |
I see why we get a random looking error for this example. When a=0 and w=something, the identification is to simply fit a sine wave to the data. The best sine wave will have a similar dominate frequency as the data does. So if you generate N different w's the mean k_id will be k. So I believe that without actually running it N times. But it isn't clear to me that this extends to more complicated models. |
Apologies for using pencil. Scan attached, I hope Github posts it. I was able to solve the identification problem analytically for a 1-D The easiest way to remove the bias is a >> w (which we already knew) If you go through my analysis, you see that the bias is gone for any
I am pretty sure that condition 3 is required, so we need white noise So I now see that this is not quite complete, but perhaps a good You would think that this would already be known, but I just needed to On 3/20/2015 1:07 PM, Jason K. Moore wrote:
|
@tvdbogert I've created an explanation of the systematic error that I believe is present in the indirect identification. I've written it up as an IPython notebook and it also uses a simpler problem to demonstrate my complete method for the identification process. So this is my simplified code that shows the process I'm using and also demonstrates the bias issue and how it is really the exact same as the one in the direct identification problem.
http://nbviewer.ipython.org/github/csu-hmc/inverted-pendulum-sys-id-paper/blob/master/notebooks/systematic_error.ipynb
The text was updated successfully, but these errors were encountered: