Jun 03

Python for Finance-review

Python for Finance
375 pages
Author: Yuxing Yan
April 2014
Published by Packt Publishing Ltd.
Livery Place
35 Livery Place
Birmingham, B3 2PB, UK
ISBN: 978-1-78328-437-5

I received a copy of the e-book for review from the publisher.

Audience: This book is aimed at Finance professionals and/or students with an interest in options trading and portfolio composition and evaluation.

Python for Finance

It assumes no Python programming experience. The author primarily uses Windows as the platform of choice. The author primarily refers to Python 3.3, strangely there are no cautionary or explanatory notes on the differences and usage requirements between the Python 2.7 series and the 3.3 series. This may cause some serious confusion to people new to Python. While none of the code is platform specific, it is Python after all, using Windows makes the code examples and installation instructions somewhat easier to follow for Windows users and a large percentage of people in Financial institutions and students seem to be locked in to the Windows platform.

Summary:

  • Ch1 Introduction and Installation of Python
  • Ch2 Using Python as an Ordinary Calculator
  • Ch3 Using Python as a Financial Calculator
  • Ch4 13 Lines of Python to Price a Call Option
  • Ch5 Introduction to Modules
  • Ch6 Introduction to Numpy Scipy
  • Ch7 Visual Finance via Matplotlib
  • Ch8 Statistical Analysis of Time Series
  • Ch9 The Black-Scholes-Merton Option Model
  • Ch10 Python Loops and Implied Volatility
  • Ch11 Monte Carlo Simulation and Options
  • Ch12 Volatility Measures and GARCH

The book takes a somewhat unique approach in interweaving Python concepts on an as needed basis with the introduction of progressively more advanced mathematics specific to the Finance field, primarily Options oriented.

I found the approach quite useful. In addition the book includes examples of retrieving financial data from a number of sources. specific code for retrieving data from Yahoo, Google, Federal Reserve and Prof French library is provided.

The introduction to NumPy, SciPy, and Matplotlib (graphing library) are quite well done with well chosen examples.

The book is a strong addition to the growing body of work for finance professionals who want to learn Python.

The book falls short in some of its more lofty goals including exploring Statsmodels and Pandas. And it has almost no mention of IPython notebook, which has rapidly become the default environment for many in the Finance field. Critically in my opinion, the book lacks a good explanation of the differences between floating point and integer arithmetic with its critical implications for Finance professionals.

To some degree this is to be expected since each of those topic areas is in fact subject to books of their own. That is, they are very large libraries and have numerous features that can and do interact with each other.

While the book does cover Pandas it’s usage examples are somewhat limited. The text does not point out how Pandas is built on top of Numpy/Scipy. It does not cover the use of resample to change frequency or offset to offset frequencies. Nor does it cover in much depth the extensive IO libraries built into Pandas, which provide cleaner access to many external data sources like Yahoo, Google the Federal Reserve as well as SQL databases. The coverage is limited to a subset of the CSV IO and some use of the Pickle module. Further there is no mention of the Pandas Dataframe Plotting capabilities.

Statsmodels, like Pandas is a newer Python library with rapidly expanding capabilities. Basic capabilities are nicely explained but more advanced capabilities are not. I was hoping to see some usage examples of some of the more advanced capabilities with explanations, but I admit that that is due to my own current frustration with figuring out some of those things myself.

Advanced Financial concepts such as, Time Series with Efficient frontier, Monte carlo simulation for options and GARCH are each well covered with good examples.

While some of the above sounds somewhat critical, I enjoyed the book and will keep it for quick reference, particularly for the Options valuation material. For those new to Python with a Finance interest, I would recommend the book highly, but I would augment it with additional Python material. The book is an excellent introduction and can provide a solid foundation for exploring the more advanced facilities of the various Python Financially oriented modules.

Mar 14

Statistics and Data Mining with Open Source Tools

This was presented to two statistics and data mining classes at the University of Alabama on March 14, 2013. The purpose was to provide a high level overview of the open source tools and community with an emphasis on the Python world. As I went through preparing, I was impressed with how much activity there is and how it is accelerating. Those who already participate in the Python community will know many if not most of these resources, for new people, there will be some useful links. Again, those who know Python will recognize how much I left out, but this is just the intro! So I don't want to overwhelm anyone.

Feb 03

Python For Data Analysis-Book Review

