Book Image

Haskell Financial Data Modeling and Predictive Analytics

By : Pavel Ryzhov
Book Image

Haskell Financial Data Modeling and Predictive Analytics

By: Pavel Ryzhov

Overview of this book

<p>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.</p> <p>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.</p> <p>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.</p> <p>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.</p> <p>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.</p>
Table of Contents (14 chapters)

Outlier detection


Market data are not always clean, and in most cases one should verify the correctness and validity of the data. Though many obvious checks (such as positive price) can be easily implemented, some advanced algorithm should be used to identify an outlier. For our purposes, outlier is a price that appears to deviate significantly from other prices. It might be quite hard to quantify what "significant deviation" means. Here we take the simplest of statistical approaches and assume that prices are normally distributed, though it is not a correct assumption. Under this assumption it is possible to establish a quite simple test based on mean and standard deviation.

Essential mathematical packages

Though the basics of mathematics and statistics are easy to implement, in most cases, it is better to put this work off to already implemented and tested packages rather than manually reimplement all the required algorithms. Any algorithm requires data structures and functions over them...