Asset prices and returns
Spring 2026
(How) can state-of-the-art methods improve financial decision making?
Empirical finance is finance measured against reality
Data Science buzzwords: big data, machine learning, AI
At the end of the course, you should
Guided coding assignments
The lecture is based on very recent academic papers
AEF closes the gap between core finance courses at KU
Related courses to consider
Stefan (stefan.voigt@econ.ku.dk, www.voigtstefan.me)
Weekly office hours - a chance to ask questions (Thursdays, 11.00 - 12.00)
Show up to my office or online: 669 9264 2905 (password: 687063)
Teaching assistants: Jacob (jacob.wiberg.larsen@econ.ku.dk) and Gabriel (lmk109@econ.ku.dk)
Jacob and Gabriel moderate Absalon discussions and exercise classes, but it is your responsibility to actively engage in the exchange of ideas, code, and knowledge
We provide all exercises, slides, data, and other documents via Github / Absalon
Rest of the team: all the peers around you - connect and help each other out!
Lectures: CSS 25-01-53. Exercise classes: CSS 4-1-30
I record all lectures (no guarantee that things always work, and the ultimate priority is the crowd on campus)
You can do tech without statistics but you cannot do it without coding
The learning curve is very steep, remember to reach out in case something is unclear
https://padlet.com/stefanvoigt2/8xyqpu91evwvndss
Focus on tidy coding, not just language proficiency
Clean, reproducible code can be achieved using Python and R
Follow standard ground rules and irrespective of your preferences, code will be readable, understandable, and intuitive
You will give feedback on Python and R submissions - stick to tidy coding principles, and you will be able to understand what the code of your peers is doing even if you are not an expert in their chosen language
Reversely, that means: Take tidy coding seriously to maximize your chance for valuable feedback
Stick to R, Python (or Julia) because:
| Python | R |
|---|---|
| General language | Specialized language |
| Developed by computer scientists | Developed by statisticians |
| Object-oriented programming | Functional programming |
| Obsessed with efficiency | Lazy about efficiency |
| Obsessed with namespacing | Lazy about namespacing |
| Small, medium, and large data | Small and medium data |
| Machine learning and deep learning | Data wrangling and visualization |
| Spacing is part of the syntax | Spacing is for convenience |
| Indices start with 0 | Indices start with 1 |
See details here
In case you did not set your environment up yet, follow Exercise 0
If you have never used R, Chapters 1-3 of this book are an excellent starting point: Basic introduction to R
Sign up for a free account at DataCamp (only with econ.ku.dk or alumni.ku.dk address)
pandas, numpy, plotninetidyverse and tidyfinanceread_csv(), read_txt(), .., or download with tidyfinancepandas, numpy, and tidyfinancepd.read_csv(), pd.read_txt(), .., or download with tidyfinance|> and .verb(subject, complement) is replaced by subject |> verb(complement) (R) or subject.verb(complement) (Python)%>% instead of |> in R!date formatcount, group_by and summarise solve many data science questionssize, groupby and summarise solve many data science questionsCore principles to make code readable
|> or .)trading_volume_usd instead of tmp_Var_2)Quarto# A tibble: 6,555 × 3
symbol date ret
<chr> <date> <dbl>
1 AAPL 2000-01-04 -0.0843
2 AAPL 2000-01-05 0.0146
3 AAPL 2000-01-06 -0.0865
4 AAPL 2000-01-07 0.0474
5 AAPL 2000-01-10 -0.0176
6 AAPL 2000-01-11 -0.0512
7 AAPL 2000-01-12 -0.0600
8 AAPL 2000-01-13 0.110
9 AAPL 2000-01-14 0.0381
10 AAPL 2000-01-18 0.0348
# ℹ 6,545 more rows
symbol date ret
1 AAPL 2000-01-04 -0.084310
2 AAPL 2000-01-05 0.014633
3 AAPL 2000-01-06 -0.086538
4 AAPL 2000-01-07 0.047369
5 AAPL 2000-01-10 -0.017588
6 AAPL 2000-01-11 -0.051151
7 AAPL 2000-01-12 -0.059973
8 AAPL 2000-01-13 0.109677
9 AAPL 2000-01-14 0.038113
10 AAPL 2000-01-18 0.034848
ggplot2: Grammar of graphics differentiates between the data and the representation: i) Data (data frame being plotted), ii) Geometrics (geometric shape that represents the data, e.g. point, boxplot, histogram), iii) Aesthetics (color, size, shape)library(scales)
prices |>
ggplot(aes(x = date, y = volume_usd, color = symbol)) +
geom_point(size = 0.2) + geom_line(linetype = "dotted") +
labs(x = "Year", y ="Volume (USD)", title = "Daily trading volume", color = NULL) +
facet_wrap(~symbol, scales = "free_x") + theme_bw() +
scale_y_continuous(labels = scales::unit_format(unit = "M",
prefix = "$")) +
theme(legend.position = "none")from plotnine import *
from mizani.formatters import dollar_format
price_plot = (
ggplot(prices, aes(x="date", y="volume_usd", color="symbol"))
+ geom_point(size=0.2)
+ geom_line(linetype="dotted")
+ labs(
x="Year",
y="Volume (USD)",
title="Daily volume",
color=None
)
+ facet_wrap("~symbol", scales="free_x")
+ theme_bw()
+ scale_y_continuous(labels=dollar_format(suffix="M", scale=1e-6))
)
price_plot.show()Stick to the following roadmap if you encounter problems
download_data() is doing, type ?download_data (R) or ?tf.download_data (Python) in the consoleChatGPT and Github Copilot