
Last chance! 50% off unlimited learning
Sale ends in
The cm_net
function finds the maximum likelihood estimates for fitted values in the log-linear model:
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
)
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
Array of indirect estimates of origin-destination matrices by migrant characteristic
Iteration count
Tolerance level at final iteration
Vector of net migration totals to constrain the sum of the imputed cell row and columns. Elements must sum to zero.
Numeric value of grand total to constrain sum of all imputed cells.
Array of auxiliary data. By default, set to 1 for all origin-destination-migrant typologies combinations.
Numeric value for the tolerance level used in the parameter estimation.
Numeric value for the maximum number of iterations used in the parameter estimation.
Logical value to indicate the print the parameter estimates at each iteration. By default FALSE
.
Vector of initial estimates for alpha
Numeric value of initial estimates for lambda
Logical value to indicate if the first alpha should be constrain to unity. By default TRUE
Guy J. Abel, Peter W. F. Smith
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)
Run the code above in your browser using DataLab