Skip to content

Instantly share code, notes, and snippets.

@johnmyleswhite
Created July 31, 2013 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save johnmyleswhite/6118578 to your computer and use it in GitHub Desktop.
Save johnmyleswhite/6118578 to your computer and use it in GitHub Desktop.
QQ-plots in Julia
using Stats, Distributions, Vega
Vega.plot(qq::QQPair) = Vega.plot(x = qq.qx, y = qq.qy, kind = :scatter)
qqplot(x::Vector, y::Vector) = plot(qqbuild(x, y))
qqplot(x::Vector, d::UnivariateDistribution) = plot(qqbuild(x, d))
qqplot(d::UnivariateDistribution, x::Vector) = plot(qqbuild(d, x))
x = rand(Normal(), 10_000)
y = rand(Cauchy(), 10_000)
plot(qqbuild(x, y))
qqplot(x, y)
qqplot(y, x)
plot(qqbuild(x, Normal()))
qqplot(x, Normal())
qqplot(x, Normal(0, 10))
qqplot(x, Cauchy())
qqplot(Cauchy(), x)
qqplot(x, Laplace())
qqplot(Laplace(), x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment