Closed davidwhogg closed 9 years ago
I have my own function to generate random samples from an arbitrary distribution when I can't use the built-in numpy/scipy random samplers that only work on specific distributions. In this case the prior is one of those convenient distributions so I don't actually need the function, but leaving it in means I won't have to change the structure too much when I replace the prior with something else.
I don't understand this answer. Why do you have a a logmvn()(x) call?
that is, why don't you just structure your code so you have a logmvn(x)?
I previously used the lambda function shorthand to do the same thing but expanded it for readability when debugging. Is that what's confusing? I wanted logmvn(x) to return a function of x distinct from logpdf(x) returning the value of the PDF, and the funny structure of logmvn()(x) was the way I did that.
I just don't understand why you need the thing to return a function. I think this might be slowing things down. But let's work on the speed issues first...
Okay, I concede this one. I can't think of any reason why I realistically need this, and without it I can evaluate 8e4 samples in under 2 seconds.
SICK. Please point me to the new profile.
I'm closing this issue because it's been resolved I'll continue posting profiling updates in the relevant issue.
just wondering