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)

Renewal process calibration


One of the ways to generalize the Poisson process is to allow inter-arrival times to follow any probability distribution defined on a non-negative, real line. Such extension is called a renewal process. The inter-arrival time's independence and identical distribution are preserved.

In this chapter, we will go through the process with inter-arrival times drawn from the Levy distribution that has the following probability density function:

Here is a scale parameter and is the location parameter. This is a special case of an inverse-gamma distribution and it is from stable distribution family that is quite often employed to describe fat-tailed data.

Levy distribution is defined on . But trades can be placed as near as possible, therefore we assume that the location parameter is zero.

MLE estimation

In this case we will go directly with log-likelihood function, therefore, let's calculate the log probability density function:

Though the constant parts of the equation are...