Haskell Financial Data Modeling and Predictive Analytics
Get an in-depth analysis of financial time series from the perspective of a functional programmer, Overview, 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 threHaskell Financial Data Modeling and predictive AnalyticsCopyright o 2013 Packt PublishingAll rights reserved. No part of this book may be reproduced, stored in a retrievalsystem, or transmitted in any form or by any means, without the prior writtenpermission of the publisher, except in the case of brief quotations embedded incritical articles or reviewsEvery effort has been made in the preparation of this book to ensure the accuracyof the information presented. However, the information contained in this bookis sold without warranty, either express or implied. Neither the author nor PacktPublishing and its dealers and distributors will be held liable for any damagescaused or alleged to be caused directly or indirectly by this bookPackt Publishing has endeavored to provide trademark information about all of thecompanies and products mentioned in this book by the appropriate use of capitalsHowever Packt publishing cannot guarantee the accuracy of this information.First published: October 2013Production reference: 1221013Published by Packt Publishing LtdLivery place35 Livery streetBirmingham b3 2PB, UKISBN978-1-78216-943-7www.packtpub.comCoverImagebyDuraidFatouhi(duraidfatouhi@yahoo.com)CreditsAuthorProject CoordinatorPavel Ryzhovoel goveyaReviewersProofreaderGregory collinClyde JenksIvan perezIndexerAcquisition EditorTejal sonSam birchGraphicsCommissioning EditorRonak dhruvHarsha bharwaniProduction CoordinatorTechnical editorsNileshr MohiteKrishnaveni haridasChandni maisheryCover workNileshr. mohiteAbout the authorPavel ryzhov has graduated from the Lomonosov Moscow State Universityin Russia in the field of mathematical physics, Toda equations and Lie algebrasIn the past 10 years, he has worked as a Technical Lead and Senior SoftwareEngineer. In the last three years, Pavel lead a startup company that mainly providedmathematical and web software development in Haskell. Also, he works on port ofQuantlib, an HQuantLib project in his spare timeI would like personally to thank my wife marina and daughterMarta for supporting my beginnings, my parents for encouragingme, and the enormously helpful Haskell community for providingthe best tools in the worldAbout the reviewersGregory Collins is a software engineer at Google Zurich, where he works on websearch indexing. He has done M.Sc. in Computer Science from the Yale University,and has been programming in Haskell for over a decadeseven years old. He first learned Basic and Logo, which allowed him to experimenrIvan Perez has been passionate about programming and mathematics since he wawith basic programs and computer graphics. After using Visual Basic for severayears he went to a university, where he started programming in many otheranguages, including Ada, Prolog, and Haskell. This changed his view of softwaredevelopment forever, and he decided to focus on functional and logic programmingIn his careerHe obtained the degree of engincering in Computer Science from the TechnicalUniversity of Madrid(UPM)in 2008, and a master's degree in ComputationaLogic in 2009 from the same university. He collaborated and worked with theBabel research Group at UPM from 2003 to 2010, and worked for IMDEA Softwarefrom 2007 to 2009. In 2012, he also worked for the High Performance ComputingCenter(HLRS)at the University of Stuttgart, as part of a research project involvingfunctional programming and supercomputingHe is the founder of Keera Studios(now Keera Studios ltd ) a UK-based companythat uses Haskell, Scala, and other cool languages to create desktop, mobile, and webapplications, and gamesI would like to thank the author, the editors, and the people at Packtfor making this book possible. i would like to thank my wife, nataliafor her constant support and love and my family and friends foralways being there i would also like to thank my associates andcolleagues, who had the patience to listen to my crazy ideas and toembark with me on some of them And last but not the least, i wouldlike to thank all the clients and companies who took a leap of faithwith functional programming, and the whole Haskell communitywho made working with this language the most joyful experienceWww.Packtpub.comSupport files, eBookS, discount offersand moreYoumightwanttovisitwww.Packtpub.comforsupportfilesanddownloadsrelatedtoyour bookDid you know that packt offers e book versions of every book published, with PDF andepuBfilesavailableYoucanupgradetotheeboOkversionatwww.packtpub.comandas a print book customer, you are entitled to a discount on the eBook copy. Get in touchwith us at serviceapacktpub com for more detailsAtwww.Packtpub.comyoucanalof free technical articles sign ulfor a range of free newsletters and receive exclusive discounts and offers on packt booksd ebookHUPACKTLIB'http://packtlib.Packtpub.comDo you need instant solutions to your It questions? PacktLib is Packt's online digitalbook library. Here, you can access, read and search across Packt's entire library of booksWhy Subscribe?Fully searchable across every book published by packtCopy and paste, print and bookmark contentOn demand and accessible via web browserFree Access for packt account holdersIfyouhaveanaccountwithpacktatwww.PacktPubcomyoucanusethistoaccessPacktLib today and view nine entirely free books Simply use your login credentials forimmediate accessTable of contentsPrefaceChapter 1: Getting Started with the Haskell Platform5The Haskell platforQuick tour of Haskell10Laziness10Functions as first-class citizensDatatypes12Type classes13Pattern matching14Monads15The o monad16ummaryChapter 2: Getting Your Hands Dir19The domain model19The Attoparsec library20Parsing plain text files21Parsing files in applicative styleOutlier detection23Essential mathematical packages23Grubb' s test for outliers25Template Haskell, quasiquotes, type families, and GADTS26Persistent oRM framework27Declaring entities28Inserting and updating data28Fetching data30Summary30