cm_net_tot {migest} | R Documentation |
Conditional maximization routine for the indirect estimation of origin-destination-type migration flow tables with known net migration and grand totals.
Description
The cm_net
function finds the maximum likelihood estimates for fitted values in the log-linear model:
\log y_{ij} = \log \alpha_{i} + \log \alpha_{i}^{-1} + \log m_{ij}
Usage
cm_net_tot(
net_tot = NULL,
tot = NULL,
m = NULL,
tol = 1e-06,
maxit = 500,
verbose = TRUE,
alpha0 = rep(1, length(net_tot)),
lambda0 = 1,
alpha_constrained = TRUE
)
Arguments
net_tot |
Vector of net migration totals to constrain the sum of the imputed cell row and columns. Elements must sum to zero. |
tot |
Numeric value of grand total to constrain sum of all imputed cells. |
m |
Array of auxiliary data. By default, set to 1 for all origin-destination-migrant typologies combinations. |
tol |
Numeric value for the tolerance level used in the parameter estimation. |
maxit |
Numeric value for the maximum number of iterations used in the parameter estimation. |
verbose |
Logical value to indicate the print the parameter estimates at each iteration. By default |
alpha0 |
Vector of initial estimates for alpha |
lambda0 |
Numeric value of initial estimates for lambda |
alpha_constrained |
Logical value to indicate if the first alpha should be constrain to unity. By default |
Value
Conditional maximisation routine set up using the partial likelihood derivatives. The argument net_tot
takes the known net migration totals.
The user must ensure that the net migration totals sum globally to zero.
Returns a list
object with
mu |
Array of indirect estimates of origin-destination matrices by migrant characteristic |
it |
Iteration count |
tol |
Tolerance level at final iteration |
Author(s)
Guy J. Abel, Peter W. F. Smith
Examples
m <- matrix(data = 1:16, nrow = 4)
# m[lower.tri(m)] <- t(m)[lower.tri(m)]
addmargins(m)
sum_net(m)
y <- cm_net_tot(net_tot = c(30, 40, -15, -55), tot = 200, m = m)
addmargins(y$n)
sum_net(y$n)
m <- matrix(data = c(0, 100, 30, 70, 50, 0, 45, 5, 60, 35, 0, 40, 20, 25, 20, 0),
nrow = 4, ncol = 4, byrow = TRUE,
dimnames = list(orig = LETTERS[1:4], dest = LETTERS[1:4]))
addmargins(m)
sum_net(m)
y <- cm_net_tot(net_tot = c(-100, 125, -75, 50), tot = 600, m = m)
addmargins(y$n)
sum_net(y$n)