Solving Noisy Weather Sensor Probability: Day 5 Sunny

  • Thread starter Thread starter carllacan
  • Start date Start date
  • Tags Tags
    Sensor Weather
Click For Summary
SUMMARY

The discussion focuses on calculating the probability of the weather being sunny on day 5 based on sensor measurements and a stochastic matrix. The sensor's noise is represented by the matrix S_{ij} = p(z_n = j | x_n = i), where z_n indicates the measurement and x_n the actual weather state. The user applies Bayes' Rule to derive the expression p(x_n = i | z_n = j) = (p(z_n = j | x_n = i)p(x_n = i))/p(z_n = j) but struggles to compute the actual probabilities. A Bayes Filter implementation is provided, although the user seeks validation on its correctness.

PREREQUISITES
  • Understanding of Bayesian probability and Bayes' Rule
  • Familiarity with stochastic matrices and their applications
  • Knowledge of sensor noise modeling in probabilistic systems
  • Basic programming skills in MATLAB or similar languages for implementing algorithms
NEXT STEPS
  • Study the application of stochastic matrices in weather prediction models
  • Learn about the implementation and validation of Bayes Filters
  • Explore advanced topics in sensor fusion and noise reduction techniques
  • Review case studies on probabilistic modeling in environmental sensing
USEFUL FOR

Data scientists, meteorologists, and engineers working with sensor data and probabilistic models will benefit from this discussion, particularly those interested in weather prediction and sensor accuracy improvement.

carllacan
Messages
272
Reaction score
3

Homework Statement



An imperfect sensor measures the weather (which can only be either sunny, cloudy or rainy) in a fixed place. Suppose we know the weather on the first day was sunny. In the following days we obtain the measurements cloudy, cloudy, rainy, sunny.

What is the probability that the weather at day 5 is indeed sunny as our sensor says?

Homework Equations



The noise of the sensor is given by a known stochastic matrix:

<br /> S_{ij} = p(z_n = j | x_n = i)<br />

where z_n refers to a measurement and x_n to the real state at day n, and i and j refer to the possible weathers (sunny, cloudy, rainy).

The Attempt at a Solution



I just tried to find a general formulation, as I saw that I would probably need it later.

By straightforward application of Bayes Rule I've found the expression:

<br /> p(x_n = i | z_n = j) = \frac{p(z_n = j | x_n = i)p(x_n = i)}{p(z_n = j)}<br />

Now, here is where I have trouble. How can I find out the real probability that one day had a certain weather?

In a previous exercise I was presented with a similar situation and was given a stochastic matrix that described the probability of weather on a certain day based on the weather of the previous day. I am not sure that it applies also to this exercise. Is there any way to solve it with the given data?
 
Last edited:
Physics news on Phys.org
I had misread the statement of the problem. I have update the info now. Can someone help me?
 
I've worked out this code for the Bayes Filter, would you mind telling me if I've done it right?
Code:
function newx = posterior(z, x0, transmat, sensmat)
  if size(z)(2) = 0
    newx = x0
  end
  
  prior = posterior(z(1:end-1), x0, transmat, sensmat)*transmat(:,x)	
  norm = sensmat*prior   
  newx = sensmat(x)(z)* prior / norm
endfunction
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 118 ·
4
Replies
118
Views
12K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 105 ·
4
Replies
105
Views
15K
  • · Replies 125 ·
5
Replies
125
Views
20K
  • · Replies 152 ·
6
Replies
152
Views
11K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 42 ·
2
Replies
42
Views
8K