nutterb / HydeNet

Hybrid Decision Networks in R
Other
23 stars 3 forks source link

Truncated normal distribution #109

Open DrMattG opened 4 years ago

DrMattG commented 4 years ago

More of a question than an issue (I hope that is okay). How do I implement a truncated normal distribution in Hydenet? I understand that I have to use “floor” from base R but I can not work out how to write the code for a normally distributed node that should be truncated. Any direction would be much appreciated.

nutterb commented 4 years ago

From the look of it, I don't think HydeNet will support a truncated distribution. This isn't a complexity we considered. You could use HydeNet to construct the model without the truncation, and then use writeNetworkModel to get the model's JAGS code. Then you could manually add the truncation (see, for example, https://stats.stackexchange.com/questions/6870/censoring-truncation-in-jags) to the distribution and use the rjags package to run your models.

Sorry that I can't be more helpful than this (and sorry for the long delay in response. I'm not working at the institution where HydeNet was developed anymore, and my development time has been severely curtailed this year).

Let me know if you have more questions, Benjamin

On Tue, Oct 15, 2019 at 2:49 AM DrMattG notifications@github.com wrote:

More of a question than an issue (I hope that is okay). How do I implement a truncated normal distribution in Hydenet? I understand that I have to use “floor” from base R but I can not work out how to write the code for a normally distributed node that should be truncated. Any direction would be much appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nutterb/HydeNet/issues/109?email_source=notifications&email_token=AAODI7I7MYODYVEZ5VIANSDQOVRYDA5CNFSM4JAYBWU2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRY3JPA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAODI7K4P5SX7FXBGAVXY33QOVRYDANCNFSM4JAYBWUQ .

--


Benjamin Nutter benjamin.nutter@gmail.com