MHB Kalman filter and simulating Gaussian noise

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
 
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...

Similar threads

Back
Top