Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: stats.boxcox_normmax: correct minimize -> maximize #18756

Merged
merged 1 commit into from Jun 26, 2023

Conversation

mdhaber
Copy link
Contributor

@mdhaber mdhaber commented Jun 26, 2023

Reference issue

Closes gh-18748

What does this implement/fix?

gh-18748 noted that scipy.stats.boxcox_normmax documentation states

Minimizes the log-likelihood boxcox_llf.

but boxcox_llf is the (positive) log-likelihood function to be maximized, not minimized. This PR corrects the mistake.

Maximization of the log-likelihood function is accomplished by minimizing the negative log-likelihood:

def _mle(x):
def _eval_mle(lmb, data):
# function to minimize
return -boxcox_llf(lmb, data)

This PR clarifies this point in the documentation of the optimizer parameter.

@mdhaber mdhaber added scipy.stats Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels Jun 26, 2023
Copy link
Member

@tupui tupui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matt, LGTM. Good rewriting and clearer with respect to [negative]log-likelihood

@tupui tupui merged commit 8e55aea into scipy:main Jun 26, 2023
6 checks passed
@tupui tupui added this to the 1.12.0 milestone Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] Incorrect docstring for boxcox_normmax argument method="mle", should be "maximizes the log-likelihood"
2 participants