Package: WienR 0.3-16

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

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.

Authors:Raphael Hartmann [aut, cre], Karl C. Klauer [cph, aut, ctb, ths], Steven G. Johnson [ctb], Jean M. Linhart [ctb], Brian Gough [ctb], Gerard Jungman [ctb], Rudolf Schuerer [ctb], Przemyslaw Sliwa [ctb], Jason H. Stover [ctb]

WienR_0.3-16.tar.gz
WienR_0.3-16.zip(r-4.5)WienR_0.3-16.zip(r-4.4)WienR_0.3-16.zip(r-4.3)
WienR_0.3-16.tgz(r-4.4-x86_64)WienR_0.3-16.tgz(r-4.4-arm64)WienR_0.3-16.tgz(r-4.3-x86_64)WienR_0.3-16.tgz(r-4.3-arm64)
WienR_0.3-16.tar.gz(r-4.5-noble)WienR_0.3-16.tar.gz(r-4.4-noble)
WienR_0.3-16.tgz(r-4.4-emscripten)WienR_0.3-16.tgz(r-4.3-emscripten)
WienR.pdf |WienR.html
WienR/json (API)

# Install 'WienR' in R:
install.packages('WienR', repos = c('https://raphaelhartmann.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/raphaelhartmann/wienr/issues

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

3.78 score 2 stars 1 packages 487 downloads 27 exports 0 dependencies

Last updated 11 months agofrom:07724094c2. Checks:OK: 6 WARNING: 3. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 21 2024
R-4.5-win-x86_64WARNINGNov 21 2024
R-4.5-linux-x86_64WARNINGNov 21 2024
R-4.4-win-x86_64WARNINGNov 21 2024
R-4.4-mac-x86_64OKNov 21 2024
R-4.4-mac-aarch64OKNov 21 2024
R-4.3-win-x86_64OKNov 21 2024
R-4.3-mac-x86_64OKNov 21 2024
R-4.3-mac-aarch64OKNov 21 2024

Exports:daWienerCDFdaWienerPDFddWDMdpWDMdst0WienerCDFdst0WienerPDFdsvWienerCDFdsvWienerPDFdswWienerCDFdswWienerPDFdt0WienerCDFdt0WienerPDFdtWienerPDFdvWienerCDFdvWienerPDFdWDMdwWienerCDFdwWienerPDFgradWienerCDFgradWienerPDFpWDMqWDMrWDMsampWienerWienerCDFWienerPDFWienerQuant

Dependencies:

Readme and manuals

Help Manual

Help pageTopics
Partial derivative of the first-passage time cumulative distribution function of the diffusion model with respect to the upper barrierdaWienerCDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the upper barrierdaWienerPDF
Wrapper function for the partial derivative of the first-passage time probability density function of the diffusion modelddWDM
Wrapper function for the partial derivative of the first-passage time cumulative distribution function of the diffusion modeldpWDM
Partial derivative of the first-passage time cumulative distribution function of the diffusion model with respect to the inter-trial variability of the non-decision timedst0WienerCDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the inter-trial variability of the non-decision timedst0WienerPDF
Partial derivative of the first-passage time cumulative distribution function of the diffusion model with respect to the inter-trial variability of the drift ratedsvWienerCDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the inter-trial variability of the drift ratedsvWienerPDF
Partial derivative of the first-passage time cumulative distribution function of the diffusion model with respect to the inter-trial variability of the relative starting pointdswWienerCDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the inter-trial variability of the relative starting pointdswWienerPDF
Partial derivative of the first-passage time cumulative distribution function of the diffusion model with respect to the non-decision timedt0WienerCDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the non-decision timedt0WienerPDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the first-passage timedtWienerPDF
Partial derivative of the first-passage time cumulative distribution function of the diffusion model with respect to the drift ratedvWienerCDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the drift ratedvWienerPDF
Partial derivative of the first-passage time cumulative distribution function of the diffusion model with respect to the relative starting pointdwWienerCDF
Partial derivative of the first-passage time probability density function of the diffusion model with respect to the relative starting pointdwWienerPDF
Gradient of the first-passage time cumulative distribution functiongradWienerCDF
Gradient of the first-passage time probability density functiongradWienerPDF
Random sampling from the Wiener diffusion modelrWDM sampWiener
First-passage time cumulative distribution function of the diffusion modelpWDM WienerCDF
First-passage time probability density function of the diffusion modeldWDM WienerPDF
First-passage time quantile function of the diffusion modelqWDM WienerQuant