Skip to contents

\(E(F) = \exp(b_0 + b_1 \log M_o + b_2 \log M_d + b_3 \log d)\) by the Poisson score equations (IRLS, as glm(family = poisson)); consistent under heteroskedasticity and keeps zero flows (Santos Silva and Tenreyro 2006). Returns HC0 sandwich and model-based standard errors, log-likelihood, AIC and BIC.

Usage

GravityPPML(flows, mass_o, mass_d, dist, tol = 1e-12, max_iter = 100L)

Arguments

flows

Non-negative flows.

mass_o, mass_d

Positive origin and destination masses.

dist

Positive distances.

tol

Relative deviance tolerance.

max_iter

Maximum IRLS iterations.

Value

List with coefficients, se_robust, se_model, fitted, loglik, aic, bic, iterations.

References

Santos Silva, J. M. C. and Tenreyro, S. (2006). The log of gravity. Review of Economics and Statistics 88, 641-658.

Examples

GravityPPML(c(12, 0, 30, 7, 55, 3), c(5, 5, 9, 9, 20, 20), c(9, 20, 5, 20, 5, 9),
            c(1, 3, 1, 2, 3, 2))$coefficients
#> [1]  8.8361998 -0.6109571 -2.5098502  0.8842146