Python For Data Analysis. Author: Wes McKinney, Publisher: O’Reilly Media, Inc, Sebastopol, CA 95472 isbn: 978-1-449-31979-3 copyright 2013, 472 pages, cover price: $39.99

No matter what your skill level, you need this book.

Python For Data Analysis

Once you get the basics of the Python language down you need to lift your skills to the next level to do useful work. For me, I wanted to put up a few web sites so that encouraged me to learn about Django, a web framework written in Python. This leap left me with some major gaps in my conceptual understanding of many Python idioms, which with time I guess I’ll fill in.

Another area where I spend time is doing various forms of Data Analysis. The Python tools and skills needed for this work are quite different from building web sites. I was very interested when I first saw the Pandas data analysis library which recommended the use of I-Python, another tool that I had not really begun to explore.

In short, the Pandas library and I-Python tool set make for a very powerful data manipulation and analysis toolset. There is a fascinating confluence of activity in the Python world with packages such as Numpy, scipy and I-Python and now Pandas, stats models, scikit learn and Numba increasingly supporting the Scientific and Data analysis communities. While a lot of the tools emphasize Matrix (array) operations, which initially put me off, Pandas makes it way more approachable since it more closely resembles spreadsheet structures which in fact resemble matrices once you wrap your head around the concepts.

Another major data manipulation capability introduced by Pandas, as explained in the text, is a set of SQL- like operators for Array operations enabling joining, summarizing and other SQL like operations on in-memory datasets.

I bought an early access copy of Python for Data Analysis and I have since kept it up to date which is a great feature of O’Reilly early access publications.

The book covers basic prerequisite information on the following:

  • Python
  • NumPy
  • Pandas
  • matplotlib
  • Ipython
  • SciPy

The book is excellent taking one through the conceptual issues through to the execution of sophisticated analysis of data sets from a variety of sources. The problems are well documented and the code can be executed with available data (something I have yet to do). Examples include: Getting and using data from:

  • usa.gov
  • usda
  • Federal Election Commission
  • Yahoo finance

Throughout the book examples and code are presented with thorough explanations, way beyond simple code commentary in a teacher-like style. Due to the nature of the code being explained there was for me a constant set of aha moments as I began to understand not just the syntax of the code but why the code should be used to achieve the desired result, and also how to use some of the less obvious Python and Pandas language elements to better effect, in short helping me to be a more fluent coder.

Wes is truly a polymath, who understands analysis, advanced math and statistics as well as being an awesome coder of the Pandas package itself, and, to boot, he can write clearly in a way to be understood by mere mortals attempting to get up to speed on the tools and concepts embraced and enabled by the tools he has built and assembled. I also find the appendix summary of the Python language to be compact and useful in its own right.

Can’t recommend the book highly enough.

Feb 03

The Signal And the Noise-Book Review

The Signal And The Noise, By Nate Silver, The Penguin Press, New York, copyright 2012 isbn 978-1-59420-411-1, 534 pages, Cover price: $27.95

The Signal And The Noise

I’m no math whiz but I love analysis. This book has little math but much useful insight on how to view and analyze data and information.

Nate Silver became famous for his predictions about the most recent presidential election in his 538 blog and columns for the New York Times.

The book is highly readable and one almost does not realize that they are in the hands of a master teacher. You just learn a ton of useful ways to think about analytical problems.

People looking for a more detailed explanation of how Nate built his election models will be disappointed. Conversely, if statistics, formulas, and detailed mathematical explanations scare or bore you , have no fear, those items are not present.

This places the book in a somewhat awkward spot, not tech and yet analytical. Once you “get it”, it becomes quite enjoyable.. As I told my wife, as I got to the the 8th chapter, I was getting to the “good part” where Nate goes into what is perhaps the most technical part of the book with an explanation of Bayesian statistics and the difference from conventional frequentist statistics that most of us have learned in school.

While, in truth, I was hoping for a “bit more” of math, and or computer code, to help me learn how to apply the techniques which are so well explored in the book, I was very satisfied with what I got. My frustration is due to my desire to translate theory and examples into code and personal utility on various projects I’m working on. So, in short, a personal issue.

What is very well done is to explore a wider variety of “problem spaces” such as baseball prediction, political prediction, the financial meltdown, Texas Holdem betting strategy, predicting terrorist activity, climate change and picking correct data vs noisy or biased data, and how to tell the difference. The examples are explained in sufficient detail so you learn a great deal about how to approach similar problems and how to evaluate similar data and conclusions. You will certainly view your investment process in a different and more informed manner.

