├── README.md ├── chapter_1_2_4_updated_version.pdf └── code ├── chapter2 ├── BML.R ├── BML.py ├── Fibonacci.cpp ├── Fibonacci.pyx ├── Fibonacci_native.R ├── Fibonacci_native.py ├── benchmark.R ├── benchmark.py ├── binary_search.R ├── binary_search.py ├── binary_search_buggy.R ├── binary_search_buggy.py ├── binary_search_buggy_debug.R ├── binary_search_buggy_debug.py ├── find_pos.R ├── find_pos.py ├── hello_world.R ├── hello_world.py ├── multi_assignment.R ├── pi.R ├── pi.py ├── vectorization_1.R └── vectorization_1.py ├── chapter3 └── mtcars.csv ├── chapter4 ├── linear_regression.R ├── linear_regression.py ├── linear_regression_boston.R ├── linear_regression_boston.py ├── linear_regression_ridge.R ├── linear_regression_ridge.py ├── qr_solver.R ├── qr_solver.py ├── ridge_boston.R └── ridge_boston.py ├── chapter5 ├── TSP.py ├── cities.csv ├── data_banknote_authentication.txt ├── lasso.R ├── lasso.py ├── logistic_regression.R ├── logistic_regression.py ├── normal_mle.R ├── normal_mle.py ├── portfolio_construction.R ├── portfolio_construction.py ├── xirr.R └── xirr.py └── chapter6 ├── cv.R ├── cv.py ├── gbm.py ├── gmm.py ├── grow.py ├── linear_regression_ad.py ├── test_gbm.py ├── tree.R ├── tree.py ├── util.py ├── xgb.R └── xgb.py /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/README.md -------------------------------------------------------------------------------- /chapter_1_2_4_updated_version.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/chapter_1_2_4_updated_version.pdf -------------------------------------------------------------------------------- /code/chapter2/BML.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/BML.R -------------------------------------------------------------------------------- /code/chapter2/BML.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/BML.py -------------------------------------------------------------------------------- /code/chapter2/Fibonacci.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/Fibonacci.cpp -------------------------------------------------------------------------------- /code/chapter2/Fibonacci.pyx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/Fibonacci.pyx -------------------------------------------------------------------------------- /code/chapter2/Fibonacci_native.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/Fibonacci_native.R -------------------------------------------------------------------------------- /code/chapter2/Fibonacci_native.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/Fibonacci_native.py -------------------------------------------------------------------------------- /code/chapter2/benchmark.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/benchmark.R -------------------------------------------------------------------------------- /code/chapter2/benchmark.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/benchmark.py -------------------------------------------------------------------------------- /code/chapter2/binary_search.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/binary_search.R -------------------------------------------------------------------------------- /code/chapter2/binary_search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/binary_search.py -------------------------------------------------------------------------------- /code/chapter2/binary_search_buggy.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/binary_search_buggy.R -------------------------------------------------------------------------------- /code/chapter2/binary_search_buggy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/binary_search_buggy.py -------------------------------------------------------------------------------- /code/chapter2/binary_search_buggy_debug.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/binary_search_buggy_debug.R -------------------------------------------------------------------------------- /code/chapter2/binary_search_buggy_debug.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/binary_search_buggy_debug.py -------------------------------------------------------------------------------- /code/chapter2/find_pos.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/find_pos.R -------------------------------------------------------------------------------- /code/chapter2/find_pos.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/find_pos.py -------------------------------------------------------------------------------- /code/chapter2/hello_world.R: -------------------------------------------------------------------------------- 1 | print("Hello World!") 2 | -------------------------------------------------------------------------------- /code/chapter2/hello_world.py: -------------------------------------------------------------------------------- 1 | print("Hello World!") 2 | -------------------------------------------------------------------------------- /code/chapter2/multi_assignment.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/multi_assignment.R -------------------------------------------------------------------------------- /code/chapter2/pi.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/pi.R -------------------------------------------------------------------------------- /code/chapter2/pi.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/pi.py -------------------------------------------------------------------------------- /code/chapter2/vectorization_1.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/vectorization_1.R -------------------------------------------------------------------------------- /code/chapter2/vectorization_1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter2/vectorization_1.py -------------------------------------------------------------------------------- /code/chapter3/mtcars.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter3/mtcars.csv -------------------------------------------------------------------------------- /code/chapter4/linear_regression.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/linear_regression.R -------------------------------------------------------------------------------- /code/chapter4/linear_regression.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/linear_regression.py -------------------------------------------------------------------------------- /code/chapter4/linear_regression_boston.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/linear_regression_boston.R -------------------------------------------------------------------------------- /code/chapter4/linear_regression_boston.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/linear_regression_boston.py -------------------------------------------------------------------------------- /code/chapter4/linear_regression_ridge.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/linear_regression_ridge.R -------------------------------------------------------------------------------- /code/chapter4/linear_regression_ridge.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/linear_regression_ridge.py -------------------------------------------------------------------------------- /code/chapter4/qr_solver.R: -------------------------------------------------------------------------------- 1 | qr_solver=function(x,y){ 2 | qr.coef(qr(x),y) 3 | } 4 | -------------------------------------------------------------------------------- /code/chapter4/qr_solver.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/qr_solver.py -------------------------------------------------------------------------------- /code/chapter4/ridge_boston.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/ridge_boston.R -------------------------------------------------------------------------------- /code/chapter4/ridge_boston.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter4/ridge_boston.py -------------------------------------------------------------------------------- /code/chapter5/TSP.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/TSP.py -------------------------------------------------------------------------------- /code/chapter5/cities.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/cities.csv -------------------------------------------------------------------------------- /code/chapter5/data_banknote_authentication.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/data_banknote_authentication.txt -------------------------------------------------------------------------------- /code/chapter5/lasso.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/lasso.R -------------------------------------------------------------------------------- /code/chapter5/lasso.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/lasso.py -------------------------------------------------------------------------------- /code/chapter5/logistic_regression.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/logistic_regression.R -------------------------------------------------------------------------------- /code/chapter5/logistic_regression.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/logistic_regression.py -------------------------------------------------------------------------------- /code/chapter5/normal_mle.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/normal_mle.R -------------------------------------------------------------------------------- /code/chapter5/normal_mle.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/normal_mle.py -------------------------------------------------------------------------------- /code/chapter5/portfolio_construction.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/portfolio_construction.R -------------------------------------------------------------------------------- /code/chapter5/portfolio_construction.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/portfolio_construction.py -------------------------------------------------------------------------------- /code/chapter5/xirr.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/xirr.R -------------------------------------------------------------------------------- /code/chapter5/xirr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter5/xirr.py -------------------------------------------------------------------------------- /code/chapter6/cv.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/cv.R -------------------------------------------------------------------------------- /code/chapter6/cv.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/cv.py -------------------------------------------------------------------------------- /code/chapter6/gbm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/gbm.py -------------------------------------------------------------------------------- /code/chapter6/gmm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/gmm.py -------------------------------------------------------------------------------- /code/chapter6/grow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/grow.py -------------------------------------------------------------------------------- /code/chapter6/linear_regression_ad.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/linear_regression_ad.py -------------------------------------------------------------------------------- /code/chapter6/test_gbm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/test_gbm.py -------------------------------------------------------------------------------- /code/chapter6/tree.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/tree.R -------------------------------------------------------------------------------- /code/chapter6/tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/tree.py -------------------------------------------------------------------------------- /code/chapter6/util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/util.py -------------------------------------------------------------------------------- /code/chapter6/xgb.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/xgb.R -------------------------------------------------------------------------------- /code/chapter6/xgb.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rnorm/book_sample/HEAD/code/chapter6/xgb.py --------------------------------------------------------------------------------