ppml: ppml

Description Usage Arguments Details Value Author(s) References Examples

Description

The maximum likelihood estimator for the Poisson distribution allows for consistent estimates provided that the conditional mean is correctly specified. Consistency requires the score vector to have expected value zero:

∑_i^n E[(y_i - \exp(\bold{x}_i' \bold{β})) \bold{x}_i] = 0

This is only the case if

E[y_i|\bold{x}_i] = \exp(\bold{x}_i' \bold{β})

Therefore the PMLE can still be used even if the data generating process of y_i is not the Poisson (Poisson Pseudo Maximum Likelihood) (Cameron and Trivedi, 2013).

The assumption of equidispersion does not hold for the PPMLE as the nuisance parameter φ from the GLM framework is not restricted to be 1 anymore:

Var[y_i|x_i] = φ \frac{\partial^2 b(θ_i)}{\partial θ_i^2} = φ \cdot e^{θ_i} = φ μ_i

and

\frac{Var[y|x]}{E[y|x]} = φ

This means that the PPMLE is optimal if the conditional variance is proportional to the conditional mean (Santos Silva, 2015).

As stated by Arvis and Shepherd (2013), the Pseudo Maximum Likelihood applicable to continuous variables can be derived from the log-likelihood function and the large number Stirling approximation for \ln(y_i!): \ln{y_i!} \approx y_i \ln{y_i} - y_i. The pseudo-log-likelihood function \tilde{\ell} of the Poisson PML is:

\tilde{\ell}(\bold{β}|y_i) \approx ∑_i^n\biggl[y_i \bold{x}_i' \bold{β} - \exp(\bold{x}_i' \bold{β})-y_i \ln{y_i}+y_i\biggr]

For the next step it is assumed that y_{ij} depicts the value of trade flows and \hat{y}_{ij} = \exp(\bold{x}_{ij}' \bold{β}) is the modelled value regressed on the actual value y_{ij}. Maximizing the pseudo-log-likelihood function with respect to \bold{β}:

\frac{\partial \tilde{\ell}(\bold{β}|y_i)}{\partial \bold{β}} = ∑_i ∑_j \biggl[y_{ij} \bold{x}_{ij}' - \exp(\bold{x}_{ij}' \bold{β})\bold{x}_{ij}' \biggr] = 0

∑_i ∑_j y_{ij} \bold{x}_{ij}' = ∑_i ∑_j \exp(\bold{x}_{ij}' \bold{β})\bold{x}_{ij}'

∑_i ∑_j y_{ij} \bold{x}_{ij}' = ∑_i ∑_j \hat{y}_{ij} \bold{x}_{ij}'

The predicted total trade flows between i and j when a dummy is true equals the actual total trade flows for the same subset (Arvis and Shepherd, 2013). Using PPML with importer- and exporter fixed effects therefore yields the desirable property of preserving the sums of the trade flows.

Another advantage of using ppml compared to the estimation of log-linearized gravity models via OLS is its ability to handle zero trade flows. As \ln{0} is not defined, the respective observations will be dropped. This loss of information can be avoided by estimating the multiplicative model via ppml.

Usage

1
ppml(formula = formula, data = data, robust = TRUE, ...)

Arguments

formula

An expression of the form y \tilde model

data

Data containing the variables of interest

robust

If robust=TRUE the heteroskedasticity-consistent estimation of the covariance matrix from the ‘sandwich’ package (HC1) will be used.

...

Currently not used.

Details

Can be used to estimate gravity models using glm with the quasipoisson distribution and a log-link.

Value

A list with class attribute summary.glm holding the following elements:

call
terms
family
deviance
aic
contrasts
df.residual
null.deviance
df.null
iter
deviance.resid
coefficients
aliased
dispersion
df
cov.unscaled
cov.scaled
attr

Author(s)

Lukas Kleinheinz

References

Arvis, J.-F. and Shepherd, B. (2013). “The poisson quasi-maximum likelihood estimator: a solution to the “adding up” problem in gravity models”, Applied Economics Letters, 20(6), 515–519.

Cameron, A. C. and Trivedi, P.K. (2013). “Regression Analysis of Count Data”, Econometric Society Monographs, 2 edn, Cambridge University Press

Santos Silva, J. (2015). “The log of gravity page”, http://personal.lse.ac.uk/tenreyro/lgw.html, Accessed: 2019-08-20

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## load data of package
data("TradeFlows", package = "ppml")

## gravity model without robust standard errors 
model <- ppml(formula = s ~ log_dist + contig + comlang_off + 
                colony + smctry + i_j + log_stri_i_j
              + rta + i + j, data = TradeFlows, robust = FALSE)
              
print(model)


## gravity model with robust standard errors 
model_robust <- ppml(formula = s ~ log_dist + contig + comlang_off + 
                       colony + smctry + i_j + log_stri_i_j
                     + rta + i + j, data = TradeFlows, robust = TRUE)

print(model_robust)

ppml documentation built on Aug. 25, 2019, 3:01 a.m.

Related to ppml in ppml...