kurtosis_of(student_t(nu)) returns finite -2/-3/-6 for nu=1,2,3, where the fourth moment diverges and the excess kurtosis is undefined
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 66/100
Research direction
Trace the distribution-specific kurtosis_of(student_t(nu)) and skewness_of(student_t(nu)) paths, then compare their parameter handling with the variance path, which the issue says already refuses invalid cases. Reproduce the examples for nu = 1 through 5 and check the expected boundary behavior: undefined kurtosis for nu ≤ 3, +Inf at nu = 4, and 6/(nu-4) above 4; also verify skewness is undefined for nu ≤ 3.
Written by the indexing model from the issue text.
Description
kurtosis_of(student_t(nu)) returns the finite negative values -2, -3, -6 for nu = 1, 2, 3, where the Student-t fourth moment does not exist and the excess kurtosis is undefined. The implementation blindly evaluates the closed form 6/(nu-4), which is only valid for nu > 4.
library(rssn)
for (nu in 1:5) {
a <- compute(parse_term(sprintf("kurtosis_of(student_t(%d))", nu)))
cat(nu, "->", a$text, "\n")
}
# 1 -> -2
# 2 -> -3
# 3 -> -6
# 4 -> 6/0 (= Inf)
# 5 -> 6
The true excess kurtosis of Student-t is 6/(nu-4) for nu > 4, +Inf for 2 < nu <= 4, and undefined for nu <= 2 (the fourth moment E[X^4] diverges for every nu <= 4). So nu = 1 (Cauchy), 2, 3 have no finite kurtosis at all; -2, -3, -6 are artefacts of dividing by a negative nu-4.
An empirical check shows the sample excess kurtosis of t(3) grows without bound, confirming the fourth moment is infinite, while rssn reports the constant -6:
set.seed(1); for (N in c(1e4,1e5,1e6)) { x <- rt(N,3)
print(mean((x-mean(x))^4)/mean((x-mean(x))^2)^2 - 3) }
# 33.4, 51.5, 96.6 (diverging, not -6)
variance_of(student_t(1)) and variance_of(student_t(2)) correctly come back unevaluated (infinite variance), so the variance path already refuses the nu <= 2 region — but the kurtosis path does not.
The same defect makes skewness_of(student_t(nu)) return 0 for nu = 1, 2, 3, where the third moment (and hence skewness) is likewise undefined for nu <= 3.
Expected: kurtosis_of(student_t(1)), (2), (3) should be undefined (unevaluated, or NaN), and kurtosis_of(student_t(4)) should be +Inf; the 6/(nu-4) formula must only be applied for nu > 4. (This is distinct from #208, which concerns kurtosis(list(...)) on a data sample, not kurtosis_of(<distribution>).)
rssn 0.3.0, R 4.6.2 binding, Windows x86_64.
- Dominant language
- Rust
- Stars
- 36
- Forks
- 3
- Avg merge
- 14h 51m
- Merged PRs (30d)
- 29
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Apich-Organization/rssn
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/5-trivial
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Apich-Organization/rssn#373 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#371 ·
Maintainers usually reply within 1 day
-
json_encode() re-emits a decoded empty JSON object as [], so {} and {"":1} are not round-trip stableOpenarea/api-bindings good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#361 ·
Maintainers usually reply within 1 day
-
area/statistics good first issue help wanted kind/wrong-result severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Apich-Organization/rssn#362 ·
Maintainers usually reply within 1 day
All issues in Apich-Organization/rssn
Similar issues
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Possibly taken @flyingrobots claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flyingrobots/edict#457 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
approved
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fritzprix/libr-agent#3266 ·
Maintainers usually reply within 1 day
-
Frame::second_to_frame truncates f32 product, causing periodic off-by-one framesPossibly taken @ShamanicArts claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dmtrKovalenko/fframes#296 ·
Maintainers usually reply within 1 day