Open johnnybonney opened 1 year ago
Ah yes, and the default should be that they are different for the lower and upper bounds. Edit: Oops, sorry, ignore me. I was thinking we had already incorporated the selection approach @johnnybonney linked to into the module. But that's still outside of it. So for now we just need to allow the user to pass different choices for the LB and UB.
Yes, good suggestion. I can certainly do this!
Okay, you should be able to declare different values for criterion.tol
when soft = TRUE
now.
As you suggested, you can either pass a named vector or named list.
The names should be lower
and upper
.
Here's an example:
devtools::load_all("../ivmte")
dtm <- ivmte:::gendistMosquito()
args <- list(data = dtm,
propensity = d ~ 0 + factor(z),
m0 = ~ uSplines(degree = 3, knots = c(0.3, 0.6)),
m1 = ~ uSplines(degree = 3, knots = c(0.3, 0.6)),
target = "att",
outcome = 'ey',
soft = TRUE,
direct = "l2")
## Declare common values for criterion.tol
args$criterion.tol <- 10
do.call(ivmte, args)
Here are the bounds:
Bounds on the target parameter: [-0.234517, 0.2228876]
Audit terminated successfully after 2 rounds
Below, I change the value of criterion.tol
for the upper bound only.
Only the estimate for the upper bound should change.
args$criterion.tol <- c(lower = 10,
upper = 2000)
do.call(ivmte, args)
Here are the bounds.
Bounds on the target parameter: [-0.234517, 0.003233728]
Audit terminated successfully after 2 rounds
That works well for me -- thanks, @jkcshea !
When using the soft constraints approach, it seems like we may want to allow for different values of
criterion.tol
for the lower and upper bounds.Currently, @cblandhol and I selecting
criterion.tol
using the approach outlined by @a-torgovitsky here, and so we allow forcriterion.tol
to differ for the lower and upper bound problems. With the current package version, we must then estimate each problem twice usingivmte
---once to get the lower bound, and once to get the upper bound.Since other users may wish to use a similar method to select
criterion.tol
, it may be desirable---whensoft = T
---to allow the user to provide a named list (e.g.criterion.tol = list(lower = 1000, upper = 10)
) or a vector that passes different parameter values to each problem.