Python for Finance: Analyze Big Financial Data

Python for Finance: Analyze Big Financial Data

Language: English

Pages: 606

ISBN: 1491945281

Format: PDF / Kindle (mobi) / ePub

Python for Finance: Analyze Big Financial Data

Language: English

Pages: 606

ISBN: 1491945281

Format: PDF / Kindle (mobi) / ePub


The financial industry has adopted Python at a tremendous rate recently, with some of the largest investment banks and hedge funds using it to build core trading and risk management systems. This hands-on guide helps both developers and quantitative analysts get started with Python, and guides you through the most important aspects of using Python for quantitative finance.

Using practical examples through the book, author Yves Hilpisch also shows you how to develop a full-fledged framework for Monte Carlo simulation-based derivatives and risk analytics, based on a large, realistic case study. Much of the book uses interactive IPython Notebooks, with topics that include:

  • Fundamentals: Python data structures, NumPy array handling, time series analysis with pandas, visualization with matplotlib, high performance I/O operations with PyTables, date/time information handling, and selected best practices
  • Financial topics: mathematical techniques with NumPy, SciPy and SymPy such as regression and optimization; stochastics for Monte Carlo simulation, Value-at-Risk, and Credit-Value-at-Risk calculations; statistics for normality tests, mean-variance portfolio optimization, principal component analysis (PCA), and Bayesian regression
  • Special topics: performance Python for financial algorithms, such as vectorization and parallelization, integrating Python with Excel, and building financial applications based on Web technologies

Financial Reckoning Day: Surviving the Soft Depression of the 21st Century

The Economist (21 May 2016)

Entrepreneurial Finance (2nd Edition)

Never Too Late: Take Control of Your Retirement and Your Future (Revised Edition)

Real Estate Investing For Dummies (3rd Edition)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

also consume roots, fruit, and leaves on occasion. A solenodon weighs a pound or two and has a foot-long head and body plus a ten-inch tail, give or take. This ancient mammal looks somewhat like a big shrew. It’s quite furry, with reddish-brown coloring on top and lighter fur on its undersides, while its tail, legs, and prominent snout lack hair. It has a rather sedentary lifestyle and often stays out of sight. When it does come out, its movements tend to be awkward, and it sometimes trips when

-0.98025745, -0.52453206], [-0.96114497, -0.93554821, -0.45035471], [-0.91759955, 0.20358986, -0.82124413]])In [132]: np.sin(np.pi) # float as inputOut[132]: 1.2246467991473532e-16NumPy provides a large number of such ufuncs that generalize typical mathematical functions to numpy.ndarray objects.[22] Universal Functions Be careful when using the from library import * approach to importing. Such an approach can cause the NumPy reference to the ufunc numpy.sin to be replaced by the reference to

coordinate system. We can use NumPy’s meshgrid function to generate such a system out of two one-dimensional ndarray objects: In [32]: strike = np.linspace(50, 150, 24) ttm = np.linspace(0.5, 2.5, 24) strike, ttm = np.meshgrid(strike, ttm)This transforms both 1D arrays into 2D arrays, repeating the original axis values as often as needed: In [33]: strike[:2]Out[33]: array([[ 50. , 54.34782609, 58.69565217, 63.04347826, 67.39130435, 71.73913043, 76.08695652, 80.43478261, 84.7826087 ,

on sorted x data. This does not have to be the case. To make the point, let us randomize the independent data points as follows: In [26]: xu = np.random.rand(50) * 4 * np.pi - 2 * np.pi yu = f(xu)In this case, you can hardly identify any structure by just visually inspecting the raw data: In [27]: print xu[:10].round(2) print yu[:10].round(2)Out[27]: [ 4.09 0.5 1.48 -1.85 1.65 4.51 -5.7 1.83 4.42 -4.2 ] [ 1.23 0.72 1.74 -1.89 1.82 1.28 -2.3 1.88 1.25 -1.23]As with the noisy data, the regression

hybrid instruments, etc.). Simply stated, in a risk-neutral world, the value of a contingent claim is the discounted expected payoff under the risk-neutral (martingale) measure. This is the probability measure that makes all risk factors (stocks, indices, etc.) drift at the riskless short rate. According to the Fundamental Theorem of Asset Pricing, the existence of such a probability measure is equivalent to the absence of arbitrage. A financial option embodies the right to buy (call option) or

Download sample

Download