Skip to content

Numerical overflow when calculating hedges.g #10

Description

@dgerlanc

When hedges.g is calculated for a combined number of observations greater than 340, usage of the gamma function in the exact calculation causes numerical overflow.

We can switch to using Cohen's approximation: 1 - 3/(4n - 9) or use log-gamma to calculate the exact value.

gamma(dof/2) / ( sqrt(dof/2) * gamma((dof-1)/2))
would become
exp(lgamma(df/2) - log(sqrt(df/2)) - lgamma((df-1)/2)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions