Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo
Haskell Financial Data Modeling and Predictive Analytics

Book Description

Get an in-depth analysis of financial time series from the perspective of a functional programmer

  • Understand the foundations of financial stochastic processes

  • Build robust models quickly and efficiently

  • Tackle the complexity of parallel programming

In Detail

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.

Table of Contents

  1. Haskell Financial Data Modeling and Predictive Analytics
    1. Table of Contents
    2. Haskell Financial Data Modeling and Predictive Analytics
    3. Credits
    4. About the Author
    5. About the Reviewers
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Getting Started with the Haskell Platform
      1. The Haskell platform
      2. Quick tour of Haskell
        1. Laziness
        2. Functions as first-class citizens
        3. Datatypes
        4. Type classes
        5. Pattern matching
        6. Monads
        7. The IO monad
      3. Summary
    9. 2. Getting your Hands Dirty
      1. The domain model
      2. The Attoparsec library
      3. Parsing plain text files
      4. Parsing files in applicative style
      5. Outlier detection
        1. Essential mathematical packages
        2. Grubb's test for outliers
      6. Template Haskell, quasiquotes, type families, and GADTs
      7. Persistent ORM framework
        1. Declaring entities
        2. Inserting and updating data
        3. Fetching data
      8. Summary
    10. 3. Measuring Tick Intervals
      1. Point process
      2. Counting process
      3. Durations
        1. Experimental durations
        2. Maximum likelihood estimation
        3. Generic MLE implementation
      4. Poisson process calibration
        1. MLE estimation
        2. Akaike information criterion
        3. Haskell implementation
      5. Renewal process calibration
        1. MLE estimation
      6. Cox process calibration
        1. MLE estimation
      7. Model selection
      8. The secant root-finding algorithm
        1. The QuickCheck test framework
        2. QuickCheck test data modifiers
      9. Summary
    11. 4. Going Autoregressive
      1. The ARMA model definition
      2. The Kalman filter
      3. Matrix manipulation libraries in Haskell
        1. HMatrix basics
      4. The Kalman filter in Haskell
      5. The state-space model for ARMA
      6. ARMA in Haskell
      7. ACD model extension
      8. Experimental conditional durations
        1. The Autocorrelation function
        2. Stream fusion
        3. The Autocorrelation plot
        4. QML estimation
        5. State-space model for ACD
      9. Summary
    12. 5. Volatility
      1. Historic volatility estimators
      2. Volatility estimator framework
      3. Alternative volatility estimators
        1. The Parkinson's number
        2. The Garman-Klass estimator
        3. The Rogers-Satchel estimator
        4. The Yang-Zhang estimator
        5. Choosing a volatility estimator
        6. The variation ratio method
      4. Forecasting volatility
        1. The GARCH (1,1) model
        2. Maximum likelihood estimation of parameters
        3. Implementation details
        4. Parallel computations
          1. Code benchmarking
        5. Haskell Run-Time System
          1. The divide-and-conquer approach
          2. GARCH code in parallel
        6. Evaluation strategy
      5. Summary
    13. 6. Advanced Cabal
      1. Common usage
      2. Packaging with Cabal
      3. Cabal in sandbox
      4. Summary
    14. A. References
    15. Index