Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 8, 2025

Summary

This PR clarifies in the documentation that describe_distribution() returns excess kurtosis rather than raw kurtosis values.

Background

As raised in the issue, there was potential confusion about the kurtosis values returned by describe_distribution(). Since a normal distribution has a kurtosis of 3, but describe_distribution() shows a kurtosis value near 0 for normal distributions, it's important to clarify that the function returns excess kurtosis (kurtosis - 3).

The kurtosis() function already mentions "(Excess)" in its title and documentation, but describe_distribution() didn't make this clear.

Changes

Updated the documentation in R/describe_distribution.R:

  1. Modified the function description to explicitly mention "(excess) kurtosis":

    # Before:
    # centrality, dispersion, range, skewness, kurtosis
    
    # After:
    # centrality, dispersion, range, skewness, (excess) kurtosis
  2. Added a @seealso section linking to the kurtosis() function for users who want more details about the implementation and interpretation.

Impact

This documentation improvement helps users correctly interpret the kurtosis values:

  • Excess kurtosis ≈ 0: Mesokurtic distribution (like normal distribution)
  • Excess kurtosis > 0: Leptokurtic distribution (fatter tails)
  • Excess kurtosis < 0: Platykurtic distribution (thinner tails)

Closes the issue by providing the clarity requested.

Original prompt

This section details on the original issue you should resolve

<issue_title>[docs] clarify kurtosis column: is it excess kurtosis?</issue_title>
<issue_description>Image

I heard that the kurtosis of a normal distribution is 3, and excess kurtosis is calculated as kurtosis - 3. If that's the case, worth clarifying in the docs that the kurtosis col corresponds to excess kurtosis</issue_description>

<agent_instructions>Edit the description of describe_distribution() to mention that it is "(excess)" kurtosis</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@strengejacke Any references we could add despite mysterious voices in your head? @mattansb It's already in the title:

#' Compute Skewness and (Excess) Kurtosis

You can use the same reference of:

D. N. Joanes and C. A. Gill (1998). Comparing measures of sample skewness and kurtosis. The Statistician, 47, 183–189.</comment_new>
<comment_new>@strengejacke
And the docs also explain how to interpret that values. So nothing to do here?</comment_new>
<comment_new>@DominiqueMakowski
My bad! cheers</comment_new>
<comment_new>@DominiqueMakowski
ah my bad x2 I have misread the original issue, the issue was that "the kurtosis function itself describes how to interpet it, but the describe_distribution() doesn't" 😁

I think it's just a matter of amending the description:

This function describes a distribution by a set of indices (e.g., measures of centrality, dispersion, range, skewness, kurtosis).

To mention "(excess)" kurtosis here and a link to the corresponding function

Fixes #661

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update documentation to clarify excess kurtosis terminology [docs] Clarify that describe_distribution() returns excess kurtosis Oct 8, 2025
Copilot finished work on behalf of DominiqueMakowski October 8, 2025 15:31
@strengejacke strengejacke marked this pull request as ready for review October 8, 2025 16:15
Copy link
Member

@DominiqueMakowski DominiqueMakowski left a comment

Choose a reason for hiding this comment

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

lgtm

@etiennebacher etiennebacher merged commit 050b85c into main Oct 8, 2025
23 of 25 checks passed
@etiennebacher etiennebacher deleted the copilot/clarify-excess-kurtosis-docs branch October 8, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] clarify kurtosis column: is it *excess* kurtosis?

4 participants