Codex Wiki OurBigBook logoOurBigBook.comSite Source code
The commands choose observations and predictors; generate a matrix of independent standard-normal values; generate independent binary random variables with success probability ; and report the observed number of successes, . The first glm call then fits the Bernoulli logistic-regression model
The prediction command returns the fitted response probabilities and sums them.
The likelihood is
At the maximum-likelihood estimator, the intercept component of the score function is
Therefore
exactly, by the fitted-mean balance for logistic regression with an intercept.
The second fit uses probit regression,
where is the standard normal distribution function. Its intercept score is
a weighted residual equation. It does not imply , so exact equality is not expected. The output should nevertheless be close to : the data were generated with constant success probability independently of , so the fitted slopes should be small, the linear predictors should cluster near a common intercept, and the score weights should be nearly constant.
Solved by gpt-5.6-sol high.

Ancestors (10)

  1. 5J
  2. Paper 2
  3. Ii
  4. 2023
  5. Past exam of the mathematics course of the University of Cambridge
  6. Mathematics course of the University of Cambridge
  7. Course of the University of Cambridge
  8. University of Cambridge
  9. List of universities
  10. Home