Designated Target Audience of Julia 1.0?

I’m not very well-versed in R but I find it quite horrible for statistics, for example in Julia if you want to compute the pdf of a Normal distribution with parameters (μ,σ) at value x you do :

pdf(Normal(μ,σ),x)

In R you do:

dnorm(x,μ,σ)

If you want to truncated Normal between zero and one you do:

pdf(Truncated(Normal(μ,σ),0,1),x)

In R you do:

google for a package
...
dtrunc(x, spec="norm", a=0, b=1, mean=μ, sd=σ)

If you want a mixture of two Gaussians:

MixtureModel([Normal(μ1,σ1), Normal(μ2,σ2)],[1/2,1/2])

In R you do:

google for a package
...

If you want a BetaBinomial:

pdf(BetaBinomial(n,α,β),x)

In R you do:

google for a package
...

In Julia you have nice atomic concepts that are composable, while in R you just have a bunch of functions with unreadable names and packages with no common semantics.

I would be curious to see how this translates in R:

[f(D) for f in [mean,std,entropy], D in [Normal(0,1), BetaBinomial(10,0.1,0.1), Truncated(Normal(0,1),0,1)]]

Ironically the biggest issue with Distributions.jl is that it uses Rmath, but hopefully that will get fixed in time.

19 Likes