Skip to content

StudentsT.partial_moment returns 0 or nan for odd orders when nu is above about 342 #969

Closed

Description

@mkzung

StudentsT().partial_moment(n, z, [nu]) returns 0.0 or nan for every odd n once nu passes about 342, inside the allowed range (2.05, 500).

from arch.univariate import StudentsT

t = StudentsT()
for nu in (300.0, 342.0, 344.0, 500.0):
    print(nu, t.partial_moment(1, 0.0, [nu]), t.partial_moment(3, 0.0, [nu]))
300.0 -0.3986077382558514 -0.799899703705345
342.0 -0.0 -0.0
344.0 nan nan
500.0 nan nan

At nu=500 the values should be -0.398742 and -0.799089. The n=1 branch of _ord_t_partial_moment divides gamma(0.5 * (nu + 1)) by gamma(0.5 * nu), and both overflow. Higher odd orders recurse into it. Even orders are fine.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions