Skip to content

WienR

Derivatives of the First-Passage Time Density and Cumulative Distribution Function, and Random Sampling from the (Truncated) First-Passage Time Distribution

v0.3-15 · Nov 29, 2023 · GPL (>= 2)

Description

First, we provide functions to calculate the partial derivative of the first-passage time diffusion probability density function (PDF) and cumulative distribution function (CDF) with respect to the first-passage time t (only for PDF), the upper barrier a, the drift rate v, the relative starting point w, the non-decision time t0, the inter-trial variability of the drift rate sv, the inter-trial variability of the rel. starting point sw, and the inter-trial variability of the non-decision time st0. In addition the PDF and CDF themselves are also provided. Most calculations are done on the logarithmic scale to make it more stable. Since the PDF, CDF, and their derivatives are represented as infinite series, we give the user the option to control the approximation errors with the argument 'precision'. For the numerical integration we used the C library cubature by Johnson, S. G. (2005-2013) <https://github.com/stevengj/cubature>. Numerical integration is required whenever sv, sw, and/or st0 is not zero. Note that numerical integration reduces speed of the computation and the precision cannot be guaranteed anymore. Therefore, whenever numerical integration is used an estimate of the approximation error is provided in the output list. Note: The large number of contributors (ctb) is due to copying a lot of C/C++ code chunks from the GNU Scientific Library (GSL). Second, we provide methods to sample from the first-passage time distribution with or without user-defined truncation from above. The first method is a new adaptive rejection sampler building on the works of Gilks and Wild (1992; <doi:10.2307/2347565>) and Hartmann and Klauer (in press). The second method is a rejection sampler provided by Drugowitsch (2016; <doi:10.1038/srep20490>). The third method is an inverse transformation sampler. The fourth method is a "pseudo" adaptive rejection sampler that builds on the first method. For more details see the corresponding help files.

Downloads

CRAN

402

Last 30 days

10027th

1.2K

Last 90 days

5.2K

Last year

Trend: +13.6% (30d vs prior 30d)

r2u CRAN

41

Last 30 days

126

Last 90 days

546

Last year

Trend: -22.6% (30d vs prior 30d)

autoCRAN

2

Last 7 days

14

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (2)

imports

suggests

Dependency Network

Dependencies Reverse dependencies EMC2 fddm WienR

Version History

14 tracked
new 0.3-15 Mar 10, 2026
updated 0.3-15 ← 0.3-14 diff Nov 28, 2023
updated 0.3-14 ← 0.3-10 diff Jul 3, 2023
updated 0.3-10 ← 0.3-9 diff May 22, 2023
updated 0.3-9 ← 0.3-8 diff Apr 22, 2023
updated 0.3-8 ← 0.3-7 diff Jan 25, 2023
updated 0.3-7 ← 0.3-6 diff Oct 27, 2022
updated 0.3-6 ← 0.3-4 diff Apr 22, 2022
updated 0.3-4 ← 0.3-0 diff Apr 15, 2022
updated 0.3-0 ← 0.2-2 diff Nov 24, 2021
updated 0.2-2 ← 0.2-1 diff Sep 1, 2021
updated 0.2-1 ← 0.2-0 diff Aug 19, 2021
updated 0.2-0 ← 0.1-9 diff May 11, 2021
new 0.1-9 May 6, 2021