sim_single_stage {polle}R Documentation

Simulate Single-Stage Data

Description

Simulate Single-Stage Data

Usage

sim_single_stage(
  n = 10000,
  par = c(k = 0.1, d = 0.5, a = 1, b = -2.5, c = 3, p = 0.3),
  action_model = function(Z, L, B, k, d) {
     k * (Z + L - 1) * Z^(-2) + d * (B == 1)

    },
  utility_model = function(Z, L, A, a, b, c) {
     Z + L + A * (c * Z + a * L + b)
 },
  seed = NULL,
  return_model = FALSE,
  ...
)

Arguments

n

Number of observations.

par

Named vector with distributional parameters.

  • k: κ\kappa

  • d: δ\delta

  • a: α\alpha

  • b: β\beta

  • c: γ\gamma

  • p: π\pi

action_model

Function used to specify the action/treatment probability (logit link).

utility_model

Function used to specify the conditional mean utility.

seed

Integer.

return_model

If TRUE, the lava::lvm model is returned.

...

Additional arguments passed to lava::lvm().

Details

sim_single_stage samples n iid observation O=(B,Z,L,A,U)O = (B, Z, L, A, U) with the following distribution:

BBernoulli(π)Z,LUniform([0,1])AZ,L,BBernoulli(expit{κZ2(Z+L1)+δB)UZ,L,AN(Z+L+A{γZ+αL+β},1) B \sim Bernoulli(\pi)\\ Z, L \sim Uniform([0,1])\\ A\mid Z,L,B \sim Bernoulli(expit\{\kappa Z^{-2}(Z+L-1) + \delta B)\\ U\mid Z,L,A \sim \mathcal{N}(Z+L+A\cdot\{\gamma Z + \alpha L + \beta\}, 1)

Value

data.frame with n rows and columns Z, L, B, A, and U.


[Package polle version 1.4 Index]