solve_eecop | R Documentation |
Solves an estimating equation based on a fitted eecop model and user-supplied identifying function.
solve_eecop(object, x, idfun, theta_start, ...)
object |
a fitted eecop object. |
x |
covariate values to predict on; must match the format used for
fitting the |
idfun |
a function with signature |
theta_start |
starting values for optimizing the parameter of interest. |
... |
further arguments passed to |
The optimal parameter theta
.
## fit dummy model
x <- matrix(rnorm(200), 100, 2)
y <- rowSums(x) + rnorm(100)
fit <- eecop(y, x)
## identifying function for 0.5 and 0.9 quantiles
idfun <- function(y, theta) {
t <- c(0.5, 0.9)
gmat <- matrix(NA, NROW(y), 2)
for (j in 1:2) gmat[, j] <- (y <= theta[j]) - t[j]
gmat
}
## solve estimating equation
solve_eecop(fit, x[1:3, ], idfun = idfun, theta_start = rep(0, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.