spMarkov: Spatial Markov Matrices

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/spMarkov.R

Description

A function to calculate Spatial Markov Matrices as proposed by Rey (2001).

Usage

1
2
3
4
5
6
7
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)

Arguments

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 style='fixed', the breaks to be provided by the user to discretize the data.

breaks.lag

If style='fixed', user provided breaks for the spatial lag.

pool

If pool=TRUE, the data is pooled, so that a unique set of time-invariant breaks is determined. If pool=FALSE (the default), each variable is discretized using time-variant breaks (i.e. a different set of breaks for each time period). If pool=TRUE, it is recommended to set std=TRUE.

std

Should the data be standardized? If std=TRUE, the data is standardized by each period by the mean.

Details

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.

Value

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.

Author(s)

Osmar Leandro Loaiza Quintero

References

Rey, Sergio (2001). 'Spatial Empirics for Economic Growth and Convergence', Geographical Analysis, Vol.33, No.3.

See Also

steadyState, mfpt, nb2listw, poly2nb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(usinc)
stateVars<-names(usinc@data[,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@data, lw, stateVars=stateVars,n.states=5,stateNames=stateNames,pool=TRUE,std=TRUE)
M$t;M$p

spdyn documentation built on Feb. 6, 2021, 3 a.m.