1

I am new to HMM but I have gone through enough literature. I am working on a project in which I will be predicting rainfall using atmospheric parameters.

I have four observable characteristics of the atmosphere (humidity, temperature, wind, sea level height) for 10 years. I have also rainfall amount data with me.

As per I can understand, for each day a weather state will be specified on the basis of the spatial rainfall. So here goes the question. Lets suppose I have data for 100 days.

Rainfall = { 1,2,3,4... 100}. So if I want to generate weather states what should I do?

Lets suppose

temperature = { 30 to 45, some kind of distribution }
humidity = { 25 to 80 }
wind = { 60 to 100 }
sea level height = { 35 to 90 }

How to find

  • P(X_0) Initial parameter,
  • P(X_t|X_t-1) state transition matrix,
  • P(Y_t|X_t) dependence of observation on state

Do I need some clustering for generating states?

I am coding it in MATLAB.

You can come with your example or any source which can explain the procedure to implement in program.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Kumar
  • 13
  • 6
  • As @nispio pointed out in the answer below, HMMs are fundamentally constructed using discrete-valued state and output variables. You might want to look into [Kalman Filters](http://en.wikipedia.org/wiki/Kalman_filter) ([tutorial](http://bilgin.esme.org/BitsBytes/KalmanFilterforDummies.aspx)), which is the same model but uses continuous-valued states and outputs -- might be a better type of model for your dataset. – lmjohns3 Nov 09 '13 at 03:01

1 Answers1

0

An HMM has a discrete number of states, so your first step will be to define your states. Once you have well-defined states, come up with a numbering scheme for your states and write a function that can accept the data for a given time period, and output the state number that corresponds to that state.

Once you have a function (let's call it get_state) that maps data to a state number, you can create your state transition matrix as follows:

T = zeros(num_states);
for day = 2:num_days
    s1 = get_state(data(day-1));
    s2 = get_state(data(day));
    T(s1,s2) = T(s1,s2) + 1;
end

The i,j-th element of the matrix T now gives you the transition counts from state i to j. You can turn this into transition probabilities as follows:

M = bsxfun(@rdivide,T+1,sum(T+1,2));

The dependence of the observation on the state is harder. You will have to figure out how you want to turn the observed data into a probability density function or probability mass function. You can have mutliple observed distributions from a single state instead of combining temperature, humidity, etc., into a single observation.

This is obviously not a full implementation, but hopefully it is enough to give you a starting point.

nispio
  • 1,743
  • 11
  • 22