Description Usage Arguments Details Value Functions
View source: R/fit_true_model.R
Fit true regression model E(Y_i | X_i) = alpha_0 + Phi(beta^T X_i), where Phi is the standard Normal CDF.
1 2 3 4 5 | fit_true_model(xs, ys, init = NULL)
objective(alpha_betas, xs, ys)
gradient(alpha_betas, xs, ys)
|
xs |
n x p matrix of predictors |
ys |
Length-n vector of outcomes |
init |
Initial guess for parameters |
alpha_betas |
Value of coefficients to evaluate the function. First entry must be the intercept, and the rest are the other coefficients. |
Under the hood, the fitting is done using BFGS, as implemented in the
optim
function in R.
fit_true_model
returns a length-(p + 1) vector of
coefficients, where the first is the intercept and the rest are the
beta values. If the fitting algorithm did not converge,
fit_true_model
will fail with an error.
objective
and gradient
return the value of the
objective function and gradient evaluated for some coefficients
alpha_beta, respectively.
objective
: Evaluate objective function
gradient
: Evaluate objective function's gradient
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.