Search  Simulistics  Model catalogue  Listed by keyword  Listed by ID  Listed by title  Listed by date added 
Model : markov2
Simile version : 3.1+
Date added : 20030625
Keywords :
Vegetation dynamics ;
Landuse change ;
Markov model ;
Spatial modelling ;
Stochastic modelling ;
Consider an area divided into grid squares, with each square having one of n possible states. These could correspond to n differenttypes of vegetation, or n land uses. There is a certain probability that each state will undergo a transition to some other state, with this probability depending on the current state. Grid squares behave independently of each other.
This model implements a case where there are three states, i.e. n = 3. We thus need a 3x3 array to capture the conditional probability of state i changing to state j during one time step. In the present case, we use the following table:
From \ To  1  2  3 
1  0.96  0.02  0.02 
2  0.02  0.96  0.02 
3  0.02  0.02  0.96 
In other words, each state has (in this particular example) a 96% chance of staying the same, and a 2% chance of changing to each other state.
To make this work, we need to be able to randomly generate a state (an integer between 1 and 3) with the correct probability. Thus, if the current state is 1 (the top row), we need to be able to generate a 1 with a probability of 0.96, a 2 with a probability of 0.02, and a 3 with a probability of 0.02.
One way of doing this is to use the “colin( )” function (named after the famous vegetation ecologist, who first presented us with the problem of modelling this situation in Simile). The present example shows another way of tackling it. It works like this:
In the present implementation, these lower and upper values are represented in two 3x3 arrays, held in the variables lower and upper respectively. Within the grid cell submodel, one row from these two arrays is selected, according to the current state of that cell. This is then compared with a random number r to determine the new state. This is then used to engineer an appropriate value for the flow causing a change in the state compartment.
Model fileClick on the icon to download the model file. (You will need Simile to examine and run the model. A free evaluation version is available from the products page.) Some browsers may attempt to display the model file, rather than open it in Simile; in this case, use the browser back button to return to this page, and use the context menu (invoked by rightclicking on the link) to save the target file to disk. 

markov2.sml 
Equations in ../Desktop upper = [[0.96,0.98,1.0],[0.02,0.98,1.0],[0.02,0.04,1.0]] lower = [[0.0,0.96,0.98],[0.0,0.02,0.98],[0.0,0.02,0.04]] Equations in cell state: initial value = 1 state change = (state)+sum([select]) select = if r>[low]and r<[up]then[index]else 0 r = rand_var(0,1) up = element([[upper]],state) low = element([[lower]],state) index = [1,2,3] row = fmod(index(1)1,20)+1 column = floor((index(1)1)/20)+1
The following image shows the types of results that are obtained, visualised using the grid display helper. The three colours represent 3 vegetation types.

Copyright 20032022 Simulistics Ltd