I am looking to add a new diffusion decision model (DDM) PDF to the Stan Math library. Currently in the Stan Math library, this PDF exists in its 4-parameter variant (`wiener_lpdf`

). I have followed the guidelines and have implemented the 5-parameter version (plus corresponding tests) in a forked version of the Stan Math library based on the existing code (`wiener_lpdf`

).

Now, I would like to test this version while actually fitting data (and not only when compiling the Stan Math library directly at the shell). Is there a way to use any of the Stan interfaces such as `CmdStan`

or `CmdStanR`

with a new addition to the Stan Math library? I have not found any corresponding documentation and my attempts were not fruitful.

A section in the guidelines suggest adding code to expose new functions in a specific file in the Stan library, but the link to this file 404s.

Using the related function `wiener_lpdf`

as a template (a process put forth in the guidelines), I added

- the file
`ddm_lpdf.hpp`

to the directory`stan/math/prim/prob/`

- the line
`#include <stan/math/prim/prob/ddm_lpdf.hpp>`

to line 74 of the file`stan/math/prim/prob.hpp`

(to maintain alphabetical ordering) - the file
`ddm_test.cpp`

to the directory`test/unit/math/prim/prob/`

I ran the tests `./runTests.py test/unit`

and `make test-headers`

, as described in the guidelines, and no errors were produced.

My question is: how can I use my new _lpdf function `ddm_lpdf`

when actually fitting some data through a Stan interface (e.g., `CmdStan`

or `CmdStanR`

)?