美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇

AcF633代做、Python設計編程代寫

時間:2024-03-04  來源:  作者: 我要糾錯



AcF633 - Python Programming for Data Analysis
Manh Pham
Group Project
21st February 2024 noon/12pm to 6th March 2024 noon/12pm (UK time)
This assignment contains one question worth 100 marks and constitutes 35% of the
total marks for this course.
You are required to submit to Moodle a SINGLE .zip folder containing a single
Jupyter Notebook .ipynb file (preferred) and/or Python script .py files and supporting .csv files (e.g. input data files, if any), together with a signed group coversheet. The name of this folder must be your group number (e.g. Group1.zip,
where Group 1 is your group).
In your main script, either Jupyter Notebook .ipynb file or Python .py file, you do
not have to retype the question for each task. However, you must clearly label
which task (e.g. 1.1, 1.2, etc) your subsequent code is related to, either by using a
markdown cell (for .ipynb files) or by using the comments (e.g. #1.1 or ‘‘‘1.1’’’
for .py files). Provide only ONE answer to each task. If you have more than one
method to answer a task, choose one that you think is best and most efficient. If
multiple answers are provided for a task, only the first answer will be marked.
Your submission .zip folder MUST be submitted electronically via Moodle by the
6th March 2024 noon/12pm (UK time). Email submissions will NOT be considered. If you have any issues with uploading and submitting your group work to
Moodle, please email Carole Holroyd at c.holroyd@lancaster.ac.uk BEFORE the
deadline for assistance with your submission.
Only ONE of the group members is required to submit the work for your group.
The following penalties will be applied to all coursework that is submitted after the
specified submission date:
Up to 3 days late - deduction of 10 marks
Beyond 3 days late - no marks awarded
Good Luck!
1
Question 1:
The Dow Jones Industrial Average (DJIA) index is a price-weighted index of 30
blue-chip stocks listed in the US stock exchanges. The csv data file ‘DowJonesFeb2022.csv’ lists the constituents of the DJIA Index as of 9 February 2022 with the
following information:
ˆ Company: Name of the company
ˆ Ticker: Company’s stock symbol or ticker
ˆ Exchange: Exchange where the company’s stock is listed
ˆ Sector: Sector in which the company belongs
ˆ Date added: Date when the company was added to the index
ˆ Weighting: Weighting (in percentages) of the company in the index.
Import the data file to an object called “Index” in Python and perform the following
tasks.
Task 1: Descriptive Analysis of DJIA index (Σ = 20 marks)
1.1: How many unique sectors are there in the DJIA index? Print the following
statement: ‘There are ... unique sectors in the DJIA index, namely ...’, where
the first ‘...’ is the number of unique sectors, and the second ‘...’ contains the
names of the sectors alphabetically ordered and separated by commas. (3 marks)
1.2: Write code to create a dictionary with keys being the unique sectors in the
DJIA index sorted in alphabetical order, and and values being tuples of two
elements: the first being the number of tickers in each sector, and the second
being the list of alphabetically ordered tickers in each sector.
Hint: An example of a key-value pair of the required dictionary is ‘Materials’:
(1,[‘DOW’]). (3 marks)
1.3: Write code to find the company having the largest index weight and one
with the smallest weight. Print the following statements:
Company ... (ticker ..., sector ..., exchange ...) has the largest index weight of
...%.
Company ... (ticker ..., sector ..., exchange ...) has the smallest index weight
of ...%.
The range of the weights is ...%. (4 marks)
1.4: Write code to find the company having the longest history in the index and
the one with the shortest history. Print the following statements:
Company ... (ticker ..., sector ..., exchange ...) has the longest history in the
DJIA index, added to the index on ....
Company ... (ticker ..., sector ..., exchange ...) has the shorted history in the
DJIA index, added to the index on .... (4 marks)
1.5: Write code to produce the following pie chart that shows the DJIA index
weighting by sectors.
2
Print the following statement:
Sector ... has the largest index weight of ...%, and Sector has the smallest
index weight of ...%. (6 marks)
Task 2: Portfolio Allocation (Σ = 35 marks)
2.1: Using the order of your group letter in the alphabet (e.g. 1 for A, 2 for B,
etc.) as a random seed, draw a random sample of 5 stocks (i.e. tickers) from the
DJIA index excluding stock DOW.1 Sort the stocks in alphabetical order, and
then import daily Adjusted Close (Adj Close) prices for the 5 stocks between
01/01/2009 and 31/12/2023 from Yahoo Finance. Compute the simple daily
returns for the stocks and drop days with NaN returns. (3 marks)
2.2: Create a data frame to summarize key statistics (including sample size,
mean, standard deviation, minimum, quartiles, maximum, skewness, kurtosis,
Jarque-Bera statistic, Jarque-Bera pvalue and whether the data is normal) for
the daily returns of the five stocks over the above sample period. Jarque-Bera
statistic is the statistic for the Jarque-Bera normality test that has the formula
JB =
T
6

