stdlib-js / stdlib-js/stdlib

Logarithm of the Cumulative Distribution Function for a Student's t distribution.

Abierto
#2,528 5 comentarios 0 reacciones 1 asignado Reclamado por @Planeshifter Ver en GitHub
Needs Discussion Statistics
Lenguaje dominante
JavaScript
Estrellas
6k
Forks
1.3k
Merge medio
1 d 3 h
PR fusionados (30 d)
611

Descripción

1. The formula for F(x;nu) in the documentation is only valid for x>0.

image

Wikipedia uses t (not x), but gives the same formula, but for t>0 only:

image

From "Sampling Student’s T distribution – use of the inverse cumulative distribution function" by William T. Shaw:
image

And the same formula is returned by `wolframscript`:
![image](https://github.com/stdlib-js/stdlib/assets/461765/740b5b1d-1c54-4a48-9d77-a8972114058b)

2. There is a problem in the implementation of `logcdf`.
The implementation basically computes the normal cdf-probability and then takes the logarithm.
This defeats the purpose of having a `logcdf`, which is meant to be used when `cdf(x)` is
so small it is rounded to 0.

The formula for `cdf` uses the incomplete beta function, which in turn uses `beta`.
Your project includes an `betaln` which computes the logarithm of a beta value.
A solution must be to use `betaln` to implement an "logarithm of a regularized, incomplete beta function"
and use that to implement `logcdf`.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.