Haskell is one of the three most influential functional programming languages available today along with Lisp and Standard ML. When used for financial analysis, you can achieve a much-improved level of prediction and clear problem descriptions.
Haskell Financial Data Modeling and Predictive Analytics is a hands-on guide that employs a mix of theory and practice. Starting with the basics of Haskell, this book walks you through the mathematics involved and how this is implemented in Haskell.
The book starts with an introduction to the Haskell platform and the Glasgow Haskell Compiler (GHC). You will then learn about the basics of high frequency financial data mathematics as well as how to implement these mathematical algorithms in Haskell.
You will also learn about the most popular Haskell libraries and frameworks like Attoparsec, QuickCheck, and HMatrix. You will also become familiar with database access using Yesod’s Persistence library, allowing you to keep your data organized. The book then moves on to discuss the mathematics of counting processes and autoregressive conditional duration models, which are quite common modeling tools for high frequency tick data. At the end of the book, you will also learn about the volatility prediction technique.
With Haskell Financial Data Modeling and Predictive Analytics, you will learn everything you need to know about financial data modeling and predictive analytics using functional programming in Haskell.
Author(s): Pavel Ryzhov
Year: 2013
Cover
Copyright
Credits
About the Author
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Getting Started with Haskell Platform
The Haskell platform
Quick tour of Haskell
Laziness
Functions as first-class citizens
Datatypes
Type classes
Pattern matching
Monads
The IO monad
Summary
Chapter 2: Getting Your Hands Dirty
The domain model
The Attoparsec library
Parsing plain text files
Parsing files in applicative style
Outlier detection
Essential mathematical packages
Grubb's test for outliers
Template Haskell, quasiquotes, type families and GADTs
Persistent ORM framework
Declaring entities
Inserting and updating data
Fetching data
Summary
Chapter 3: Measuring Tick Intervals
Point process
Counting process
Durations
Experimental durations
Maximum likelihood estimation
Generic MLE implementation
Poisson process calibration
MLE estimation
Akaike information criterion
Haskell implementation
Renewal process calibration
MLE estimation
Cox process calibration
MLE estimation
Model selection
The secant root finding algorithm
The QuickCheck test framework
QuickCheck test data modifiers
Summary
Chapter 4: Going Autoregressive
The ARMA model definition
The Kalman filter
Matrix manipulation libraries in Haskell
HMatrix basics
The Kalman filter in Haskell
The state space model for ARMA
ARMA in Haskell
ACD model extension
Experimental conditional durations
The Autocorrelation function
Stream fusion
Autocorrelation plot
QML estimation
State space model for ACD
Summary
Chapter 5: Volatility
Historic volatility estimators
Volatility estimator framework
Alternative volatility estimators
The Parkinson's number
The Garman-Klass estimator
The Rogers-Satchel estimator
The Yang-Zhang estimator
Choosing a volatility estimator
The variation ratio method
Forecasting volatility
The GARCH (1,1) model
Maximum likelihood estimation of parameters
Implementation details
Parallel computations
Code benchmarking
Haskell Run-Time System
The divide and conquer approach
GARCH code in parallel
Evaluation strategy
Summary
Chapter 6: Advanced Cabal
Common usage
Packaging with Cabal
Cabal in sandbox
Summary
Appendix: References
Index