spMarkov | R Documentation |
A function to calculate Spatial Markov Matrices as proposed by Rey (2001).
spMarkov(data, listw, stateVars, n.states,
stateNames, style = "quantile", breaks,
breaks.lag, pool = TRUE, std = TRUE)
spInitState(data,listw,stateVars,n.states,
stateNames=NULL,style='quantile',
breaks,breaks.lag,pool=TRUE,std=TRUE)
data |
A data frame arranged in such a way that there is one row per observation, and one column recording the state of each observation, with as many columns as time periods. |
listw |
A list of spatial weights, as given by the spdep package (see: mat2listw, nb2listw). |
stateVars |
The columns in the data frame which describe the temporal evolution of the variable of interest (one column per year). |
n.states |
The number of states to be assumed for the Markov process. |
stateNames |
The names to be given to the states of the Markov process. |
style |
The type of intervals or breaks to be computed. Currently, two options are allowed: 'quantile' breaks, or 'fixed' breaks. In the latter case, the breaks should be provided by the user. |
breaks |
If |
breaks.lag |
If |
pool |
If |
std |
Should the data be standardized? If |
A spatial Markov matrix is a slight modification of the traditional Markov matrix, that conditions a region's transition probabilities on the initial state of its spatial lag, namely, on the initial state of its neighbours.
Note that unlike the markov
function, currently spMarkov
does not admit already discretized data.
This is because to determine the spatial lag, a continous variable is required.
The function 'spMarkov
' returns a spatial markov matrix. The function
'spInitStates
' retrieves the initial states of the spatial markov process.
An object of class 'spMarkov
' containing two arrays of dimensions k*k*k
, where k=n.states
.
t |
An array of transition counts |
p |
An array of transition probabilities |
Note that each array can be interpreted as an object containing k
matrices of dimensions k*k
.
Osmar Leandro Loaiza Quintero
Rey, Sergio (2001). 'Spatial Empirics for Economic Growth and Convergence', Geographical Analysis, Vol.33, No.3.
steadyState, mfpt, nb2listw, poly2nb
data(usinc)
stateVars<-names(usinc[,7:87])
stateNames<-c('Poor','Lower','Middle','Upper','Rich')
#Create a list of spatial weights
require(spdep)
lw<-nb2listw(poly2nb(usinc,queen=TRUE),style='W')
M<-spMarkov(usinc, lw, stateVars=stateVars,n.states=5,stateNames=stateNames,pool=TRUE,std=TRUE)
M$t;M$p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.