Computer Science - Regression Formula - Assessment Answer

Download Solution Order New Solution
Computer Science - Regression Formula - Assessment Answer
Task:

Question 1. For rolling windows of W = 5,6,...,30 trading days, consider your data for year 1 (2017). For each W in the specified range, roll through year 1.
1. Calculate the regression formula for each day
2. Determine whether the next day is Long or Short
3. Calculate the daily return and the AVERAGE daily return for year 1
4. Generate a plot:
? x-axis: values of W
? y-axis: average return
5. determine the optimal W (best average return) and discuss results

Question 2. Use the optimal W from year 1(2017) and consider year 2(2018) as described in question 1.
1. Calculate the daily regression formula and compute the value of r2 for each day.
2. Plot a graph of r2 for year 2.
3. What is the average r2.
4. How well does it explain price movements?
5. How many Long and Short days did you have in year 2?
6. What is the Average Return and Number of Days Long and Short for year 2? (that’s 4 numbers!)
7. Explain whether these results are very diferent from those in year 1 for this optimal value of W.

Coding Standard :
Python 3
we have coding/style requirements that can subtract some minor points if not met. Some of the common mistakes that I saw were:
• Having proper # line comments.
• try blocks that covered most/all of the program - they should wrap around the minimum # of lines being tested.
• try:
• df = pd.read_csv(file) #read the file as a dataframe
• except Exception as e:
• print(e)
• print('Failed to read file')
• Functions not having docstrings. Every function/class/method should have a triple-quote docstring immediate following the declaration.
• Output should be well formatted and data must be labeled.
Numbers like 12.6999999 are not acceptable. Use format() to control number formats, make columns line up, etc.
For example: print('{ :,.0f } / { :,.0f } = {:,.2f}'.format(x, y , x/y))
As to the PEP8 guidelines only 80 characters code should be present per line
• Exception handling should be proper.

This Computer Science Assessment has been solved by our Computer Science experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

 

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.