stan-dev / docs

Documentation for the Stan language and CmdStan
https://mc-stan.org/docs/
Other
37 stars 107 forks source link

Incorrect equation for wiener pdf #748

Open venpopov opened 4 months ago

venpopov commented 4 months ago

Summary:

The equation for the wiener pdf here is incorrect

Description:

The pdf for the wiener is described in the docs as

image

Citing Navarro & Fuss (2009). However, there are two issues:

1) Consulting NF2009 equations 2 and 4, results in the following pdf:

$$ \Large f(y | \alpha, \tau, \beta, \delta) = \frac{\alpha}{(y-\tau)^{3/2}} exp\left(-\delta \alpha \beta - \frac{\delta^2(y-\tau)}{2}\right) \sum_{k = -\infty}^{\infty} (2k +\beta)\phi\left(\frac{2k\alpha + \beta\alpha}{\sqrt{y-\tau}}\right) $$

2) This is the pdf only for small values of y or also known as the "small time expansion". The pdf for large values of y is different (combining equations 2 and 3)

$$ \Large f(y | \alpha, \tau, \beta, \delta) = \frac{\pi}{\alpha^2} exp\left(-\delta \alpha \beta - \frac{\delta^2(y-\tau)}{2}\right) \sum_{k = 1}^{\infty} k \ exp \left(-\frac{k^2 \pi^2 (y - \tau)}{2 \alpha^2}\right) sin(k \pi \beta) $$

or alternatively if wanting to be consistent with the use of $\phi$

$$ \Large f(y | \alpha, \tau, \beta, \delta) = \frac{\sqrt{2 \pi^3}}{\alpha^2} exp\left(-\delta \alpha \beta - \frac{\delta^2(y-\tau)}{2}\right) \sum_{k = 1}^{\infty} k \ sin(k \pi \beta) \phi \left(\frac{k \pi \sqrt{(y - \tau)}}{\alpha}\right) $$

In the first equation there is a wrong exponent of \alpha in the begining, and a missing \alpha multiplier to \beta at the end. Both equations should be presented, because both are used to calculate the likelihood depending on the value of y Provide any additional information here.

Current Version:

v2.18.0