Dear Forum,
I added a logF distribution into runjags module, but i failed to compile it.
This is my code in DLogf.h
#ifndefDLOGF_H_#defineDLOGF_H_// Checks the JAGS version and sets necessary macros:#include"../jagsversions.h"#ifndefINCLUDERSCALARDIST#include<distribution/RScalarDist.h>namespacejags{#else#include"jags/RScalarDist.h"#endif/* INCLUDERSCALARDIST */namespacerunjags{/** * <pre> * * </pre> * @short Normal distribution */classDLogf : publicRScalarDist{public:DLogf();doubled(doublez,PDFTypetype,std::vector<doubleconst*>const¶meters,boolgive_log)const;doublep(doubleq,std::vector<doubleconst*>const¶meters,boollower,boolgive_log)const;doubleq(doublep,std::vector<doubleconst*>const¶meters,boollower,boollog_p)const;doubler(std::vector<doubleconst*>const¶meters,RNG*rng)const;/** * Checks that tau > 0 */boolcheckParameterValue(std::vector<doubleconst*>const¶meters)const;/** * * that is built into the JAGS library, overloading the generic * functionality of RScalarDist. */};}// namespace runjags#ifndefINCLUDERSCALARDIST}// namespace jags#endif/* INCLUDERSCALARDIST */#endif/* DMNLOGF_H_ */
I have successfully fixed the code so it can be compiled. I convert JRmath to Rmath, dF to df, pF to pf and qF to qf. However, when I use this distribution, runjags (JAGS) do not report the DIC value. Why JAGS can't calculate DIC for this distribution? Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That is not the way to solve your first problem. You need to add the library jrmath, which provides the missing symbols jags_qF, jags_pF, jags_dF when you compile the shared object runjags.so by modifying the file src/Makevars.in. The line
Dear Forum,
I added a logF distribution into runjags module, but i failed to compile it.
This is my code in DLogf.h
Code in DLogf.cc
I had a errormassage while i compiled it
distributions/DLogf.o:DLogf.cc:(.text+0x67): undefined reference to
jags_dF' distributions/DLogf.o:DLogf.cc:(.text+0x14a): undefined reference to
jags_qF'distributions/DLogf.o:DLogf.cc:(.text+0x1dc): undefined reference to
jags_qF' distributions/DLogf.o:DLogf.cc:(.text+0xd7): undefined reference to
jags_pF'How to solve this problem? Thank You.
Best Regard
Achmad Syahrul
Last edit: Achmad Syahrul Choir 2018-01-13
I have successfully fixed the code so it can be compiled. I convert JRmath to Rmath, dF to df, pF to pf and qF to qf. However, when I use this distribution, runjags (JAGS) do not report the DIC value. Why JAGS can't calculate DIC for this distribution? Thank you.
That is not the way to solve your first problem. You need to add the library jrmath, which provides the missing symbols
jags_qF
,jags_pF
,jags_dF
when you compile the shared object runjags.so by modifying the filesrc/Makevars.in
. The lineshould be changed to
and you will need to modify
Makevars.win
if you want to compile your modified package on Windows.My problem was solved by your suggestion. Thank you.