slides - Bayes
Download
Report
Transcript slides - Bayes
Bayesian Analysis of Spatio-Temporal Dynamic
Panel Models with Fixed and Random Effects
Mohammadzadeh, M. and Karami, H.
Tarbiat Modares University, Tehran, Iran
Rasouli, H.
Trauma Research Center, Baqiyatallah University of Medical Sciences, Tehran Iran.
Bayes2014
11-13 June 2014 University College London, UK
Outline
1- Problem
2- Panel Regression Model
3- Dynamic Panel Model
4- Spatial Dynamic Panel Model
5- Bayesian Estimation of the Models
6- Application on Real Data
7- Conclusion
Problem
Observations correlated depending on their locations, are called
spatial data.
Spatial data obtained in successive periods is called spatiotemporal data.
If they are independent over time, is called spatial panel data.
Due to the spatial or spatio-temporal correlation of data, it is
necessary to determine their correlation structure and apply it in
data analysis.
Problem
This requires determining the spatial or spatio-temporal
covariance function, which is usually unknown and must be
estimated.
A key issue in panel data modeling is variability among the
experimental units.
Because of the heterogeneity between spatial locations each
location may have different effects on data.
These effects can be either fixed or random.
Problem
In this talk a panel regression model is investigated.
Then it is developed to dynamic and spatial dynamic panel
regression models.
Also, we show how the spatial fixed and random effects can be
considered in these models.
The spatial and temporal correlation of data can be included
simultaneously in spatial dynamic panel models.
Problem
Then the Bayesian estimation of the models parameters are
presented.
Application of the proposed models for analysis of economic
factors affecting on crime data in Tehran city is shown.
Finally, the performances of the models are evaluated.
Background
Baltagi (2001) and Elhorst (2003) specified the spatial panel
models and estimated their parameters.
Elhorst (2003) has provided a review of issues arising in the
estimation of panel models commonly used in applied researches
including spatial error or spatially lagged dependent variables.
Anselin et al. (2008) introduced different types of spatial panel
models.
Debarsy and Ertur (2010) have provided a Bayesian estimation for
dynamic panel models.
Debarsy et al. (2012) interpreted the dynamic space-time panel
data.
Yang and Su (2012) have estimated the parameters of dynamic
panel models with spatial errors.
Panel Regression Model (PRM)
๐ฆ๐๐ก = ๐โฒ๐๐ก ๐ท + ๐๐๐ก + ๐๐๐ก ,
๐ = 1, โฏ , ๐ ๐ก = 1, โฏ , ๐
๐ฆ๐๐ก : observation at unit i and time t,
๐๐๐ก : ๐ × 1 vector of exploratory variables,
๐ท : ๐ × 1 vector of regression coefficients,
๐๐๐ก : effect of i th unit at time t,
๐๐๐ก โถ error term,
๐๐๐ก ~๐(0, ๐ 2 ).
Panel Regression Model (Matrix Form)
If we set ๐๐ก = (๐ฆ1๐ก , โฆ , ๐ฆ๐๐ก )โฒ
,
๐๐ก = (๐1๐ก , โฆ , ๐๐๐ก )โฒ ,
โฒ
๐ฟ๐ก = (๐1๐ก
, โฆ , ๐โฒ๐๐ก )โฒ ,
๐บ๐ก = (๐1๐ก , โฆ , ๐๐๐ก )
Then the matrix form of PRM is given by
๐๐ก = ๐ฟ๐ก ๐ท + ๐๐ก + ๐บ๐ก ,
๐บ๐ก ~๐(๐, ๐ 2 ๐ฐ),
๐ก = 1, โฏ , ๐
Dynamic Panel Regression Model (DPRM)
๐๐ก = ๐๐๐กโ1 + ๐ฟ๐ก ๐ท + ๐๐ก + ๐บ๐ก
๐บ๐ก ~๐ ๐, ๐ 2 ๐ฐ ,
๐ก = 1, โฏ , ๐
where ๐๐กโ1 is the lagged variable observed at time t-1 and ๐ is the
lagged autoregressive coefficient.
Spatial Dynamic Panel Regression Model (SDPRM)
๐๐ก = ๐๐พ๐๐ก + ๐๐๐กโ1 + ๐ฟ๐ ๐ท + ๐๐ก + ๐บ๐ก
๐บ๐ก ~๐(๐, ๐ 2 ๐ฐ)
where ๐ is spatial autoregressive coefficient and W is a spatial
weight matrix:
๐ค๐๐ = ๐๐๐
โ๐ผ
,๐ผ > 0
dij =d(si โ sj )=[ xi โ xj
p
p 1
+ yi โ yj ]p , p โฅ1
Bayesian Estimation of DPRM:
Prior distributions:
Conjugate priors:
and
๐ 2 ~๐ผ๐บ ๐, ๐ ,
๐ท~๐ ๐ฝ0 , ๐ด0 ,
โ1
๐~๐(๐โ1
๐๐๐ , ๐๐๐๐ฅ ), where ๐๐๐๐ and ๐๐๐๐ฅ are minimum and
maximum Eigen values of the weight matrix (San et al, 1999).
The posterior distribution is given by
๐ ๐ท, ๐, ๐, ๐ 2 ๐ โ ๐ ๐ ๐ท, ๐, ๐ 2 ๐ ๐ท ๐(๐)๐ ๐ ๐(๐ 2 )
But this distribution has not close form.
To use Gibbs sampling the full conditionals are needed:
Full conditional of ๐ท โถ
๐ท| ๐, ๐, ๐, ๐ 2 ~๐ต(๐ฉโ๐ ๐, ๐ฉโ๐ )
where
๐ฉ = (๐ โ2
๐ = 2[ ๐ โ2
๐
โฒ
๐ก=1 ๐ฟ๐ก ๐ฟ๐ก
+
๐
โฒ
๐ก=1 ๐ฟ๐ก (๐๐ก
โ1
0 )
โ ๐๐๐กโ1 โ ๐๐ก ) +
โ1
0 ๐ท0
]
Full conditional of ๐๐ โถ
๐ 2 | ๐, ๐ท, ๐, ๐ ~๐ผ๐บ(๐โ , ๐ โ ),
where
๐โ = ๐ +
๐โ =
๐
๐
๐๐
,
2
๐ป
๐=๐( ๐๐ก
โ ๐๐๐กโ1 โ ๐ฟ๐ก ๐ท โ ๐๐ก )โฒ ๐๐ โ ๐๐๐กโ1 โ ๐ฟ๐ก ๐ท โ ๐๐ก + ๐
Full conditional of ๐
๐|(๐, ๐ท, ๐, ๐ 2 ) โผ ๐(๐๐ , ๐พ)
where
๐๐ = (
๐พ = ๐ 2(
๐
โฒ
โ1
๐ก=1 ๐๐กโ1 ๐๐กโ1 )
๐ป
๐=๐(๐๐ก
โ ๐ฟ๐ก ๐ท โ ๐๐ก )โฒ๐๐กโ1
๐ป
โฒ
โ1
๐=๐ ๐๐กโ1 ๐๐กโ1 )
Now we consider two cases for fixed and random effects.
a) Fixed Effects:
Suppose effects of all units are fixed at different times and
๐๐ก = ๐ = (๐1 , โฆ , ๐๐ )โฒ ~๐ต(๐๐ , ๐๐ )
Full conditional of ๐ :
๐| ๐, ๐ท, ๐ 2 ~๐(๐๐ , ๐๐ )
where
๐๐ = ๐๐ [๐ โ2
๐
๐ก=1( ๐๐
โ ๐๐๐กโ1 โ ๐ฟ๐ก ๐ท) + ๐โ1
0 ๐0 ]
โ1
๐๐ = (๐๐ โ2 ๐ฐ๐ต + ๐โ1
0 )
b) Random Effects
Suppose random effects of all units are fixed at different times
๐๐ก = ๐ = ๐1 , โฆ , ๐๐
โฒ
where ๐๐ ~๐(๐โ , ๐๐2 ), i=1,โฆ,N
Full conditional of ๐ :
๐| ๐, ๐ท, ๐๐ ~๐ต(๐๐ , ๐ฎ๐๐ )
where
๐๐ = ๐ฎ๐๐ [๐ โ2
๐
๐ก=1( ๐๐
โ ๐๐๐กโ1 โ ๐ฟ๐ก ๐ท) + ๐๐โ2 ๐โ ๐ฐ๐ ]
๐ฎ๐๐ = (๐๐ โ2 ๐ฐ๐ต + ๐๐โ2 ๐ฐ๐ )โ1
Prior distributions for hyper parameters:
Suppose ๐โ ~๐ต ๐โ๐ , ๐๐๐๐ and ๐๐๐ ~๐ฐ๐ฎ ๐จ, ๐ฉ ,
Full conditional of ๐โ :
๐โ |(๐, ๐๐๐ )~๐ต(๐โ๐ , ๐๐๐โ๐ )
where
โ
โ๐ โฒ
๐โ๐ = ๐๐๐โ๐ ๐โ๐
๐๐ ๐๐ + ๐๐ ๐พ๐ต ๐
โ๐ โ๐
๐๐๐โ๐ = (๐โ๐
๐๐ + ๐ต๐๐ )
Full conditional of ๐๐๐ :
๐๐๐ |(๐, ๐โ๐ )~๐ฐ๐ฎ(๐จ +
๐ต
๐
, ๐ฉ + (๐ โ ๐โ๐ ๐พ๐ต )โฒ ๐ โ ๐โ๐ ๐พ๐ต )
๐
๐
Bayesian Estimation of SDPRM:
๐๐ก = ๐๐พ๐๐ก + ๐๐๐กโ1 + ๐ฟ๐ ๐ท + ๐๐ก + ๐บ๐ก
๐บ๐ก ~๐(๐, ๐ 2 ๐ฐ)
The conditional likelihood function at time t is:
๐๐ก |(๐๐กโ๐ , ๐ท, ๐, ๐, ๐๐ก , ๐ 2 )~๐ต(๐, ๐ฎ)
where
๐ = ๐๐พ๐๐ก +๐๐๐กโ1 + ๐ฟ๐ ๐ท + ๐๐ก
๐ฎ=๐ 2 (Iโ ๐๐พ)โ1 (Iโ ๐๐พโฒ)
โ1
Bayesian Estimation of SDPRM:
Prior distributions:
๐ 2 ~๐ผ๐บ ๐, ๐ ,
๐ฝ~๐ ๐ฝ0 , ๐ด0
โ1
๐~๐(๐โ1
๐๐๐ , ๐๐๐๐ฅ )
where ๐๐๐๐ and ๐๐๐๐ฅ are minimum and maximum eigen
values of the weight matrix (San et al, 1999).
The posterior distribution is given by
๐ ๐ท, ๐, ๐, ๐, ๐ 2 ๐ โ ๐ ๐ ๐ท, ๐, ๐, ๐, ๐ 2 ๐(๐)๐ ๐ท ๐ ๐ ๐(๐ 2 )
But this distribution has not close form.
To use Gibbs sampling the full conditionals are needed:
Full conditional of ๐ท โถ
๐ท| ๐, ๐, ๐, ๐, ๐ 2 ~๐ต(๐ฉโ๐ ๐, ๐ฉโ๐ )
where
๐ฉ = (๐โ๐
๐ป
โฒ
๐=๐ ๐ฟ๐ ๐ฟ๐
๐ = 2 ๐โ๐
๐ป
โฒ
๐=๐ ๐ฟ๐
+
โ๐
๐ )
๐๐ โ ๐๐พ๐๐ โ ๐๐๐กโ1 โ ๐๐ +
โ๐
๐ ๐ท๐
Full conditional of ๐๐ โถ
๐ 2 | ๐, ๐ท, ๐, ๐, ๐ ~๐ผ๐บ(๐โ , ๐ โ ),
where
๐โ = ๐ +
๐โ =
๐
๐
๐๐
,
2
๐ป
๐=๐( ๐๐
โ ๐๐พ๐๐ก โ ๐ฟ๐ก ๐ท โ ๐๐ )โฒ ๐๐ก โ ๐๐พ๐๐ก โ ๐ฟ๐ก ๐ท โ ๐๐ก + ๐
Full conditional of ๐
๐ ๐ ๐, ๐ท, ๐, ๐, ๐๐ ) โ |(๐ฐ๐ต โ ๐๐พโฒ )( ๐ฐ๐ต โ
โ๐ป
๐๐พ)| ๐ ๐๐ฑ๐ฉ(โ
๐
๐๐๐
๐ป
๐บโฒ๐ ๐บ๐ )
๐=๐
where
๐บ๐ =๐๐ โ ๐๐พ๐๐ โ ๐๐๐กโ1 โ ๐ฟ๐ ๐ท โ ๐๐
Full conditional of ๐
๐|(๐, ๐ท, ๐, ๐, ๐๐ ) โผ ๐ต(๐๐ , ๐ธ)
where
๐๐ = ๐๐ (
๐ธ=๐๐ (
๐ป
โฒ
โ๐
๐
๐=๐ ๐โ๐ ๐๐โ๐ )
๐ป
โฒ
โ๐
๐=๐ ๐๐โ๐ ๐๐โ๐ )
๐ป
๐=๐(๐๐
โ ๐๐พ๐๐ โ ๐ฟ๐ ๐ท โ ๐๐ )โฒ๐๐โ๐
a) Fixed Effects:
Suppose effects of all units are fixed at different times and
๐๐ก = ๐ = (๐1 , โฆ , ๐๐ )โฒ ~๐ต(๐๐ , ๐๐ )
Full conditional of ๐ :
๐| ๐, ๐ท, ๐, ๐๐ ~๐ต(๐๐ , ๐๐ )
where
๐๐ = ๐๐ [๐โ๐
๐ป
๐=๐( ๐๐
โ ๐๐พ๐๐ โ ๐๐๐กโ1 โ ๐ฟ๐ ๐ท) + ๐โ๐
๐ ๐๐ ]
โ๐
๐๐ = (๐ป๐โ๐ ๐ฐ๐ต + ๐โ๐
๐ )
b) Random Effects
Suppose random effects of all units are fixed at different times
๐๐ก = ๐ = ๐1 , โฆ , ๐๐
โฒ
๐๐ ~๐(๐โ , ๐๐2 ), i=1,โฆ,N
Full conditional of ๐ :
๐| ๐, ๐ท, ๐, ๐๐ ~๐ต(๐๐ , ๐ฎ๐๐ )
where
๐๐ = ๐ฎ๐๐ [๐โ๐
๐ป
๐=๐( ๐๐
โ ๐๐พ๐๐ โ ๐๐๐กโ1 โ ๐ฟ๐ ๐ท) + ๐๐โ๐ ๐โ ๐ฐ๐ต ]
โ๐
๐ฎ๐๐ = (๐ป๐โ๐ ๐ฐ๐ต + ๐โ๐
๐ ๐ฐ๐ต )
Prior distributions for hyper parameters:
If ๐๐๐ ~๐ฐ๐ฎ ๐จ, ๐ฉ
๐๐ง๐ ๐โ ~๐ต(๐โ๐ , ๐๐๐๐ ) then
Full conditional of ๐โ :
๐โ |(๐, ๐๐๐ )~๐ต(๐โ๐ , ๐๐๐โ๐ )
where
โ
โ๐ โฒ
๐โ๐ = ๐๐๐โ๐ ๐โ๐
๐๐ ๐๐ + ๐๐ ๐พ๐ต ๐
โ๐ โ๐
๐๐๐โ๐ = (๐โ๐
๐๐ + ๐ต๐๐ )
Full conditional of ๐๐๐ :
๐๐๐ |(๐, ๐โ )~๐ฐ๐ฎ(๐จ +
๐ต
๐
, ๐ฉ + (๐ โ ๐โ๐ ๐พ๐ต )โฒ ๐ โ ๐โ๐ ๐พ๐ต ))
๐
๐
Modeling of Crime Data
Dependent variable is murder rate (per 100,000 people) in 30 cities of Iran in
years 2000 -2010.
Independent variables are indexes of unemployment, industrialization and
income inequality.
Accuracy of the models are compared by BIC criteria.
Prior distributions:
๐ฝ0 , ๐ฝ1 , ๐ฝ2 , ๐ฝ3 ~๐(0, 103 )
1
~๐บ
๐2
0.01,0.01
๐๐ ~๐ ๐โ , ๐๐ข2
๐~๐ 0,100๐ผ๐
๐โ ~๐ 0,100
๐ 2 ~๐ผ๐บ(0.01,0.01)
Normality of the data
Histogram
P-P plot
Data transformed by Box-Cox transformation with ๐ = โ0.29 .
The p_value=0.13 for Shapiro-Wilk test shows normality of transformed
The Estimates of the models parameters and BIC
DPRM
Items
Parameters
SDPRM
Random Effect
Fixed Effect
Random Effect
Fixed Effect
Constant
๐ฝ0
13.43
-40.65
73.44
294.78
Unemployment
๐ฝ1
0.60
0.49
0.74
0.58
Industrial
๐ฝ2
0.009
0.007
0.009
0.007
Deference income
๐ฝ3
25.82
24.63
32.96
31.89
Time autoregressive
๐
0.21
0.135
-0.002
-0.002
๐2
538.42
613.57
538.44
608.38
๐
-
-
-0.138
-0.107
494
522
481
478
Variance
Spatial
autoregressive
BIC
Based on BIC criteria the spatial dynamic fixed effect regression
model is better than the other models
Conclusion
๏ The variability between experimental units can be
considered by dynamic panel regression models.
๏Spatial and spatio-temporal correlation of data can be
considered by using spatial dynamic panel regression models.
๏For analysis of crime data in Tehran city, a spatial dynamic
panel regression model with fixed effect is more accurate than
the other models.
๏By using spatial dynamic panel regression model we are able
to consider the spatio-temporal correlation of data without
providing covariance function.
REFERENCES
Anselin, L., Le Gallo, J. and Jayet, H. (2008), Spatial Panel Econometrics, in The
Econometrics of Panel Data: Fundamentals and Recent Developments in Theory and Practice,
Berlin, Springer. Group New York.
Mohammadzadeh, M. and Rasouli, H. R. (2013), Bayesian Analysis of Spatial Dynamic Panel
Regression Models, GeoMed 2013, Sheffield, UK.
Sun, D., Robert, K., Tsutakawa, L., Paul L. S. (1999), Posterior Distribution of
Hierarchical Models Using Car(1) Distributions, Biometrika, 86, 341-350.
Yang, Z. and Su, L. (2012), QML Estimation of Dynamic Panel Data Models with Spatial Errors,
18th Reserarch International Panel Data Conference.
Baltagi, B. H. (2001), Econometric Analysis of Panel Data, Chichester, Wiley.
Debarsy, N. Ertur, C., Lesage, J., (2012), Interpreting Dynamic Space-Time Panel Data
Models, Journal of Statistical Methodology, 9, 158-171.
Elhorst, J. P. (2003), Specification and Estimation of Spatial Panel Data
Models. International Regional Science Review, 26, 244-268.
Thank you for your attention