ppml {ppml}R Documentation

Poisson Pseudo Maximum Likelihood Estimator

Description

Can be used to estimate gravity models using glm with the quasipoisson distribution, a log-link and heteroskedasticity robust standard errors.

Usage

ppml(formula = formula, data = data, ...)

Arguments

formula

An expression of the form y \tilde model

data

Data containing the variables of interest

...

Currently not used.

Details

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.

Value

A list with class attribute glm and ppml holding the following elements:

coefficients
residuals
fitted.values
effects
R
rank
qr
family
linear.predictors
deviance
aic
null.deviance
iter
weights
prior.weights
df.residual
df.null
y
converged
boundary
model
call
formula
terms
data
offset
control
method
contrasts
xlevels

See glm for more information for the elements.

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

See Also

glm

Examples

## load data of package
data("TradeFlows", package = "ppml")

## gravity model with 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)
              
## summary of the model
summary(model)


[Package ppml version 0.1 Index]