Using R's internal sample function in CSnippet #178
Replies: 7 comments
-
Have you looked at the documentation on the C API? In particular, do you know that there is a C entry point for |
Beta Was this translation helpful? Give feedback.
-
Aha, I was looking at the R source code and trying to pull functions from there, rather than looking at the actual documentation, thanks for pointing me to that! That said, there doesn't seem to be an entry point for
I'm sure there is a bit of a simpler/tidier way, but this gets me what I am looking for! |
Beta Was this translation helpful? Give feedback.
-
Yes, this will work for sampling with replacement, but I believe it may not be very efficient. Looking into the innards of the |
Beta Was this translation helpful? Give feedback.
-
I thought the multinomial sampler might not be very efficient! The structure of this model makes it amenable to the |
Beta Was this translation helpful? Give feedback.
-
If
|
Beta Was this translation helpful? Give feedback.
-
See also the code for |
Beta Was this translation helpful? Give feedback.
-
Fantastic thank you! This has been very helpful! |
Beta Was this translation helpful? Give feedback.
-
Dr. King,
I'm hoping that this is a fairly simple question to answer, but I'm trying to set up some ordinal measurement state space models in pomp, and am running into trouble figuring out how to integrate R's internal
sample
function. More specifically, I really don't know which of the functions related tosample
to use. I'm fairly new to using R's internal C functions, so I'm likely missing something quite obvious. Happy to provide the code that I am working on if that helps clarify the issue.Thank you!
Teague
Beta Was this translation helpful? Give feedback.
All reactions