联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2022-12-07 09:33

MSBA7021 Prescriptive Analytics

Background

In order to mitigate risk while ensuring a reasonable level of return, investors purchase

a variety of securities and combine these into an investment portfolio

2 / 68

Securities often change together with some classes of securities, and in the opposite

direction of other classes of securities

A portfolio that contains many positively correlated securities is more risky (and

potentially more rewarding) than one that contains a mix of positively and negatively

correlated securities

3 / 68

Goals

Most investors have two goals in forming portfolios:

to obtain a large expected return, and

to obtain a small variance (to minimize risk)

At a given expected return, there is one portfolio which has the lowest risk

The risk-return characteristics of a portfolio change in a nonlinear fashion

4 / 68

Index vs. active funds

Index Fund Active Fund

Goal

Match the performance of a specic

market benchmark or "index" (e.g.

S&P500) as closely as possible

Outperform its benchmark

Strategy

Buys all (or a representative sample) of

the stocks or bonds in the index it's

tracking

Uses the portfolio manager's deep

research and expertise to hand-select

stocks or bonds for the fund

Risk

Aligns directly to the risks involved with

the specic stock or bond market the

fund tracks

Adds the risk that the portfolio

manager may underperform its

benchmark

5 / 68

6 / 68

7 / 68

Asset

Asset: an investment instrument that can be bought and sold

Suppose we invest into an asset now and sell it some time later, receiving X

0

X

t

total return = R =

rate of return = r =

It is sometimes possible to sell an asset that you do not own through the process of

short selling the asset

Borrow the asset from someone (the lender) who owns it

Sell the borrowed asset to someone else, receiving an amount

At a later date, purchase the asset for and return it to the lender

Short selling is protable if the asset price declines

If , you'll make a prot of

Note: Short selling is quite risky

The potential loss is unlimited: can increase arbitrarily so can the loss

Short selling is forbidden or supplemented by restrictions within certain nancial

institutions

Suppose we invest to form a portfolio of different assets

The amount invested in the th asset is

Dene as the fraction of asset in the portfolio:

If short selling is allowed, then some of the 's can be negative

Date AAPL AXP BA CAT CSCO CVX DIS GE

5087 22/3/2018 165.6652 89.7283 311.6044 142.5569 41.5126 108.4317 99.0218 12.5799 171

5088 23/3/2018 161.8289 88.7860 312.9596 140.0241 40.8861 107.7451 96.9941 12.3160 167

5089 26/3/2018 169.5112 90.9160 320.7300 144.7792 42.4668 110.0053 99.0710 12.1464 172

5090 27/3/2018 165.1648 89.7381 313.0766 142.6442 41.1367 109.3472 97.8012 12.6647 170

5091 28/3/2018 163.3399 90.5136 312.0042 140.8684 40.1536 106.9059 96.9941 12.8908 170

5 rows × 21 columns

14 / 68

import plotly.express as px

import plotly.io as pio

pio.templates.default = 'plotly_white'

S_melt = S.melt(id_vars = 'Date', var_name = 'Stock', value_name = 'Price')

fig_price = px.line(S_melt, x = 'Date', y = 'Price', color = 'Stock', height = 600)

fig_price.update_layout(xaxis_title = '')

15 / 68

Computing stock returns

Let denote the price of stock at time

Let denote the rate of return of asset from time to time

stocks = S.columns[1:]

tmp = S[stocks]

ret = (tmp.diff()[1:] /tmp.shift(1)[1:])

ret = pd.concat([S['Date'][1:], ret], axis=1)


相关文章

版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp