Python & Finance: US Government Mandates, Financial Modeling, and Other Snakes in the Grass
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Python & Finance: US Government Mandates, Financial Modeling, and Other Snakes in the Grass

  • 2,625 views
Uploaded on

Recently, the US SEC published a proposal for how to address the current lack of transparency of asset-backed securities through changing disclosure requirements to include the provision of a......

Recently, the US SEC published a proposal for how to address the current lack of transparency of asset-backed securities through changing disclosure requirements to include the provision of a Python computer program. The goal is to capture all the complicated terms of the deal in code that can be used to analyze the cash flows in each deal and how the returns will get split up between different parties. Currently, investors, fund managers, and investment managers receive a complex, textual description of this information in the prospectus, which makes it difficult for them to perform or visualize a rigorous quantitative or if-then analysis of the asset-backed securities.

This all begs the question “Why Python?” One of the answers is that it’s open source and while there are a number of proprietary financial modeling solutions and more than a few trade description languages in use on Wall Street – there is little use asking for openness and transparency from issuers if the interpreter for that code is proprietary in nature. That said, Python has other aspects that make it a good choice for these purposes and has been widely used on Wall Street and in the finance community for financial modeling and number crunching.

At the very least, it’s not enough to have open data, one has to have open tools to fulfill the transparency requirements to establish meaningful use of financial information. Buyers, Sellers and Regulators alike need an open technology means to accurately and efficiently interpret financial information.

This presentation will discuss some of the aspects of Python that make it a good fit for the SEC’s proposal and some of the challenges and the implications of using Python for financial analysis. This presentation will also discuss some opportunities for collaboration between regulators and the open source related to the development of an ecosystem of open source projects that can exploit the availability of this proposed new rich source of financial information.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,625
On Slideshare
2,386
From Embeds
239
Number of Embeds
4

Actions

Shares
Downloads
14
Comments
0
Likes
0

Embeds 239

http://www.activestate.com 143
http://code.activestate.com 92
http://code.gungnir.as-beta.com 3
http://feeds.feedburner.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • The Premise - as the federal government begins to provide data in Web developer-friendly formats, The Challenge - to demonstrate that when government makes data available, it makes itself more accountable and creates more trust and opportunity in its actions. The Belief is that developers will rise to the occasion and harness their creativity to design compelling applications that provide easy access and understanding for the public, while also showing how open data can save the government tens of millions of dollars by engaging the development community in application development at far cheaper rates than traditional government contractors.The Myth – the open source developers don’t need to eatThe Myth – that simply putting this data up on the web, throwing us an XML schema or two or twenty (bone) and we’re off and runningThe domains are complex, the relationships of even similar data across government agency is ill-defined, the Semantic Web is a vision not a reality
  • http://www.w3.org/blog/egov?cat=77 reference: John Sheridan UK National Archives There are many different ways of putting data on the web. It has been possible for governments to publish data using the Internet for over 30 years, long before the web was invented, by providing access to flat files over FTP. In 2009 governments around the world started to move decisively towards publishing increasing volumes of government data on the web, perhaps most notably with the launch of data.gov in the United States.
  • Government aim to be a responsible publisher s – respecting privacy, but promoting transparency and equal accessTo do this it is to address questions such as how to handle versioning and provenance information.
  • The divergent needs of government data publishers and government data consumers is also becoming apparent. But Further work needs to be done To bridge the gap between responsible data publishing and easy data use,
  • There is more work to be done before data publishers to meet the diverse needs of data consumers.
  • The Enron scandal also brought into question the accounting practices and activities of many corporations throughout the United States and was a factor in the creation of the Sarbanes–Oxley Act of 2002. The scandal also affected the wider business world by causing the dissolution of the Arthur Andersen accounting firm.[3]On July 21, 2002, WorldCom filed for Chapter 11 bankruptcy protection in the largest such filing in United States history at the time (since overtaken by the collapse of Lehman Brothers and Washington Mutual in September 2008). The WorldCom bankruptcy proceedings were held before U.S. Federal Bankruptcy Judge Arthur J. Gonzalez who simultaneously heard the Enron bankruptcy proceedings which were the second largest bankruptcy case resulting from one of the largest corporate fraud scandals. None of the criminal proceedings against WorldCom and its officers and agents was originated by referral from Gonzalez or the Department of Justice lawyers.WorldCom changed its name to MCI, and moved its corporate headquarters from Clinton, Mississippi, to Dulles, Virginia, on April 14, 2003.Under the bankruptcy reorganization agreement, the company paid $750 million to the SEC in cash and stock in the new MCI, which was intended to be paid to wronged investors.In May 2003, the company was given a no-bid contract by the United States Department of Defense to build a cellular telephone network in Iraq. The deal has been criticized by competitors and others who cite the company's lack of experience in the area.
  • SEC requirements for XBRL disclosures affect three types of entities: operating companies, mutual funds, and credit rating agencies that are Nationally Recognized Statistical Rating Organizations (NRSROs).
  • Primarily Validation, Quality ControlCombine different data about the same things, although it is held by different parts and levels of government http://apps.xbrlspy.org/xbrl?config=default.txt&uri=http://www.sec.gov/Archives/edgar/data/1324404/000110465910019793/cf-20091231.xml
  • http://www.theatlantic.com/science/archive/2010/07/no-easy-tech-explanation-for-what-caused-wall-st-flash-crash/59766/No Easy Tech Explanation for What Caused Wall St. 'Flash Crash‘
  • require ABS issuers to file Python computer programs describing the flow of funds (called waterfall) in ABS transactions
  • http://www.credfinrisk.com/assetsecure.htmlhttp://economicdarwinism.wordpress.com/2009/03/28/letter-to-obama-our-voices-will-be-heard/http://www.pylaw.org/demonstration.txt
  • This is absolutely the right way to go particularly when coupled with the other proposal that detailed asset level data be also provided in machine readable (XML) format. For a securitization of residential mortgages for example, the proposal requires disclosure of as many as 137 fields (page 135) on each of the possibly thousands of mortgages in the pool. Waterfall provisions in modern securitizations and CDOs are horrendously complicated and even the trustees who are supposed to implement these provisions are known to make mistakes. A year ago, Expect[ed] Loss gave an example where approximately $4 million was paid to equity when that amount should have been used to pay down senior notes (hat tip Deus Ex Macchiato).
  • DavidCameron British PM – Obama – July 2010 http://www.flickr.com/photos/number10gov/4812879733/in/photostream/

