没有合适的资源?快使用搜索试试~ 我知道了~
首页Python金融实战:第二版 - 应用numpy与金融建模
"《Python for Finance - 第二版》是一本深度介绍如何利用Python进行金融建模和量化分析的专业书籍,由Yuxing Yan撰写。本书旨在帮助读者理解Python的数据结构基础,并掌握处理时间序列数据的技巧。作者通过详细的步骤教程,结合NumPy、SciPy、matplotlib等流行的Python库,引导读者编写实际的程序,将理论知识转化为实践能力。 本书的主要内容涵盖了金融领域的核心概念,包括但不限于计算金融工具的定价、风险管理、数据清洗与预处理、技术分析和机器学习在金融中的应用等。读者可以跟随书中的例子,学习如何利用Python解决金融问题,例如预测股票价格、执行回测策略、分析财务报告等。 第二版更新于2017年6月,反映了Python在金融行业的最新发展和变化,确保了所教授的知识和技术的时效性。尽管书中提供的信息力求准确,但需要明确的是,所有信息均不带任何形式的保修,作者和出版社不对因本书造成的直接或间接损失负责。此外,由于版权原因,未经出版商书面许可,本书的部分内容不能被复制、存储或传输。 本书适合对Python编程有一定基础,且对金融领域感兴趣的人士阅读,无论是金融专业人士还是希望转型进入金融领域的科技人员,都能从中找到实用且深入的指导。通过本书,读者不仅能提升Python技能,还能深入理解金融领域的核心技术和实践方法。"
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/10548444/bg10.jpg)
Table of Contents
[ vii ]
Capital budgeting with Monte Carlo Simulation 446
Python SimPy module 449
Comparison between two social policies – basic income and basic job 450
Finding an efcient frontier based on two stocks by using simulation 454
Constructing an efcient frontier with n stocks 457
Long-term return forecasting 460
Efciency, Quasi-Monte Carlo, and Sobol sequences 462
Appendix A – data case #8 - Monte Carlo Simulation and blackjack 463
References 464
Exercises 464
Summary 466
Chapter 13: Credit Risk Analysis 467
Introduction to credit risk analysis 468
Credit rating 468
Credit spread 475
YIELD of AAA-rated bond, Altman Z-score 477
Using the KMV model to estimate the market value of total assets
and its volatility 479
Term structure of interest rate 482
Distance to default 485
Credit default swap 486
Appendix A – data case #8 - predicting bankruptcy by using Z-score 487
References 488
Exercises 488
Summary 490
Chapter 14: Exotic Options 491
European, American, and Bermuda options 492
Chooser options 494
Shout options 496
Binary options 497
Rainbow options 498
Pricing average options 505
Pricing barrier options 507
Barrier in-and-out parity 509
Graph of up-and-out and up-and-in parity 510
Pricing lookback options with oating strikes 512
Appendix A – data case 7 – hedging crude oil 514
References 516
Exercises 516
Summary 519
![](https://csdnimg.cn/release/download_crawler_static/10548444/bg11.jpg)
Table of Contents
[ viii ]
Chapter 15: Volatility, Implied Volatility, ARCH, and GARCH 521
Conventional volatility measure – standard deviation 522
Tests of normality 522
Estimating fat tails 524
Lower partial standard deviation and Sortino ratio 526
Test of equivalency of volatility over two periods 528
Test of heteroskedasticity, Breusch, and Pagan 529
Volatility smile and skewness 532
Graphical presentation of volatility clustering 534
The ARCH model 535
Simulating an ARCH (1) process 536
The GARCH model 537
Simulating a GARCH process 538
Simulating a GARCH (p,q) process using modied garchSim() 539
GJR_GARCH by Glosten, Jagannanthan, and Runkle 542
References 545
Appendix A – data case 8 - portfolio hedging using VIX calls 545
References 546
Appendix B – data case 8 - volatility smile and its implications 546
Exercises 548
Summary 549
Index 551
![](https://csdnimg.cn/release/download_crawler_static/10548444/bg12.jpg)
[ ix ]
Preface
It is our rm belief that an ambitious student major in nance should learn at least
one computer language. The basic reason is that we have entered a so-called big data
era. In nance, we have a huge amount of data, and most of it is publically available
free of charge. To use such rich sources of data efciently, we need a tool. Among
many potential candidates, Python is one of the best choices.
A few words for the second edition
For the second edition, we have reorganized the structure of the book by adding
more chapters related to nance. This is recognition and response to the feedbacks
from numerous readers. For the second edition, the rst two chapters are exclusively
devoted to Python. After that, all remaining chapters are associated with nance.
Again, Python in this book is used as a tool to help readers learn and understand
nancial theories better. To meet the demand of using all types of data by various
quantitative programs, business analytics programs and nancial engineering
programs, we add Chapter 4, Sources of Data. Because of this restructuring, this edition
is more suitable for a one-semester course such as Quantitative Finance, Financial
Analysis using Python and Business Analytics. Two nance professors, Premal P.
Vora, at Penn State University, Sheng Xiao, at Westminister College, have adopted
the rst edition as their textbook. Hopefully, more nance, accounting professors
would nd the second edition is more suitable for their students, especially for
those students from a nancial engineering program, business analytics and other
quantitative areas.
![](https://csdnimg.cn/release/download_crawler_static/10548444/bg13.jpg)
Preface
[ x ]
Why Python?
There are various reasons that Python should be used. Firstly, Python is free in terms
of license. Python is available for all major operating systems, such as Windows,
Linux/Unix, OS/2, Mac, and Amiga, among others. Being free has many benets.
When students graduate, they could apply what they have learned wherever they
go. This is true for the nancial community as well. In contrast, this is not true for
SAS and MATLAB. Secondly, Python is powerful, exible, and easy to learn. It is
capable of solving almost all our nancial and economic estimations. Thirdly, we
could apply Python to big data. Dasgupta (2013) argues that R and Python are two of
the most popular open source programming languages for data analysis. Fourthly,
there are many useful modules in Python. Each model is developed for a special
purpose. In this book, we focus on NumPy, SciPy, Matplotlib, Statsmodels, and
Pandas modules.
A programming book written by a nance
professor
There is no doubt that the majority of programming books are written by professors
from computer science. It seems odd that a nance professor writes a programming
book. It is understandable that the focus would be quite different. If an instructor
from computer science were writing this book, naturally the focus would be
Python, whereas the true focus should be nance. This should be obvious from the
title of the book Python for Finance. This book intends to change the fact that many
programming books serving the nance community have too much for the language
itself and too little for nance. Another unique feature of the book is that it uses a
huge amount public data related to economics, nance and accounting, see Chapter 4,
Sources of Data for more details.
What this book covers
Chapter 1, Python Basics, offers a short introduction, and explains how to install
Python, how to launch and quit Python, variable assignment, vector, matrix and
Tuple, calling embedded functions, write your own functions, input data from an
input le, simple data manipulations, output our data and results, and generate a
Python dataset with an extension of pickle.
![](https://csdnimg.cn/release/download_crawler_static/10548444/bg14.jpg)
Preface
[ xi ]
Chapter 2, Introduction to Python Modules, discusses the meaning of a module, how
to import a module, show all functions contained in an imported module, adopt a
short name for an imported module, compare between import math and from math
import, delete an imported module, import just a few functions from a module,
introduction to NumPy, SciPy, matplotlib, statsmodels, pandas and Pandas_reader,
nd out all built-in modules and all available (preinstalled) modules, how to nd a
specic uninstalled module.
Chapter 3, Time Value of Money, introduces and discusses various basic concepts
and formulae associated with nance, such as present value of one future cash
ow, present value of (growing) perpetuity, present and future value of annuity,
perpetuity vs. perpetuity due, annuity vs. annuity due, relevant functions contained
in SciPy and numpy.lib.nancial submodule, a free nancial calculator, written in
Python, denition of NPV (Net Present Value) and its related rule, denition of IRR
(Internal Rate of Return) and its related rule, Python graphical presentation of time
value of money, and NPV prole.
Chapter 4, Sources of Data, discusses how to retrieve data from various public sources,
such as Yahoo!Finance, Google nance, FRED (Federal Reserve Bank's Economics
Data Library), Prof. French's Data Library, BLS (Bureau of Labor Statistics) and
Census Bureau. In addition, it would discuss various methods to input data, such as
les with formats of csv, txt, pkl, Matlab, SAS or Excel.
Chapter 5, Bond and Stock Valuation, introduces interest rate and its related concepts,
such as APR (Annual Percentage Rate), EAR (Effective Annual Rate), compounding
frequency, how to convert one effective rate to another one, the term structure of
interest rate, how to estimate the selling price of a regular bond, how to use the so-
called discount dividend model to estimate the price of a stock and so on.
Chapter 6, Capital Asset Pricing Model, shows how to download data from
Yahoo!Finance in order to run a linear regression for CAPM, rolling beta, several
Python programs to estimate beta for multiple stocks, adjusted beta and portfolio
beat estimation, two beta adjustment methods by Scholes and Williams (1977)
Dimson (1979).
Chapter 7, Multifactor Models and Performance Measures, shows how to extend the
single-factor model, described in Chapter 6, Capital Asset Pricing Model, to multifactor
and complex models such as the Fama-French three-factor model, the Fama-French-
Carhart four-factor model, and the Fama-French ve-factor model, and performance
measures such as the Sharpe ratio, Treynor ratios, Sortino ratio, and Jensen's alpha.
剩余585页未读,继续阅读
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)