static void output_depvarmap (const struct lr_spec *cmd, const struct lr_result *);
static void output_variables (const struct lr_spec *cmd,
static void output_depvarmap (const struct lr_spec *cmd, const struct lr_result *);
static void output_variables (const struct lr_spec *cmd,
static void output_model_summary (const struct lr_result *,
double initial_likelihood, double likelihood);
static void output_model_summary (const struct lr_result *,
double initial_likelihood, double likelihood);
- Return the probability estimator (that is the estimator of logit(y) )
- corresponding to the coefficient estimator beta_hat for case C
+ Return the probability beta_hat (that is the estimator logit(y) )
+ corresponding to the coefficient estimator for case C
predictor_value (c, x, n_x, res->cats, v0);
}
predictor_value (c, x, n_x, res->cats, v0);
}
struct lr_result *res,
struct casereader *input,
const struct variable **x, size_t n_x,
struct lr_result *res,
struct casereader *input,
const struct variable **x, size_t n_x,
- double pi = pi_hat (cmd, res, beta_hat, x, n_x, c);
+ double pi = pi_hat (cmd, res, x, n_x, c);
double weight = dict_get_case_weight (cmd->dict, c, &res->warn_bad_weight);
double w = pi * (1 - pi);
double weight = dict_get_case_weight (cmd->dict, c, &res->warn_bad_weight);
double w = pi * (1 - pi);
{
double in0 = predictor_value (c, x, n_x, res->cats, v0);
{
double in0 = predictor_value (c, x, n_x, res->cats, v0);
{
double in1 = predictor_value (c, x, n_x, res->cats, v1);
double *o = gsl_matrix_ptr (res->hessian, v0, v1);
{
double in1 = predictor_value (c, x, n_x, res->cats, v1);
double *o = gsl_matrix_ptr (res->hessian, v0, v1);
struct casereader *input,
const struct variable **x, size_t n_x,
const struct variable *y_var,
struct casereader *input,
const struct variable **x, size_t n_x,
const struct variable *y_var,
- double pi = pi_hat (cmd, res, beta_hat, x, n_x, c);
+ double pi = pi_hat (cmd, res, x, n_x, c);
{
double in0 = predictor_value (c, x, n_x, res->cats, v0);
double *o = gsl_vector_ptr (output, v0);
{
double in0 = predictor_value (c, x, n_x, res->cats, v0);
double *o = gsl_vector_ptr (output, v0);
* Creates and initialises the categoricals,
* Accumulates summary results,
* Calculates necessary initial values.
* Creates and initialises the categoricals,
* Accumulates summary results,
* Calculates necessary initial values.
-
- /* Get the initial estimates of \beta and their standard errors */
- beta_hat = beta_hat_initial (cmd, &work, input);
- if (NULL == beta_hat)
+ /* Get the initial estimates of \beta and their standard errors.
+ And perform other auxilliary initialisation. */
+ if (! initial_pass (cmd, &work, input))
hessian (cmd, &work, input,
hessian (cmd, &work, input,
v = xt_times_y_pi (cmd, &work, input,
cmd->predictor_vars, cmd->n_predictor_vars,
cmd->dep_var,
v = xt_times_y_pi (cmd, &work, input,
cmd->predictor_vars, cmd->n_predictor_vars,
cmd->dep_var,
/* Show the Variables in the Equation box */
static void
output_variables (const struct lr_spec *cmd,
/* Show the Variables in the Equation box */
static void
output_variables (const struct lr_spec *cmd,
const double sigma2 = gsl_matrix_get (res->hessian, idx, idx);
const double wald = pow2 (b) / sigma2;
const double df = 1;
const double sigma2 = gsl_matrix_get (res->hessian, idx, idx);
const double wald = pow2 (b) / sigma2;
const double df = 1;
gsl_matrix_const_view mv =
gsl_matrix_const_submatrix (res->hessian, idx, idx, df, df);
gsl_matrix *subhessian = gsl_matrix_alloc (mv.matrix.size1, mv.matrix.size2);
gsl_matrix_const_view mv =
gsl_matrix_const_submatrix (res->hessian, idx, idx, df, df);
gsl_matrix *subhessian = gsl_matrix_alloc (mv.matrix.size1, mv.matrix.size2);
gsl_vector *temp = gsl_vector_alloc (df);
gsl_matrix_memcpy (subhessian, &mv.matrix);
gsl_vector *temp = gsl_vector_alloc (df);
gsl_matrix_memcpy (subhessian, &mv.matrix);