Sb2 +
(Kb − 3)2
4
!
, where T is the sample size, Sb and Kb are sample
skewness and kurtosis of data, respectively. Under the null hypothesis that
data is normally distributed, the JB statistic follows a χ
2 distribution with 2
degrees of freedom. Jarque-Bera pvalue is the pvalue of the JB statistic under
this χ
2 distribution. ‘Normality’ is a Yes/No indicator variable indicating if
data is normally distributed based on Jarque-Bera test.
Your data frame should look similar to the one below, but for the five stocks
in your sample.
1DOW only started trading on 20/03/2019. 3
(4 marks)
2.3: Write code to plot a 2-by-5 subplot figure that includes:
Row 1: Time series plots for the five stocks’ returns
Row 2: The histograms, together with kernel density estimates, for the five
stocks’ returns (3 marks)
2.4: Using and/or modifying function get efficient frontier() from the file
Eff Frontier functions.py on Moodle, construct and plot the Efficient Frontier for the five stocks based on optimization using data over the above period. In your code, define an equally spaced range of expected portfolio return
targets with 2000 data points. Mark and label the locations of the five stocks
in the Efficient Frontier plot. Also mark and label the locations of the Global
Minimum Variance portfolio and the portfolio with the largest Sharpe ratio,
assuming the annualized risk-free rate is 0.01 (or 1%).2
(6 marks)
2.5: What are the return, volatility, Sharpe ratio and stock weights of the portfolio with the largest Sharpe ratio? Write code to answer the question and
store the result in a Pandas Series object called LSR port capturing the above
statistics in percentages. Use the words ‘return’, ‘volatility’, ‘Sharpe ratio’,
and stock tickers (in alphabetical order) to set the index of LSR port. (4 marks)
2.6: Alice is interested in the five stocks in your sample. She is a mean-variance
optimizer and requires the expected return of her portfolio to be the average
of the expected returns of the five individual stocks.3 Suppose that Alice does
not have access to a risk-free asset (i.e. she cannot lend or borrow money
at the risk-free rate) and she would like to invest all of her wealth in the five
stocks in your sample. How much, in percentages of her wealth, should Alice
invest in each of the stocks in your sample? Write code to answer the question
and store the result in a Pandas Series object called Alice port respectively
2This equals the average of the risk-free rates over the sample period.
3Use the average return of a stock over the considered sample as a proxy for its expected return. 4
capturing the return, volatility, Sharpe ratio and the stock weights of Alice’s
portfolio. Set the index of Alice port correspondingly as in Task 2.5. (4 marks)
2.7: Paul, another mean-variance optimizer, is also interested in the five stocks
in your sample. He has an expected utility function of the form U(Rp) =
E(Rp) − 2σ
2
p
, where Rp and σ
2
p are respectively the return and variance of the
portfolio p. Also assume that Paul does not have access to a risk-free asset
(i.e. he cannot lend or borrow money at the risk-free rate) and he would like
to invest all of his wealth in the five stocks in your sample. How much, in
percentages of his wealth, should Paul invest in each of the stocks in your
sample to maximize his expected utility? Write code to answer the question
and store the result in a Pandas Series object called Paul port respectively
capturing the return, volatility, Sharpe ratio and the stock weights of Paul’s
portfolio. Set the index of Paul port correspondingly as in Task 2.5. (4 marks)
2.8: Now suppose that both Alice and Paul have access to a risk-free asset and
they can borrow and lend money at the risk-free rate. In this case, both will
choose the efficient risky portfolio with the largest Sharpe ratio in Task 2.5 as
their optimal risky portfolio and will divide their wealth between this optimal
portfolio and the risk-free asset to achieve their objectives. They could also
borrow money (i.e. have a negative weight on the risk-free asset, which is
assumed to be capped at -100%; that is, the maximum amount that they can
borrow is equal to their wealth) to invest more in the risky assets. What
will be their portfolio compositions in this case? Write code to answer the
question and store the results in Pandas Series objects called Alice port rf
and Paul port rf capturing the return, volatility, Sharpe ratio, the stock
weights and risk-free asset weight of Alice’s and Paul’s portfolios, respectively.
Set the index of Alice port rf and Paul port rf correspondingly as in Task
2.5. (7 marks)
Task 3: Factor models (Σ = 25 marks)
3.1: Denote P be the portfolio formed by combining the five stocks in your
sample using equal weights. Compute the daily returns of the portfolio P
over the considered time period from 01/01/2009 to 31/12/2023. (3 marks)
3.2: Using data from the Fama-French dataset, estimate a Fama-French fivefactor model for portfolio P over the above period. Test if portfolio P possesses
any abnormal returns that cannot be explained by the five-factor model. (4 marks)
3.3: Conduct the White test for the absence of heteroskedasticity in the residuals
of the above factor model and draw your conclusion using a 5% significance
level. (3 marks)
3.4: Conduct the Breusch-Godfrey test for the absence of serial correlation up
to order 10 in the residuals of the above factor model and draw your conclusion
using a 5% significance level. (3 marks)
3.5: Based on results in the above two tasks, update the Fama-French five-factor
regression model and re-assess your conclusion on the pricing of portfolio P
according to the five-factor model in Task 3.2. (3 marks)
5
3.6: Compute the 3-year rolling window β estimates of the Fama-French five
factors for portfolio P over the sample period. That is, for each day, we
compute β loadings for the five factors using the past 3-year data (including
data on that day). Plot a figure similar to the following for your stock sample,
showing the rolling window β estimates of the five factors, together with 95%
confidence bands. Provide brief comments. (9 marks)

