3 LLVM and Clang 4 Comparison between R and Julia Advantages and Disadvantages The State of Statistics in Julia 5 Installation and Usage 6 An Example 7 Other Projects Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 2 / 33
for n = 1: maxiter if abs(z) > 2 return n-1 end z = z^2 + c end return maxiter end Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 5 / 33
Computing 3 LLVM and Clang 4 Comparison between R and Julia Advantages and Disadvantages The State of Statistics in Julia 5 Installation and Usage 6 An Example 7 Other Projects Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 6 / 33
zeros (1000 , 1000) s = 0 for i = 1:1000 for j = 1:1000 m[i, j] = rand () s = s + m[i, j] end end end julia > @elapsed fun1j () 0.22739791870117188 Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 9 / 33
rand (1000 , 1000) sum(m) end julia > @elapsed fun1optj () 0.010874032974243164 Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 11 / 33
Computing 3 LLVM and Clang 4 Comparison between R and Julia Advantages and Disadvantages The State of Statistics in Julia 5 Installation and Usage 6 An Example 7 Other Projects Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 13 / 33
{rand (1000 ,1000) | i=1:10} pmap(svd , M) nheads = @parallel (+) for i=1:100000000 randbit () end Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 14 / 33
Cloud Computing 3 LLVM and Clang 4 Comparison between R and Julia Advantages and Disadvantages The State of Statistics in Julia 5 Installation and Usage 6 An Example 7 Other Projects Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 15 / 33
R and Julia 1 Overview 2 Features Performance Parallelism Cloud Computing 3 LLVM and Clang 4 Comparison between R and Julia Advantages and Disadvantages The State of Statistics in Julia 5 Installation and Usage 6 An Example 7 Other Projects Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 18 / 33
JIT A richer type system Multiple dispatch Parallelism A cleaner model for accessing libraries of compiled code Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 19 / 33
JIT A richer type system Multiple dispatch Parallelism A cleaner model for accessing libraries of compiled code Memory-mapped I/O Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 19 / 33
arguments of functions and named actual arguments in function calls Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 20 / 33
arguments of functions and named actual arguments in function calls The R package system and CRAN Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 20 / 33
arguments of functions and named actual arguments in function calls The R package system and CRAN Graphics Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 20 / 33
Julia Comparison between R and Julia 1 Overview 2 Features Performance Parallelism Cloud Computing 3 LLVM and Clang 4 Comparison between R and Julia Advantages and Disadvantages The State of Statistics in Julia 5 Installation and Usage 6 An Example 7 Other Projects Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 21 / 33
Julia The State of Statistics in Julia DataFrames Distributions Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 22 / 33
Julia The State of Statistics in Julia DataFrames Distributions Optim Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 22 / 33
Julia The State of Statistics in Julia DataFrames Distributions Optim MCMC Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 22 / 33
Julia The State of Statistics in Julia DataFrames Distributions Optim MCMC NHST: null hypothesis significance testing Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 22 / 33
Julia The State of Statistics in Julia DataFrames Distributions Optim MCMC NHST: null hypothesis significance testing Clustering: k-means clustering Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 22 / 33
− x)2 + 100(y − x2)2 A global minimum at (x, y) = (1, 1) where f (x, y) = 0 Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 24 / 33
function rosenbrock (x:: Vector) (1.0 -x[1]) ^2+100.0*( x[2]-x[1]^2) ^2 end function rosenbrock_gradient (x:: Vector) [ -2.0*(1.0 -x[1]) -400.0*(x[2]-x[1]^2)*x[1] ,200.0*(x[2]-x[1]^2)] end function rosenbrock_hessian (x:: Vector) h = zeros (2, 2) h[1 ,1]=2.0 -400.0*x [2]+1200.0* x[1]^2 h[1 ,2]= -400.0*x[1] h[2 ,1]= -400.0*x[1] h[2 ,2]=200.0 h end Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 25 / 33
= optimize(problem [:f], problem [:g], problem [:h], problem [: initial_x], algorithm , 10e-8, true) print(results) end Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 27 / 33
small machine” Implemented in plain C++ and open-source Support: ALS, SGD, bias-SGD, SVD, NMF, SVD++ Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 28 / 33
with 8 GB of RAM and 256 GB SSD drive http://code.google.com/p/graphchi/ Kou Qiang (Sun Yat-sen University) Introduction to Julia Language December 6, 2012 29 / 33