Comments (5)
Regarding 1, the style in Julia is to use multiple dispatch, keeping in mind that you can methods to generic functions defined in another package. In particular you can define external constructors to take the form of argument that you prefer rather than having code for argument checking added to the internal constructor for every distribution type. Eventually all the constructors should end up at the one that has the arguments in the form of numeric scalars.
Regarding 2, remember that loops are relatively lightweight in Julia. A comprehension is a very effective way of creating an array from input arrays. Try
rg = [rand(Gamma(A[i,j],B[i,j])) for i in 1:size(A,1), j in 1:size(A,2)]
from distributions.jl.
Thanks, this is now my third day using Julia, so I appreciate your taking
the time to help out the n00b. My initial question has been "can I do
everything I can do in matlab and just as fast" and the answer appears to
be yes -- actually Julia is somewhat faster for the things I do. It's
ideally suited to Bayesian computation but I'm the first in the department
to start using it. I'll try to win some converts.
On Tue, Jun 18, 2013 at 8:20 AM, dmbates [email protected] wrote:
Regarding 1, the style in Julia is to use multiple dispatch, keeping in
mind that you can methods to generic functions defined in another package.
In particular you can define external constructors to take the form of
argument that you prefer rather than having code for argument checking
added to the internal constructor for every distribution type. Eventually
all the constructors should end up at the one that has the arguments in the
form of numeric scalars.Regarding 2, remember that loops are relatively lightweight in Julia. A
comprehension is a very effective way of creating an array from input
arrays. Tryrg = [rand(Gamma(A[i,j],B[i,j]) for i in 1:size(A,1), j in 1:size(A,2)]
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/71#issuecomment-19618471
.
from distributions.jl.
How much interest is there in doing this? I'm not opposed to it, but it seems a little bit like overkill.
from distributions.jl.
I don't see it as a high priority. The constructor syntax is compact and I've found the performance is often similar to C. I may just write up a little something to help people accustomed to matlab statistics toolbox to transition to Julia and put it on my blog. Happy to close this if you are.
from distributions.jl.
Let's close this for now then. We want to vectorize over parameters, we can do that in the future.
from distributions.jl.
Related Issues (20)
- Changing the type from `Float` to `Int` breaks `mean` of `MixtureModel`
- `0 <= cdf(Normal(),x) <= 1` not always true. HOT 4
- `0 <= cdf(truncated(Normal(2.5, 0.2), lower=0.0),x)` not always true. HOT 3
- Suggestion: 3-argument cdf() HOT 1
- Error in xval in gumbel
- New GPL dependency introduced through AliasTables HOT 5
- JET reports type-instability when sampling from `Beta` HOT 8
- Unexpected behavior of `truncated` for zero variance distributions at the lower bound HOT 2
- Type instability of mixture distributions
- Bug in quantile() for some special cases of a MixtureModel
- Rename `ValueSupport` subtypes to more specific names HOT 1
- Who is maintaining Distributions.jl? HOT 3
- cdf of InverseGaussian HOT 1
- Support parametrization of Beta (Mean and variance Beta(μ, σ²)) HOT 1
- `Distributions.jl` and `RecursiveArrayTools.jl` do not work together.
- Degenerate Distribution interface is probably necessary HOT 1
- Better samplers for Bernoulli(p) and Geometric(1/2) random variables HOT 2
- Is there a reason `rand(TDist(nu))` does not obey the type of `nu`? HOT 9
- How to draw a density sample from a multivariate normal HOT 1
- `truncated` does not work with `Turing.jl`'s random variables HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distributions.jl.