首页 >
> 详细

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

- Stat 429作业代做、代写mathematics课程作业、代做r编程语言 2019-11-18
- 代做431 Quiz 2作业、R编程设计作业调试、R语言作业代写、代做dat 2019-11-18
- 代写mt5761留学生作业、代做statistical Modelling作 2019-11-18
- Stata留学生作业代写、代做domco2opop 语言作业、Stata编程 2019-11-17
- 代做mast 397B作业、代写r语言留学生作业、代做sas语言作业、代写s 2019-11-17
- 代做comp25216作业、代写network Analysis留学生作业、 2019-11-17
- 代做comp 2406作业、代写json留学生作业、代做html/Mongo 2019-11-17
- 代写comp 250作业、代做java编程设计作业、代写kdtree课程作业 2019-11-17
- 代做vizdoom Game Engine作业、代写 Fps留学生作业、代做 2019-11-17
- Server作业代写、代tcp Connection编程作业、代写ip/Tc 2019-11-17
- 代写ict638留学生作业、代写mobile App作业、代做 .Net语言 2019-11-17
- 代写nodes And Edges作业、代做java程序语言作业、代写pyt 2019-11-16
- Data/Prod作业代做、代写python编程设计作业、代做java/C+ 2019-11-16
- Data Programming作业代写、代做canopy留学生作业、Pyt 2019-11-16
- 代做data Outputs作业、Csv Format作业代写、R程序语言作 2019-11-16
- 代做virtual Disk作业、C/C++程序语言作业调试、C/C++实验 2019-11-16
- 代写comp222作业、代做ca Assignment作业、代做python 2019-11-16
- Cmpt 300作业代做、代写operating Systems作业、C/C 2019-11-16
- Data Visualisation And Analytics Assi... 2019-11-15
- Block Breaker Assignment Game Engine ... 2019-11-15