Algorithms 4—Maximum Likelihood Estimation and Its Application to Regression
摘要
In this chapter, we first demonstrate how to use Sympy to obtain the maximum likelihood estimates of the mean and variance from a small number of observations drawn from a Gaussian distribution. We also visualise the effect of likelihood calculations performed using Scipy. Then, we show how the maximum likelihood estimation method can be applied in enhancing the linear regression algorithm introduced in Chap. 8. Moreover, since the algorithm is now configured in a proper probability and statistical framework, we can set up confidence intervals for estimators using the methods presented in Chap. 12. Finally, we apply the maximum likelihood estimation technique to logistic regression, which is a classification algorithm. We also demonstrate how to apply the built-in linear and logistic regression models available in the statsmodels.apiStatsmodelsapi submodule of the statsmodels library.