Skip to contents

\(P(\theta|y_1, y^*, x) = f_W(y_1 - \beta'x_1)^{-1}\int f_\varepsilon(y_1 - \beta'x_1 - u)[\prod_{k=2}^{\theta} F_\varepsilon(y^* - \beta'x_k - u)] f_U(u) du\) (5.20).

Usage

morie_first_passage_time(
  theta,
  y1,
  y_star,
  x,
  beta,
  f_U,
  grid_u,
  f_eps,
  grid_z
)

Arguments

theta

horizon, at least 2.

y1

initial value.

y_star

threshold.

x

covariates for periods 1..theta.

beta

coefficients.

f_U, grid_u

density of U on its grid.

f_eps, grid_z

density of eps on its grid.

Value

list: probability, theta, f_W_at_initial, periods_conditionally_independent, periods_marginally_independent, method.

Details

This is why Sec. 5.2 estimates \(f_U\) and \(f_\varepsilon\) at all: they are rarely interesting in themselves, but the first-passage distribution cannot be written without BOTH.

The integral over u is what handles the individual effect correctly. Given \(U_j = u\) the periods are independent, so their probabilities multiply – the product in the integrand – but unconditionally they are DEPENDENT, because they share \(U_j\). Integrating the product against \(f_U\) rather than multiplying unconditional probabilities is the whole difference. Mirrors morie.fn.hrzfpt.

References

Horowitz, Sec. 5.2.3, eq. (5.20).

Examples

gu <- seq(-5, 5, length.out = 201)
morie_first_passage_time(
  3, 0, 1, matrix(0, 3, 2), c(1, -0.5),
  dnorm(gu), gu, dnorm(gu, sd = 0.5), gu
)$probability
#> [1] 0.880373