Closed slwu89 closed 1 year ago
Ah, it's in the AffineTransform part of the API. I missed this when I was looking through the docs, closing!
If anyone else needs this in the future, it is done as something like:
f = AffineTransform((μ=10,))
rand(pushfwd(f, Binomial(10,0.5)))
Hi, I'm curious if its possible to do something like the following (not valid code):
to get a measure assigning probability to the values between 10 and 20. I naively did
Binomial(10, 0.5) + Dirac(10)
but that generates a mixture/superposition.Incidentally, the interest in this arose from using
Chain
to implement a time discretization of a competing counting processes representation of an SIR model. It would be nice if the state of the chain could be defined on the 2 increasing integers counting the total number of times each event has fired, right now it's simply defined on the number of events occurring each time step. The relevant code is here: https://github.com/epirecipes/sir-julia/blob/master/markdown/markov_measure/markov_measure.md#transitions (i.e. I wish I could writeproductmeasure([x[1] + si_rv, x[2] + ir_rv])
at the last line.