Skip to contents

Bias correction solver for multinomial logit type problems

Usage

solve_biascorr.mnl(
  targets,
  areas,
  xmat,
  betas,
  priors = NULL,
  restrictions = NULL,
  options = downscale_control()
)

Arguments

targets

A dataframe with columns lu.from, lu.to and value (all targets >= 0)

areas

A dataframe of areas with columns lu.from, ns and value, with all areas >= 0 and with sum(areas) >= sum(targets)

xmat

A dataframe of explanatory variables with columns ks and value.

betas

A dataframe of coefficients with columns ks, lu.from, lu.to & value

priors

A dataframe of priors (if no betas were supplied) with columns ns, lu.from, lu.to (with priors >= 0)

restrictions

A dataframe with columns ns, lu.from, lu.to and value. Values must be zero or one. If restrictions are one, the MNL function is set to zero

options

A list with solver options. Call downscale_control for default options and for more detail.

Value

A list containing

  • out.res A n x p matrix of area allocations

  • out.solver A list of the solver output

Details

Given p targets matches either the projections from an MNL-type model or exogeneous priors.

You should not call this functions directly, call downscale instead.

min $$\sum ( z ij areas_i - targets_j )^2$$ s.t. $$ z_ij = \mu_ij$$ $$\mu_ij = \lambda_ij / (1 + \sum \lambda_ij )$$ $$\lambda_ij = x_j + \exp xmat_i betas_j$$ or \(\lambda_ij = x_j + priors_ij\) $$x_j >= 0$$ with \(i = 1,...,n\) and \(j = 1,...,n\). #' For each target either betas and xmats or priors have to be supplied. Priors have to be strictly larger or equal to zero.

When cutoff is specified, \(z_ij\) is defined as above if \(mu_ij > cutoff\). If \(mu_ij <= cutoff\) then \(z_ij = 0\). Per default cutoff is set to zero.

Targets should be specified in a dataframe with at least a lu.to and a value column. All targets must be larger or equal to zero. If an lu.from column is supplied it has to be specified in all arguments. In this case the bias correction is performed for all lu.from classes.

Areas correspond to either an areas per pixel (ns), with value or optionally the are of lu.from in a pixel. All areas must be larger The function expects lu.from

Restrictions are binary and optional. If restrictions are supplied, in case \(restrictions_ij = 1\) then \(z_ij = 0\).

Examples

## A basic example