Preface

This book is a collection of ideas, notes, exercises and code covering a broad range of topics from statistics, machine learning, deep learning, econometrics. The focus is on approaching problems from scratch: instead of using existing packages and libraries, we look at how exactly different methodologies can be implemented in code. This is not to undermine the value of existing packages or provide an alternative. But the bottom-up approach is educationally very rewarding: if you can write an algorithm from scratch, you have truly understood how it works.

Working on it

Please note that this is very much still a work-in-progress. The structure is inherently somewhat loose. Feedback and comments are therefore more than welcome, although time and resources to act on them is scarce at this point.

Resources

R package

The book uses a complementary R package fromScratchR which collects the R code used throughout the book. The book can be read without using the package, but in case you want to play with the code you can install the development version from GitHub with:

Then import the package through library(fromScratchR)

Python code

As for Python code, modules are currently part of the Git repository that contains the book.

Session info

## R version 4.0.3 (2020-10-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS High Sierra 10.13.6
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] data.table_1.13.2  fromScratchR_0.1.0
## 
## loaded via a namespace (and not attached):
##  [1] compiler_4.0.3  magrittr_2.0.1  bookdown_0.20   tools_4.0.3    
##  [5] htmltools_0.5.0 rstudioapi_0.13 yaml_2.2.1      stringi_1.5.3  
##  [9] rmarkdown_2.6   knitr_1.30      stringr_1.4.0   xfun_0.20      
## [13] digest_0.6.27   rlang_0.4.9     evaluate_0.14