Skip to contents

\(S_{ms,pan}(b) = n^{-1}\sum_i\sum_{t>r}(Y_{it} - Y_{ir}) 1\{W_{itr}'b \ge 0\}\) with \(W_{itr} = X_{it} - X_{ir}\) (4.39), maximised subject to \(|b_1| = 1\); the smoothed form (4.40) replaces the indicator with \(K(W_{itr}'b/h_n)\).

Usage

morie_panel_max_score(
  x,
  y,
  n_periods,
  smoothed = TRUE,
  h = NULL,
  n_restarts = 8L,
  seed = 0L
)

Arguments

x

numeric array (n, T, d) or matrix (n*T, d) with each individual's T rows contiguous.

y

binary responses shaped to match x.

n_periods

number of periods T, at least 2.

smoothed

use (4.40) rather than the discontinuous (4.39).

h

bandwidth for the smoothed form; n^(-1/5) when NULL.

n_restarts

restarts, since (4.39) is a step function.

seed

RNG seed for the restarts.

Value

list: beta, score, n_pairs, n_discordant_pairs, unidentified_columns, intercept_identified, smoothed, bandwidth, rate_exponent, n, T, d, method.

Details

Differencing removes the individual effect \(U_i\) entirely: no distributional assumption on it is needed and it may be correlated with the regressors. The same differencing costs what a linear fixed-effects model gives up – an intercept is not identified, regressors constant within an individual are not identified, and only pairs with \(Y_{it} \ne Y_{ir}\) contribute. Constant columns are detected and named rather than silently estimated. Mirrors morie.fn.hrzpanms.

References

Horowitz, Sec. 4.4.2, eqs. (4.37)-(4.40), Theorems 4.9-4.10; Manski (1987).

Examples

set.seed(1)
x <- array(rnorm(800), dim = c(200, 2, 2))
y <- matrix(as.numeric(rnorm(400) > 0), nrow = 200)
morie_panel_max_score(x, y, 2, n_restarts = 2)$intercept_identified
#> [1] FALSE