Kalman filter and simulating Gaussian noise

Click For Summary
SUMMARY

The discussion focuses on using Kalman filtering to generate Gaussian random noise for simulating water level measurements. The static state model parameters include an initial variance \(P_0 = 1000\), system noise \(Q = 0.0001\), and measurement noise \(R = 0.1\). Participants provide MATLAB code examples for generating 10 values of \(y\) based on the normal distribution \(y \sim N(y_{true}, R)\) with \(y_{true} = 1\) and \(R = 1/10\). Clarifications are sought regarding the MATLAB functions used and their implications in the context of Kalman filtering.

PREREQUISITES
  • Understanding of Kalman filtering principles
  • Familiarity with MATLAB programming
  • Knowledge of Gaussian distributions and noise modeling
  • Basic linear algebra concepts related to state-space models
NEXT STEPS
  • Learn how to implement Kalman filters in MATLAB
  • Explore the properties of Gaussian noise and its applications in signal processing
  • Study the impact of measurement noise on Kalman filter performance
  • Investigate advanced topics in state-space modeling and estimation techniques
USEFUL FOR

Researchers, engineers, and data scientists involved in signal processing, control systems, and statistical modeling who are looking to implement Kalman filtering techniques and simulate Gaussian noise in their projects.

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