logo资料库

Python for Finance(2nd) 无水印pdf.pdf

第1页 / 共656页
第2页 / 共656页
第3页 / 共656页
第4页 / 共656页
第5页 / 共656页
第6页 / 共656页
第7页 / 共656页
第8页 / 共656页
资料共656页,剩余部分请下载后查看
Cover
Contents
1. Python Basics
2. Introduction to Python Modules
3. Time Value of Money
4. Sources of Data
5. Bond and Stock Valuation
6. Capital Asset Pricing Model
7. Multifactor Models and Performance Measures
8. Time-Series Analysis
9. Portfolio Theory
10. Options and Futures
11. Value at Risk
12. Monte Carlo Simulation
13. Credit Risk Analysis
14. Exotic Options
15. Volatility, Implied Volatility, ARCH, and GARCH
Contents
1: Python Basics b'Chapter 1: Python Basics' b'Python installation' b'Variable assignment, empty space, and writing our own programs' b'Writing a Python function' b'Python loops' b'Data input' b'Data manipulation' b'Data output' b'Exercises' b'Summary' 2: Introduction to Python Modules b'Chapter 2: Introduction to Python Modules' b'What is a Python module?' b'Introduction to NumPy' b'Introduction to SciPy' b'Introduction to matplotlib' b'Introduction to statsmodels' b'Introduction to pandas' b'Python modules related to finance' b'Introduction to the pandas_reader module' b'Two financial calculators' b'How to install a Python module' b'Module dependency' b'Exercises' b'Summary' 3: Time Value of Money b'Chapter 3: Time Value of Money' b'Introduction to time value of money' b'Writing a financial calculator in Python' b'Definition of NPV and NPV rule' b'Definition of IRR and IRR rule' b'Definition of payback period and payback period rule' b'Writing your own financial calculator in Python' b'Two general formulae for many functions' b'Exercises' b'Summary'
4: Sources of Data b'Chapter 4: Sources of Data' b'Diving into deeper concepts' 5: Bond and Stock Valuation b'Chapter 5: Bond and Stock Valuation' b'Introduction to interest rates' b'Term structure of interest rates' b'Bond evaluation' b'Stock valuation' b'A new data type \xe2\x80\x93 dictionary' b'Summary' 6: Capital Asset Pricing Model b'Chapter 6: Capital Asset Pricing Model' b'Introduction to CAPM' b'Moving beta' b'Adjusted beta' b'Extracting output data' b'Simple string manipulation' b'Python via Canopy' b'References' b'Exercises' b'Summary' 7: Multifactor Models and Performance Measures b'Chapter 7: Multifactor Models and Performance Measures' b'Introduction to the Fama-French three-factor model' b'Fama-French three-factor model' b'Fama-French-Carhart four-factor model and Fama-French five- factor model' b'Implementation of Dimson (1979) adjustment for beta' b'Performance measures' b'How to merge different datasets' b'References' b'Exercises' b'Summary' 8: Time-Series Analysis b'Chapter 8: Time-Series Analysis' b'Introduction to time-series analysis'
b'Merging datasets based on a date variable' b'Understanding the interpolation technique' b'Tests of normality' b'52-week high and low trading strategy' b'Estimating Roll's spread' b'Estimating Amihud's illiquidity' b'Estimating Pastor and Stambaugh (2003) liquidity measure' b'Fama-MacBeth regression' b'Durbin-Watson' b'Python for high-frequency data' b'Spread estimated based on high-frequency data' b'Introduction to CRSP' b'References' b'Exercises' b'Summary' 9: Portfolio Theory b'Chapter 9: Portfolio Theory' b'Introduction to portfolio theory' b'A 2-stock portfolio' b'Optimization \xe2\x80\x93 minimization' b'Forming an n-stock portfolio' b'Constructing an optimal portfolio' b'Constructing an efficient frontier with n stocks' b'References' b'Exercises' b'Summary' 10: Options and Futures b'Chapter 10: Options and Futures' b'Introducing futures' b'Payoff and profit/loss functions for call and put options' b'European versus American options' b'Black-Scholes-Merton option model on non-dividend paying stocks' b'Generating our own module p4f' b'European options with known dividends' b'Various trading strategies' b'Put-call parity and its graphic presentation'
b'Chapter 11: Value at Risk' b'Introduction to VaR' b'Normality tests' b'Skewness and kurtosis' b'Modified VaR' b'VaR based on sorted historical returns' b'Simulation and VaR' b'VaR for portfolios' b'Backtesting and stress testing' b'Expected shortfall' b'References' b'Exercises' b'Summary' 12: Monte Carlo Simulation b'Binomial tree and its graphic presentation' b'Hedging strategies' b'Implied volatility' b'Binary-search' b'Retrieving option data from Yahoo! Finance' b'Volatility smile and skewness' b'References' b'Exercises' b'Summary' 11: Value at Risk b'Chapter 12: Monte Carlo Simulation' b'Importance of Monte Carlo Simulation' b'Generating random numbers from a standard normal distribution' b'Generating random numbers with a seed' b'Generating random numbers from a uniform distribution' b'Using simulation to estimate the pi value' b'Generating random numbers from a Poisson distribution' b'Selecting m stocks randomly from n given stocks' b'With/without replacements' b'Distribution of annual returns' b'Simulation of stock price movements' b'Graphical presentation of stock prices at options' maturity dates' b'Replicating a Black-Scholes-Merton call using simulation'
b'Liking two methods for VaR using simulation' b'Capital budgeting with Monte Carlo Simulation' b'Python SimPy module' b'Comparison between two social policies \xe2\x80\x93 basic income and basic job' b'Finding an efficient frontier based on two stocks by using simulation' b'Constructing an efficient frontier with n stocks' b'Long-term return forecasting' b'Efficiency, Quasi-Monte Carlo, and Sobol sequences' b'References' b'Exercises' b'Summary' 13: Credit Risk Analysis b'Chapter 13: Credit Risk Analysis' b'Introduction to credit risk analysis' b'Credit rating' b'Credit spread' b'YIELD of AAA-rated bond, Altman Z-score' b'Using the KMV model to estimate the market value of total assets and its volatility' b'Term structure of interest rate' b'Distance to default' b'Credit default swap' b'References' b'Exercises' b'Summary' 14: Exotic Options b'Chapter 14: Exotic Options' b'European, American, and Bermuda options' b'Chooser options' b'Shout options' b'Binary options' b'Rainbow options' b'Pricing average options' b'Pricing barrier options' b'Barrier in-and-out parity'
b'Graph of up-and-out and up-and-in parity' b'Pricing lookback options with floating strikes' b'References' b'Exercises' b'Summary' 15: Volatility, Implied Volatility, ARCH, and GARCH b'Chapter 15: Volatility, Implied Volatility, ARCH, and GARCH' b'Conventional volatility measure \xe2\x80\x93 standard deviation' b'Tests of normality' b'Estimating fat tails' b'Lower partial standard deviation and Sortino ratio' b'Test of equivalency of volatility over two periods' b'Test of heteroskedasticity, Breusch, and Pagan' b'Volatility smile and skewness' b'Graphical presentation of volatility clustering' b'The ARCH model' b'Simulating an ARCH (1) process' b'The GARCH model' b'Simulating a GARCH process' b'Simulating a GARCH (p,q) process using modified garchSim()' b'GJR_GARCH by Glosten, Jagannanthan, and Runkle' b'References' b'Exercises' b'Summary' backindex: Appendix A: Index b'Chapter Appendix A: Index'
Chapter 1. Python Basics In this chapter, we will discuss basic concepts and several widely used functions related to Python. This chapter plus the next one (Chapter 2, Introduction to Python Modules) are only the chapters exclusively based on Python techniques. Those two chapters serve as a review for readers who have some basic Python knowledge. There is no way that a beginner, with no prior Python knowledge, could master Python by reading just those two chapters. For a new learner who wants to learn Python in more detail, he/she could find many good books. From Chapter 3, Time Value of Money onward, we will use Python, which will help in explaining or demonstrating various finance concepts, running regression, and processing data related to economics, finance, and accounting. Because of this, we will offer more Python-related techniques and usages in each of the upcoming chapters. In particular, in this chapter, we will discuss the following topics: Python installation Variable assignment, empty space, and writing our own programs Writing a Python function Data input Data manipulation Data output
分享到:
收藏