StanJulia / CmdStan.jl

CmdStan.jl v6 provides an alternative, older Julia wrapper to Stan's `cmdstan` executable. CmdStan will be deprecated in 2022.
MIT License
30 stars 12 forks source link

Legendre Polynomials #110

Closed pkroenert closed 3 years ago

pkroenert commented 3 years ago

Hi folks, great work of yours! Many thanks to port Stan to Julia!

I would like to use associated Legendre Polynomials in order to compute the used regression function.

How do I do that?

goedman commented 3 years ago

This question is probably better for DiffEqBayes.jl, the TuringLang forums or the Stan forums.

pkroenert commented 3 years ago

First of all, thank you for your answer.

I found the Legendre Polynomials in the Boost-Library. However, in which 'Stan block' do I put the 'inlcude statement'? #include <boost/math/special_functions/legendre.hpp>

goedman commented 3 years ago

The include statement will need to be added to the make/build step (if this c++ file is not currently included).

The 2nd step needed is to define a function to use this special function. This will go in the functions block (the very first block in the Stan language model).

This function can then be used in e.g. the model block. An example can be found in here.

pkroenert commented 3 years ago

Thank your very much for your answer! Thanks for pointing out an example :)