Rolling CMA for portfolio P
(Σ = 20 marks)
Task 4: These marks will go to programs that are well structured, intuitive to use
(i.e. provide sufficient comments for me to follow and are straightforward for
me to run your code), generalisable (i.e. they can be applied to different sets of
stocks, different required rates of return for Alice or different utility functions
for Paul with minimal adjustments/changes to the code) and elegant (i.e. code
is neat and shows some degree of efficiency).
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:CS5012代做、代寫Python設計程序
  • 下一篇:代寫DTS304TC、代做Java/c++程序語言
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    美女扒开腿免费视频_蜜桃传媒一区二区亚洲av_先锋影音av在线_少妇一级淫片免费放播放_日本泡妞xxxx免费视频软件_一色道久久88加勒比一_熟女少妇一区二区三区_老司机免费视频_潘金莲一级黄色片_精品国产精品国产精品_黑人巨大猛交丰满少妇
    av最新在线观看| a视频免费观看| 影音先锋黄色资源| 成人区人妻精品一区二| 国产伦精品一区三区精东| www色com| 亚洲成人生活片| 在线 丝袜 欧美 日韩 制服| 日韩精品无码一区二区三区久久久| 自拍偷拍你懂的| 星空大象在线观看免费播放| 成年人在线免费看片| 日本a级片视频| 一级黄色片网址| 一级黄色免费毛片| 少妇高潮惨叫久久久久| av在线网站观看| theav精尽人亡av| 国产熟妇久久777777| 精品人妻无码一区二区三区换脸| 91精品小视频| 69视频在线观看免费| 国产成人精品视频免费| 国产特级黄色录像| 黄免费在线观看| 四虎免费在线视频| 国产高潮视频在线观看| 一级片手机在线观看| 精品人体无码一区二区三区| 性欧美videos| 99久久久无码国产精品性波多| 91精品国产自产| 精品在线观看一区| 亚洲一级av无码毛片精品| 在线观看国产精品一区| 性欧美videos| 国产美女喷水视频| 天天色天天综合| 久久无码人妻精品一区二区三区| 五月婷婷婷婷婷| 国产精品久久久久久久无码| 久久久免费看片| 97人妻精品一区二区三区免 | 欧美人与禽zoz0善交| 国产精品无码99re| 人人妻人人澡人人爽| 国产真实乱人偷精品| 日本55丰满熟妇厨房伦| 国产真人真事毛片视频| 亚州av综合色区无码一区| 99久久精品久久亚洲精品| 国产精品天天干| 国精品人伦一区二区三区蜜桃| 欧美熟妇精品一区二区| 亚洲区自拍偷拍| 午夜av免费看| 亚洲 欧美 日韩在线| 中文字幕av一区二区三区人妻少妇 | 成人欧美精品一区二区| 国产又粗又长免费视频| 久久无码人妻精品一区二区三区| 国精产品一区一区二区三区mba| 午夜理伦三级做爰电影| 亚洲精品视频大全| 在线免费观看成年人视频| 亚洲天堂2024| 涩视频在线观看| 年下总裁被打光屁股sp| 极品白嫩的小少妇| 中文字幕99页| 白丝女仆被免费网站| 三级男人添奶爽爽爽视频| 亚洲一区二区三区无码久久| 亚洲国产精品自拍视频| 精品无码国产污污污免费网站| av直播在线观看| 97在线观看免费视频| 国产破处视频在线观看| 91视频青青草| 国产亚洲精品成人a| 国产精品一区二区人妻喷水| 日韩网站在线播放| 蜜桃精品成人影片| 懂色av粉嫩av浪潮av| 亚洲精品国产精品乱码在线观看| 亚洲一区电影在线观看| 黄色a级片在线观看| 在线看黄色的网站| 91l九色lporny| 精品人妻一区二区三| 国产51自产区| 男人的天堂av网| 国产精品理论在线| 国产精品白嫩白嫩大学美女| 国产伦理在线观看| 偷拍夫妻性生活| 三级网站免费看| 阿v天堂2014| 欧美成人精品一区二区综合免费| 青青草视频成人| 极品久久久久久| 国产精品久久久久久久av| 免费观看一区二区三区| 老头老太做爰xxx视频| 女同性αv亚洲女同志| 日本美女bbw| 人体私拍套图hdxxxx| av成人免费网站| 中国女人特级毛片| 国产 xxxx| 91成人福利视频| 成人片黄网站色大片免费毛片| 巨乳女教师的诱惑| 欧美做爰啪啪xxxⅹ性| 变态另类ts人妖一区二区| 中文字幕人妻一区| 国产ts在线观看| 中文字幕第六页| 国产又色又爽又高潮免费| 无码人妻aⅴ一区二区三区| 亚洲少妇一区二区| 国产成人av免费观看| 一级黄色免费毛片| 欧美做爰啪啪xxxⅹ性| 日本 欧美 国产| 欧美aaa级片| 少妇视频在线播放| 欧美大波大乳巨大乳| 中文字幕人妻一区二区| 人妻av一区二区| 白嫩情侣偷拍呻吟刺激 | 女性裸体视频网站| 国产精品综合激情| 日本午夜精品视频| fc2ppv在线播放| 538任你躁在线精品视频网站| 亚洲图片第一页| 唐朝av高清盛宴| 久久久久国产精品区片区无码| 林心如三级全黄裸体| 国产美女高潮视频| 国产免费无遮挡吸奶头视频| 国产女人18毛片水真多18| 99久久99久久精品免费看小说.| 四虎国产精品成人免费入口| 少妇高潮在线观看| 久操视频在线观看免费| 成人黄色a级片| 亚洲天堂网av在线| 国产免费无码一区二区视频 | 一级特黄曰皮片视频| 亚洲AV成人无码网站天堂久久| 国精产品一区一区二区三区mba| 成人羞羞国产免费图片| 国产高清成人久久| 亚洲天堂av中文字幕| 欧美性猛交xxxxx少妇| 好吊日免费视频| 小早川怜子一区二区的演员表| 亚洲av无码一区东京热久久| 欧美性猛交xxxx乱| 中文字幕99页| 欧美成人短视频| 人妻无码中文久久久久专区| 国产精品视频在| 在线免费播放av| 性色av无码久久一区二区三区| 国产伦精品一区三区精东| 91狠狠综合久久久| 免费污网站在线观看| 久久久久国产免费| 麻豆天美蜜桃91| 国产又黄又粗视频| 中出视频在线观看| 成年人小视频在线观看| 日韩av手机在线免费观看| 国产色视频一区二区三区qq号| 无码人妻丰满熟妇啪啪网站| 91麻豆免费视频网站| 国产在线免费看| 貂蝉被到爽流白浆在线观看| 一级黄色片大全| 人妻大战黑人白浆狂泄| 中文人妻一区二区三区| 一女三黑人理论片在线| 2018国产精品| 北京富婆泄欲对白| 玖玖爱在线精品视频| 无码任你躁久久久久久老妇| 欧美日韩人妻精品一区在线| 亚洲v在线观看| 欧洲一级黄色片| 中文幕无线码中文字蜜桃| 免费看黄色的视频| 成人国产精品久久久网站| 精品久久久久久中文字幕人妻最新| 亚洲第九十七页| 久久午夜福利电影| 极品色av影院| 99久久久无码国产精品性波多|