I strongly recommend this book for anyone interested in day to day evaluation of life choices,which should be everyone. The book would also be a good college text for learning about “statistical thinking”.

Jan 27

Bad Reasons to Stay With Exchange Mail

Dave Girouard, the former head of Google's' Apps business, says it very well in this piece on the GIGAOM site, which I strongly recommend reading.

Insane excuses for not moving to the cloud.

  • Insanity #1: These big outages mean we should keep things in house
  • Insanity #2: I need somebody to talk to when a service interruption occurs
  • Insanity #3; Cloud is OK for non-critical applications with non-sensitive data

See the full article Here.

And this followup post about legal risk makes good points as well Here.

And even more from Google on how they handle legal request/warrants Here.

I would also add that I see many people just staying put because the default decision to do nothing seems so appealing. After all who wants to leave Outlook for something new that they have to learn, just remember back on how difficult it was to learn Outlook in the first place. Not to mention the confusion and trauma that a new release presents to the end users.

The Google product has been hugely successful due to its ease of use and continuous non traumatic update cycle, and cost savings are simply a bonus. In addition the Google products are built from the ground up to be completely Mobile friendly. It is amazing how many individuals choose to use Gmail for personal use and feel they step back in time every-time they have to use company provided exchange mail.

In short not moving is simply falling further behind and spending more than is needed for the comfort of not learning a bit of new technology.

Jan 24

Google Apps Continue to Gain

Google's' latest Quarterly report included the following on Google apps acceptance.

"Our enterprise business continued to grow at an impressive pace, gaining traction among some of the largest companies in the world. New customers include Nintendo, the Canadian Broadcast Company, Shaw Industries, POSCO, Randstad and Hyundai, to name a few. And after signing in May, the U.S. Department of the Interior moved more than 70,000 employees to the cloud during Q4 making it the largest federal agency to date using Google Apps."

Sep 12

Google Apps Showcase

Non profits! It is free, see here http://www.google.com/nonprofits/ I'll be happy to consult with you on how to implement.

By: Tom Brander Google +:http://profiles.google.com/tombrander
Sep 12

Google Apps Introduction

Here is a brief introduction to Google Apps for business.

By: Tom Brander
Aug 26

Microsoft Forefront -A New Roadblock For Google Apps E-mail Conversions

I recently converted a 45 seat company from hosted Exchange to Google Apps. All was working well. Then.....

A few weeks later when we deactivated Exchange, I began to get a few complaints that some people sending us e-mails were receiving bounce messages. A quick glance at the messages seemed to indicate that the senders were somehow still sending the messages to the old host. So, I felt that the rejections were exactly as they should be, and I advised the senders to determine why they were not updating their MX records, as the vast majority was working fine.

That got me nowhere and the complaints escalated with more companies reporting the same issue. Finally, one of our affiliate law firms with the issue worked through it with Microsoft, although I could not believe the solution at first.

Apparently, our former host also subscribed to Forefront (from Microsoft) which provides some security and policy enforcement. It also nails down the IP address of the mail server for ALL users across Forefront. So, no matter what the MX record says mail will be routed by IP for all Forefront users. This occurs even if the MX record is changed and the old Exchange server is removed.

The solution is to remove the domain from Forefront which must be done by request to the Forefront service by the Forefront/Old Exchange client.

Now all mail from all external companies is flowing correctly to Google Apps.

I have not found ANY mention of this issue on the web or in Google Apps documentation.

This impacted our receipt of mail from several banks, law firms and public authorities (all Forefront users).

By: Tom Brander Google +:http://profiles.google.com/tombrander
Aug 02

Mid Year Alabama Real Estate Update

This was presented to the Alabama Center For Real Estate Advisory Board on August 2, 2012.

By: Tom Brander

About OSWCO

OSWCO is dedicated to introducing and supporting Open Source Software to the Enterprise. The Open Source movement and products have become highly sophisticated, cost effective, and mature. Many leading companies and organizations are making rapidly increasing investments in it's use.


To see our Information about Google Apps click Google Apps Info

OSWCO is an authorized Google Apps reseller. Some organizations need help and a place to turn to for, consulting, product development or commercial support. We have developed an extensive network of reliable experts to assist you, able to take on the largest turnkey projects. Contact us to help you examine the options. Phone: 205-267-1089. More info:


Subscribe to us:

Elsewhere

Categories

Recent Posts

Archive

BlogRoll

Popular Posts

Django Popular