精品深夜AV无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕

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无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕
    <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
    <ul id="e4iaa"></ul>
    <blockquote id="e4iaa"><tfoot id="e4iaa"></tfoot></blockquote>
    • <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
      <ul id="e4iaa"></ul>
      <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp><ul id="e4iaa"></ul>
      <ul id="e4iaa"></ul>
      <th id="e4iaa"><menu id="e4iaa"></menu></th>
      欧美色图天堂网| 波多野结衣91| 亚洲成年人网站在线观看| 国产欧美日本一区视频| 久久亚洲精华国产精华液| 久久在线免费观看| 久久亚洲影视婷婷| 国产欧美一区二区精品性色超碰| 亚洲精品一区二区三区精华液| 欧美r级电影在线观看| 久久先锋资源网| 国产精品天天摸av网| 亚洲同性同志一二三专区| 中文字幕制服丝袜成人av| 日韩美女啊v在线免费观看| 一区二区三区免费看视频| 一个色妞综合视频在线观看| 亚洲成a人片综合在线| 久久精品国产99| 国产+成+人+亚洲欧洲自线| 成人精品电影在线观看| 欧美偷拍一区二区| 日韩精品一区二区三区中文不卡| 久久久久国产精品厨房| 亚洲精品日韩综合观看成人91| 亚洲成人精品影院| 国产高清成人在线| 欧美三级日本三级少妇99| 欧美va日韩va| 一区二区三区在线观看欧美| 久久爱www久久做| 91在线码无精品| 精品久久久久一区二区国产| 国产精品视频一二| 日韩av电影天堂| av资源站一区| 欧美www视频| 亚洲超碰精品一区二区| 夫妻av一区二区| 日韩欧美亚洲国产精品字幕久久久| 国产欧美日韩视频在线观看| 天堂午夜影视日韩欧美一区二区| 国产高清无密码一区二区三区| 精品视频1区2区| 亚洲欧洲三级电影| 国产真实乱子伦精品视频| 欧美日韩一区二区在线观看| 国产日韩欧美综合在线| 日韩高清一区在线| 欧洲一区二区三区在线| 国产网站一区二区三区| 美女在线视频一区| 欧美日韩成人在线| 亚洲综合网站在线观看| 风间由美性色一区二区三区| 日韩免费高清av| 天堂午夜影视日韩欧美一区二区| 色呦呦一区二区三区| 欧美国产乱子伦| 国产精品亚洲成人| ww亚洲ww在线观看国产| 久久精品免费观看| 91精品在线观看入口| 亚洲一区影音先锋| 91久久精品国产91性色tv| 国产精品色呦呦| 国产精品一区二区视频| 久久免费国产精品| 国产精品自拍网站| 国产日本欧美一区二区| 国产一区二区中文字幕| 精品久久久网站| 国产尤物一区二区| 国产日韩精品视频一区| 国产成人免费在线视频| 久久精品视频免费观看| 国产成人av电影在线播放| 久久精品视频在线免费观看| 国产成人av一区二区三区在线| 久久品道一品道久久精品| 国产成人免费视频网站高清观看视频 | 成人免费在线播放视频| gogogo免费视频观看亚洲一| 国产精品拍天天在线| 不卡的av电影| 亚洲综合色视频| 91麻豆精品国产91久久久| 美女视频网站黄色亚洲| 久久久精品中文字幕麻豆发布| 国产河南妇女毛片精品久久久 | 亚洲高清不卡在线观看| 欧美人狂配大交3d怪物一区| 麻豆成人免费电影| 欧美国产欧美亚州国产日韩mv天天看完整| av不卡免费电影| 亚洲电影视频在线| 久久先锋影音av鲁色资源网| 高清成人免费视频| 亚洲一区二区在线免费看| 日韩欧美一区二区视频| 成人性生交大片免费看在线播放| 亚洲人成精品久久久久| 欧美顶级少妇做爰| 国产a视频精品免费观看| 亚洲小说欧美激情另类| 精品国产三级a在线观看| 成人av在线影院| 男女视频一区二区| 国产精品美女久久久久久| 欧美高清视频一二三区| 国产精品一级片| 日韩av二区在线播放| 国产精品成人午夜| 精品粉嫩aⅴ一区二区三区四区 | 日韩限制级电影在线观看| 成人avav影音| 美女视频一区二区三区| 亚洲精品v日韩精品| 久久久亚洲国产美女国产盗摄| 在线观看欧美精品| 国产91精品一区二区麻豆亚洲| 天天亚洲美女在线视频| 亚洲黄色录像片| 国产午夜亚洲精品不卡| 欧美一区二区播放| 91国产精品成人| 99久久99久久精品免费观看| 玖玖九九国产精品| 日韩av在线免费观看不卡| 亚洲欧美国产高清| 国产精品亲子伦对白| 精品国产免费视频| 日韩欧美国产综合| 欧美高清激情brazzers| 色av一区二区| 91国偷自产一区二区开放时间| 国产电影精品久久禁18| 久久国产欧美日韩精品| 天涯成人国产亚洲精品一区av| 亚洲人吸女人奶水| 中文字幕亚洲一区二区av在线| 久久精品男人天堂av| 久久综合久久综合九色| 精品理论电影在线观看| 日韩精品一区二区三区视频播放| 欧美二区三区91| 日韩一区二区电影在线| 欧美一区二区视频在线观看2020| 欧美福利一区二区| 欧美精品精品一区| 日韩欧美成人一区| 久久伊99综合婷婷久久伊| 精品日韩在线观看| 久久精品夜色噜噜亚洲aⅴ| 国产亚洲污的网站| 中文一区二区在线观看| 中文字幕av一区 二区| 国产精品女主播av| 亚洲精品日产精品乱码不卡| 亚洲中国最大av网站| 日韩国产精品久久| 久久91精品国产91久久小草| 国精产品一区一区三区mba桃花| 国产福利一区在线观看| 成人av免费网站| 在线日韩av片| 日韩精品一区二区三区三区免费| 久久先锋影音av鲁色资源网| 国产精品久久久久四虎| 亚洲午夜在线电影| 人人狠狠综合久久亚洲| 国产盗摄女厕一区二区三区| av在线不卡免费看| 777午夜精品免费视频| 亚洲精品一区二区三区99| 成人欧美一区二区三区视频网页| 一区二区三区在线不卡| 蜜桃免费网站一区二区三区| 成人国产免费视频| 欧美剧情电影在线观看完整版免费励志电影 | 成人a免费在线看| 欧美在线免费播放| 日韩美女一区二区三区四区| 亚洲国产精品二十页| 亚洲一区二区中文在线| 国产福利一区二区三区| 欧美午夜精品久久久久久超碰| 欧美成人综合网站| 一区二区三区小说| 国产一区二区久久| 欧美日本一区二区三区| 国产精品每日更新在线播放网址| 亚洲1区2区3区4区| av中文一区二区三区| 日韩欧美国产一二三区| 亚洲最大的成人av| 粉嫩嫩av羞羞动漫久久久| 69成人精品免费视频| 综合久久国产九一剧情麻豆| 国产精品一线二线三线精华|