Kalman filter and simulating Gaussian noise

Click For Summary

Discussion Overview

The discussion centers on the application of Kalman filtering to generate values based on Gaussian random noise, specifically in the context of a static state model with defined parameters for system and measurement noise. Participants explore how to simulate these values and clarify aspects of the mathematical formulation involved.

Discussion Character

  • Technical explanation, Mathematical reasoning, Homework-related

Main Points Raised

  • One participant outlines a static state model with parameters \(P_0 = 1000\), \(Q = 0.0001\), and \(R = 0.1\) and seeks assistance in generating 10 values of \(y\) using Gaussian random noise.
  • Another participant references a Stanford presentation discussing linear measurements of the form \(y = Ax + v\) but expresses difficulty in applying it to their problem.
  • Some participants clarify that the generated \(y\) values follow a normal distribution \(N(y_{true}, R)\) with \(y_{true}=1\) and \(R=1/10\), providing a MATLAB code snippet for generating these values.
  • There is a request for clarification on the mathematical operations involved in the MATLAB code, specifically the addition of one and division by \(\sqrt{10}\).
  • One participant proposes an alternative representation of \(y\) as \(y = 0.1k + \) noise and explores different MATLAB coding approaches to generate multiple values, expressing uncertainty about the correct implementation.
  • Another participant reiterates the explanation of the MATLAB function used to generate samples from a normal distribution.

Areas of Agreement / Disagreement

Participants generally agree on the need to generate Gaussian random noise for the Kalman filter application, but there are multiple approaches and some uncertainty regarding the implementation details and the mathematical formulation.

Contextual Notes

Some participants express confusion about the implications of the mathematical operations in the MATLAB code, and there are unresolved questions about how to structure the generation of multiple values based on different definitions of \(y\).

Dustinsfl
Messages
2,217
Reaction score
5
Water level assumed constant. Static state model \(P_0 = 1000\), system noise \(Q = 0.0001\), measurement noise \(R = 0.1\).

I want to use Kalman filtering to solve this problem. I know how to do this but I need to generate \(\mathbf{y} = y\) using Gaussian random noise. \(P_0\) is also call the variance which is high do to uncertanity in \(x_0\).

How do I generate 10 y values based on Gaussian random noise with these conditions?

These values come from here.

Then I have a copy the same presentation but page 7-9 are additionally hand written pages with more info and everything before and after these pages are identical to the first link.
 
Last edited:
Physics news on Phys.org
I found a presentation on the topic by Stanford; unfortunately, I don't see how to apply it to the problem. If someone can help with this, that would be great.

On page 14, they go over linear measurements of the form \(y = Ax + v\).

Stanford lecture

This is just a beamer style presentation so it isn't dense.
 
dwsmith said:
Water level assumed constant. Static state model \(P_0 = 1000\), system noise \(Q = 0.0001\), measurement noise \(R = 0.1\).

I want to use Kalman filtering to solve this problem. I know how to do this but I need to generate \(\mathbf{y} = y\) using Gaussian random noise. \(P_0\) is also call the variance which is high do to uncertanity in \(x_0\).

How do I generate 10 y values based on Gaussian random noise with these conditions?

These values come from here.

Then I have a copy the same presentation but page 7-9 are additionally hand written pages with more info and everything before and after these pages are identical to the first link.

The $$y$$'s are $$\sim N(y_{true},R)$$ with $$y_{true}=1$$ and $$R=1/10$$, so in Matlab code a sample of 10 $$y$$'s would be generated thusly:

Code:
--> ysamp=1+randn(1,10)/sqrt(10)

ysamp =

 Columns 1 to 6
    1.0032    1.0506    0.5366    0.9875    1.3739    0.7645
 Columns 7 to 10
    1.2047    0.8725    0.6744    1.2186

.
 
zzephod said:
The $$y$$'s are $$\sim N(y,R)$$ with $$y=1$$ and $$R=1/10$$, so in Matlab code a sample of 10 $$y$$'s would be generated thusly:

Code:
--> ysamp=1+randn(1,10)/sqrt(10)

ysamp =

 Columns 1 to 6
    1.0032    1.0506    0.5366    0.9875    1.3739    0.7645
 Columns 7 to 10
    1.2047    0.8725    0.6744    1.2186

.

Can you explain the plus one and divided by sqrt(10). I understand the randn.
 
If y was represented as \(y = 0.1k + \) noise, \(r = 0.1\), and we want 6 values, would it be
Code:
for i = (1:1:6)
     sampley = 1 + 0.1*i + randn(1,6)/sqrt(10)
end

I just realized this doesn't make sense because we will have 6 1x6 column vectors. I am not sure how to use this definition of \(y\).

Or would it be
Code:
for i = (1:1:6)
     sampley = randn(1,6)/sqrt(10)
end
and then where I use my sample ys (which is in a loop), I can augment them as
Code:
for i = (2:1:8)
     some stuff
     x(i) = ax(i) + K(i)*((y(i - 1) + (i - 1)*.1) - ax(i))
     some stuff
end
 
Last edited:
dwsmith said:
Can you explain the plus one and divided by sqrt(10). I understand the randn.

randn(nrows,ncols) generates a matrix of nrows rows and ncols columns of samples from a zero mean unit variance normal distribution.

Code:
-->Sample_Mean=1.0;

-->Sample_Variance=1/10.0;

-->ysamp=Sample_Mean+randn(1,10)*sqrt(Sample_Variance)

ysamp = 

Columns 1 to 6    1.0032    1.0506    0.5366    0.9875    1.3739    0.7645
 
Columns 7 to 10    1.2047    0.8725    0.6744    1.2186
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
8K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K