The document introduces Julia, a programming language for scientific computing and data science. It begins with an introduction of the speaker and why they chose Julia. Some key advantages of Julia are its readability like Python but performance of C. Julia avoids the two language problem of Python for development and C for performance. Examples are given of who uses Julia, including economists and cancer researchers. The document then demonstrates basic Julia code and concepts like variables, data types, operators, control flow and functions. It also provides a rock-paper-scissors game example to illustrate Julia concepts.
6. Avoid two language problem
One language for rapid development
The other for performance
Example:
Python for rapid development
C for performance
6
13. Nobel prize in economic sciences
The founder of QuantEcon
“His team at NYU uses Julia for macroeconomic modeling and contributes
to the Julia ecosystem.”
https://juliacomputing.com/case-studies/thomas-sargent.html
13
14. In 2015, economists at the Federal Reserve Bank of New York (FRBNY)
published FRBNY’s most comprehensive and complex macroeconomic
models, known as Dynamic Stochastic General Equilibrium, or DSGE
models, in Julia.
https://juliacomputing.com/case-studies/ny-fed.html
14
15. UK cancer researchers turned to Julia to run simulations of tumor growth.
Nature Genetics, 2016
Approximate Bayesian Computation (ABC) algorithms require potentially millions of
simulations - must be fast
BioJulia project for analyzing biological data in Julia
Bayesian MCMC methods Lora.jl and Mamba.jl
https://juliacomputing.com/case-studies/nature.html
15
16. IBM and Julia Computing analyzed eye fundus images provided by Drishti
Eye Hospitals.
Timely screening for changes in the retina can help get them to treatment
and prevent vision loss. Julia Computing’s work using deep learning
makes retinal screening an activity that can be performed by a trained
technician using a low cost fundus camera.
https://juliacomputing.com/case-studies/ibm.html
16
17. Path BioAnalytics is a computational biotech company developing novel
precision medicine assays to support drug discovery and development,
and treatment of disease.
https://juliacomputing.com/case-studies/pathbio.html
17
18. The Sloan Digital Sky Survey contains nearly 5 million telescopic images of
12 megabytes each – a dataset of 55 terabytes.
In order to analyze this massive dataset, researchers at UC Berkeley and
Lawrence Berkeley National Laboratory created a new code named
Celeste.
https://juliacomputing.com/case-studies/intel-astro.html
18
29. 躺著玩、坐著玩、趴著玩,還是運算子好
玩
+x: 就是x本身
-x: 變號
x + y, x - y, x * y, x / y: 一般四則運算
div(x, y): 商
x % y: 餘數,也可以用rem(x, y)
x y: 反除,等價於y / x
x ^ y: 次方
29
30. 操縱數字的機械核心
~x: bitwise not
x & y: bitwise and
x | y: bitwise or
x $ y: bitwise xor
x >>> y:無正負號,將x的位元右移y個位數
x >> y:保留正負號,將x的位元右移y個位數
x << y: 將x的位元左移y個位數
https://www.technologyuk.net/mathematics/number-systems/images/binary_number.gif
30
39. 組織起來
if x == paper
println("你出布")
elseif x == scissor
println("你出剪刀")
elseif x == stone
println("你出石頭")
end
if <判斷式1>
<程式碼1>
elseif <判斷式2>
<程式碼2>
else
<程式碼3>
end
39
41. 巢狀比較
if x == y
println("平手")
elseif x == paper
println("你出布")
if y == scissor
println("電腦出剪刀")
println("電腦贏了")
elseif y == stone
println("電腦出石頭")
println("你贏了")
end
... 41
42. 我的義大利麵條
elseif x == scissor
println("你出剪刀")
if y == paper
println("電腦出布")
println("你贏了")
elseif y == stone
println("電腦出石頭")
println("電腦贏了")
endelseif x == stone
println("你出石頭")
if y == scissor
println("電腦出剪刀")
println("你贏了")
elseif y == paper
println("電腦出布")
println("電腦贏了")
end
end
if x == y
println("平手")
elseif x == paper
println("你出布")
if y == scissor
println("電腦出剪刀")
println("電腦贏了")
elseif y == stone
println("電腦出石頭")
println("你贏了")
end 42
65. Easy to optimize
Allow generalization and flexibility, and enable to optimize.
Hints:
Avoid global variables
Add type declarations
Measure performance with @time and pay attention to memory
allocation
……
65
94. Probability
JuliaStats
JuliaOpt
JuMP.jl
Convex.jl
JuliaML
LearnBase.jl
LossFunctions.jl
ObjectiveFunctions.jl
PenaltyFunctions.jl
Klara.jl: MCMC inference in Julia
Mamba.jl: Markov chain Monte
Carlo (MCMC) for Bayesian
analysis in julia
94
101. Jobs
Apple, Amazon, Facebook, BlackRock, Ford, Oracle
Comcast, Massachusetts General Hospital
Farmers Insurance
Los Alamos National Laboratory and the National
Renewable Energy Laboratory
101
https://juliacomputing.com/press/2017/01/18/jobs.html
the next generation of macroeconomic models is very computationally intensive with large datasets and large numbers of variables
First, as free software
Second, as the models that we use for forecasting and policy analysis grow more complicated, we need a language that can perform computations at a high speed