首页 >
> 详细

Nov. 11th, 2019

Question 1 (50 Points)

In this exam, we want to replicate the S&P 500 Index based on two different data sets using linear regression

model. The final goal is comparing the performance between two models and figure out which model gives

you the best simulation.

For your convenience, I already pick some of the equities and put them into two different groups, they

are:

• Group 1: XLE, XLF, XLK, XLV, XLB

• Group 2: GOOG, MSFT, BAC, JPM, XOM, CVX, JNJ, PFE, AAPL, NKE

1. Download 2 year length of data as training data sets. Another half year as testing data sets. In the

end, you need to calculate daily return (either type) for all data you downloaded.

2. For Model 1, you are required to use all equities in Group 1. Group 2 has 10 tickers in total. Therefore,

you may want to simplify your model. The method to simply your model is based on your preference.

In the end, name this model as Model 2.

3. Which model has better performance based on the training data set? Explain your result.

4. Now let’s compare the model performance based on testing data set. Generate a single line chart which

shows three lines in total (result from Model 1, result from model 2, S&P 500 performance). Your

X-axis should be a time line. You need to include X-label, Y-label, title, legend and etc.

5. Based on the result from Step 4, which model has better performance? Which model is more risky

when using?

Question 2 (30 Points)

In this question, you are required to create a self-defined function. The final output should be a report which

details all qualified prime numbers you have found. Please keep in mind:

• You can ONLY use system library (default library when installing the R) to solve this

question

• You can not use any existed functions/library during calculation, including system library.

For your convenience, I will highlight calculation part with blue letters.

Here is the detailed requirement for this function:

1. The input of this function has to be a numeric vector. Other than this format, you need to stop this

function and return me an error message.

2. For each number inside this vector (let’s call it target number), find out all prime numbers which can

divide the target number without reminders.

3. Based on the prime numbers you find, further decompose the target number into the product of a

sequence of prime numbers. Summarize your result into two parts: prime number and the corresponding

power.

4. You need to return a table which record all result.

Example:

> f i n d . prime ( c ( 8 , 9 , 3 6 , 3 7 ) )

Target number Prime number C o r re sp ondin g power

[ 1 , ] 8 2 3

[ 2 , ] 9 3 2

[ 3 , ] 36 2 2

[ 4 , ] 36 3 2

[ 5 , ] 37 37 1>

Question 3: (20 Points)

In this question, you are required to create a self-defined function. The final goal is identifying whether two

input triangles are identical (Under two dimensions). Detailed information are the following:

• For this function, your input should be the coordinate for two triangles

• For this function, your output should be a True or False judgment (minimum requirement)

• We define the identical triangles as the following: If the two input triangle match each

other perfectly after translation and rotation, they are identical triangles

• You can ONLY use system library (default library when installing the R) to solve this

question

• You need to finish Question 1 at least before solving this Bonus.

Grading details:

1. Return the correct judgement.

2. Besides the final statement (True or False), you also need to plot these two triangles.

3. Fill two triangles with different colors.

联系我们

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

- 代写econ426留学生作业、代做monetary Economics作业、 2020-02-28
- Anlt 207作业代写、代写python实验作业、代做analysis课程 2020-02-28
- Csci 4152作业代做、代写computer Science作业、Pyt 2020-02-28
- 代写comp 4200/5430作业、代做data课程作业、代写python 2020-02-28
- 代做se 3314B留学生作业、代做java编程语言作业、代写python， 2020-02-28
- Iy2840留学生作业代做、代写threat Detection作业、代写r 2020-02-28
- Q-Learning作业代做、代写python课程作业、代做network作 2020-02-28
- 代写mixed Models作业、Python编程语言作业调试、Java，C 2020-02-28
- 代写comp 250作业、代做java编程设计作业、代写java语言作业、代 2020-02-28
- Algorithm留学生作业代做、代写python语言作业、代做data课程 2020-02-28
- Comp 2406作业代做、Java编程语言作业调试、代写java实验作业、 2020-02-26
- 代写data留学生作业、代做program课程作业、代写java，C/C++ 2020-02-26
- 代做ubgmw9-15-3作业、代写matlab实验作业、代做civil E 2020-02-25
- 代做comp 2406作业、代写java语言作业、代做programming 2020-02-25
- 代做openmp留学生作业、代写system课程作业、代做c/C++实验作业 2020-02-24
- Cs 5100作业代写、Prolog Program作业代做、代写pytho 2020-02-24
- 代做programming作业、代写c++语言作业、C++编程设计作业调试、 2020-02-24
- Program 1 Ics-33: Intermediate Program... 2020-02-23
- Masters Programmes In Communicationsso... 2020-02-23
- Mech 203 Week 4 2020-02-23