This repository contains Julia code for a Financial Econometrics (MSc) course at UNISG.
-
Most files are jupyter notebooks. Click one of them to see it online. If GitHub fails to render the notebook or messes up the LaTeX in the Markdown cells, then use nbviewer. Instructions: try to open the notebook at GitHub, copy the link and paste it in the address field of nbviewer.
-
To download this repository, use the Download (as zip) in the Github menu. Otherwise, clone it.
-
To get started, please check the Ch00_HowToUse.ipynb notebook first.
-
ChapterNumber_Topic.ipynb are notebooks organised around different topics. The chapter numbers correspond to the lecture notes (pdf), where more details are given (and the notation is explained).
-
Most statistical/econometric functions are organised in local modules, typically loaded at the top of the notebooks. The source code is in the src subfolder.
-
The pdf file contains the lecture notes.
-
The folder Data contains some data sets used in the notebooks.
-
The plots are in png format. If you want sharper plots, change
default(fmt = :png)
todefault(fmt = :svg)
in one of the top cells. -
The current version is tested on Julia 1.11.
The notebooks are closely tied to my lecture notes. The focus is on learning, so most methods are built from scratch. For instance, to estimate a GARCH model, the notebook builds the likelihood function, calls on a routine for optimisation (for the point estimates) and then differentiation (for the standard errors).
See Michael Creel's code for a similar approach (also focused on teaching)
The following packages provide more convenient (and often more powerful) routines:
GLM.jl for regressions
CovarianceMatrices.jl for robust (heteroskedasticity and/or autocorrelation) covariance estimates
HypothesisTests.jl for testing residuals and distributions
ARCHModels.jl for estimating ARCH and GARCH models
KernelDensity.jl for kernel density estimation
QuantileRegressions.jl for quantile regressions