Transcript

  • 1. Python & Finance:US Gov Mandates, Financial Modeling, and Other Snakes in the Grass
    Diane Mueller dianem@activestate.com
    Trent Mick trentm@activestate.com
  • 2. Premise
    “Open” Gov’t Data needs “Open” Tools
    Tool Vendors need Open Source technologies
    Expedite delivery of consumption tools to market
    Ensure consistency in interpretation of the data
    Ensure equal access to tools across the supply chain
    Open Government Data Case Study :
    Financial Content at US SEC
  • 3. Disclaimer:
    I am not an accountant, a regulator, a quant or a statistician, I will talk about financial content in lay terms
    I am an open standards geek, a dynamic languages evangelist and an open data advocate
  • 4. Full Disclosure
    Futhermore,
    I work for ActiveState
    Dynamic language Experts
    I sit on the XBRL-International Steering Committee
    More on that later
    And I tweet with multiple personalities..
    @activestate, @pythondj and @xbrlspy
    So follow me at your own risk..
  • 5. So what is eGov?
    the way in which government has to adapt itself to a world in which most people regularly use the internet.
    http://poit.cabinetoffice.gov.uk/poit/
    April, 2009
  • 6. Motivation
    transparency and engagement
    holding government accountable and promoting choice by informing citizens
    efficiency and enhanced public services
    enabling re-use of information within the public sector
    innovation and economic growth
    encouraging and supporting data-driven innovation
  • 7. April, 2009
    eGov in US: Open Government Directive
    January 2009
    President Obama issued a memo on transparency directing his top officials to develop plans for an Open Government Directive to promote transparency, participation, and collaboration.
  • 8. Growing availability of Open Gov Data
    US, UK, Australia, Netherlands, Denmark, Sweden, Spain ...
    Washington , Madrid, London, Vancouver, ...
  • 9. Sharing is Caring, but
  • 10. Publishing Data on Data.Gov
    XML
    Industry, agency, project-specific
    PDF
    RDFa
    Shape
    Excel
  • 11. Unraveling Open Data
    It’s more than just documents for people to read
    Need to enable machines to
    traverse, aggregate, analyze, answer
    Tim Berners-Lee's vision of a “Semantic Web”
    "Semantics", "Ontologies”
    RDFa, Linked Data
  • 12. More Context
    Open government data is a reality
    “Open” doesn’t necessarily mean:
    “Equal Access”
    “Free”
    “Transparent”
    Semantic Web is a vision
    Should be nurtured, supported and encouraged
    But we’re in the middle of a Financial Crisis
    We need to work with the tools we have now
  • 13. But what if the data isn’t enough
    A little structure goes a long way if you combine it with
    A human being with a lot of intelligence/domain knowledge
    (tools, protocols, means of communication)
    (browser, http, share)
    Complex legalese in Filings & Prospectuses
    Logic embedded in them needs to be interpreted
  • 14. Financial Content @ US SEC
    A Case Study in 2 Phases
    Part 1: Lessons Learned the hard way
  • 15. Where were you in 1998?
  • 16. Financial Content @ US SEC
    http://www.xbrl.org
    http://www.xbrlnetwork.com
  • 17. April, 2009 17
    Purpose of XBRL
    a standard format in which to prepare financial reportsthat can subsequently be presented in a variety of ways.
    a standard format in which information can be exchangedbetween different software applications.
    permits the automated, efficient and reliable extraction of information by software applications.
    facilitates the automated comparison of financial and other business information, accounting policies, notes to financial statements between companies, and other items about which users may wish make comparisons that today are performed manually.
  • 18. What is XBRL?
    April, 2009 18
    Standardization
    Presentation
    Cash & Cash Equivalents
    References
    GAAP I.2.(a)
    Instructions
    Ad Hoc disclosures
    Label
    cashCashEquivalentsAndShortTermInvestments
    Calculation
    Cash = Currency + Deposits
    FormulasCash ≥ 0
    Contexts
    US $
    FY2004
    Budgeted
    Validation
    Presentation
    Comptant et Comptant Equivalents
    Presentation
    現金及び現金等価物
    Presentation
    Kas en Geldmiddelen
    Presentation
    Деньги и их эквиваленты
    Presentation
    Гроші та їх еквіваленти
    Presentation
    现金与现金等价物
    Presentation
    Geld & Geld nahe Mittel
    XBRL
    Item
    XMLItem
    XBRL
    Item
  • 19. Why did XBRL make sense for US SEC?
    *Responsible* Publishing of data
    *Easier* for people to consume financial data
    *Solve* some snags other approaches miss
  • 20. 10 years later:US SEC RSS feeds the SEC web site:
    http://www.sec.gov/Archives/edgar/usgaap.rss.xml — This is a list of the most recent 100 Interactive Data documents submitted under the "Interactive Data to Improve Financial Reporting" rule (Release No. 33-9002) using US GAAP as the base taxonomy, updated every 10 minutes.
    http://www.sec.gov/Archives/edgar/xbrlrss.xml — This is a list of the most recent 100 XBRL documents in support of the Interactive Data Voluntary Program (Release No. 33-8529) using US GAAP as the base taxonomy, updated every 10 minutes.
    http://www.sec.gov/Archives/edgar/xbrl-rr-vfp.rss.xml — This is a list of the most recent 100 documents in support of the Extension of Interactive Data Voluntary Reporting Program on the EDGAR System to Include Mutual Fund Risk/Return Summary Information (Release No. 33-8823), updated every 10 minutes.
    http://www.sec.gov/Archives/edgar/xbrl-rr.rss.xml — This is a list of the most recent 100 Interactive Data documents submitted under the "Interactive Data for Mutual Fund Risk/Return Summary" rule (Release No. 33-9006) using RR 2010 as the base taxonomy, updated every 10 minutes.
    http://www.sec.gov/Archives/edgar/xbrlrss.all.xml — This is a list of up to 100 of all the latest filings containing XBRL tagged data, updated every 10 minutes.
  • 21. It’s still a black box world
    Processing Financial Content
    Requires specialized tools
    proprietary processors
    Business Decisions are all about timing
    Access to data to make decision that happen in *nano* seconds
    driven by algorithmic, computerized trading.
  • 22. Lesson Learned in First Phase:Open Data at US SEC
    Appearance of transparency
    Granting of Access was insufficient
    No Open Standard API for XBRL available (yet)
    Asynchronous access to data (latency)
  • 23. Financial Content @ US SEC
    A Case Study in 2 Phases
    Leveraging Existing Open Technology
  • 24. http://benbittrolff.blogspot.com/2008_12_07_archive.html
    Off to the Next Crisis
    http://en.wikipedia.org/wiki/Subprime_crisis_impact_timeline
    Enter the
    Financial Ninjas
  • 25. http://www.sec.gov/rules/proposed/2010/33-9117.pdf
  • 26. The problem
    Industry participants have real problems deciding how the cash flow is allocated. 
    This has very real settlement problems for holders of the securities and their custodians. 
    Regulators/Watchdogs
  • 27. How a Deal Waterfall Works
    Imagine a bunch of bank accounts.
    Cash can come in to the deal from various sources (mostly the collateral, but also interest on various balances, receipts from derivatives in the deal etc) and there are rules which say what cash goes into what account.
    For each account there is a waterfall that says how the money is paid out to various interested parties.
    The rules often include various trigger events which can change the order of priority of the payments etc.
    The whole thing is a state machine, but needs to be precise in every detail as generally once the deal is set up the trustees and managing agents have no discretion.
    They have to follow the script precisely as set out in the deal prospectus.
    http://www.pylaw.org/demonstration.txt
  • 28. What is the SEC asking for?
    Python code to document the waterfall model. 
    decision logic which determines the cash payouts made to all the securities attached to the a specific mortgage pool. 
    Depending on specific events the cash flows distributed to securities will change over time based on events occurring in the underlying portfolio. 
    This is documented in the prospectus which can be > 600 pages of detailed legal language. 
  • 29. Why Python makes sense for US SEC
    Open Freely Available now
    Available libraries for working with complex algorithms
    Numpy, matplotlib
    Bindings exist for other proprietary numerical Financial libraries
    Already widely used for Financial Modeling
    Python is a very readable language.
    when coupled with the other proposal that detailed asset level data be also provided in machine readable (XML) format
    http://jrvarma.wordpress.com/2010/04/16/the-sec-and-the-python/
  • 30. How Access to Financial Models helps..
    Anyone buying a Mortgage Backed Security needs to understand these documents to understand how changes in the mortgage portfolio will affect them. 
    Today if you perform analysis on the mortgage portfolio,
    you need to write a waterfall program to assess the impact on the security you own or plan to buy. 
    There are proprietary analytic packages that do this, but to buy the model is expensive. 
    In fact, the mortgage servicer will use this model to determine the cash flow every month.
    Having the model freely available means that these securities can be valued in a far more cost effective way. 
    You do not want to pay 100K USD for the model to find out the securities are fairly priced. 
    It also means you can run scenario’s on the portfolio and access the impact on the underlying securities in real time. 
    Even if the portfolio is trashed some securities may still come off fairly well. 
    Today without a waterfall, it is hard for investors to price these securities which is probably one reason why the market of these securities is so illiquid.
  • 31. If you build it, will they come?
    What’s Next?
    Give Feedback to SEC Proposal
    What’s Missing?
    Domain Expertise to build Consuming apps
    Open Collaboration forums
    Consuming Applications
    Web Services
    Open APIs
    Funding to take the next steps
  • 32. So why do you think nobody is building apps?
    I don’t know, let’s hold a contest
  • 33. What happens next ..
    Depends upon economics, politics, culture and technology
    Which could easily change in radical ways..
    Through an invention
    Through a insight into a practical application of an existing technology
  • 34. Thank you
    For more information:
    Diane Mueller dianem@activestate.com
    Twitter: @activestate
    Slides: http://bit.ly/pythonfinance
  • 35. 6 Operating Systems
    16 Architectures
    +17,000 Packages/Modules
    10 Major Language Releases
    6 Operating Systems
    16 Architectures
    PERL
    AIX
    TCL
    PERL
    32
    solaris
    windows
    64
    linux
    32
    mac
    Python
    64
    We’ve got your universe covered!
    hp-ux