1.We need to develop an autoregression model to predict the stock price for the PRAN group. We have been given stock values for one month. Use AR (6) model for your prediction. Let’s design the AR model and measure its quality with regards to unseen test data.
a. Select first 60% data for training and 40% data for test
b. Your AR model should be as follows:
Yt+1 = c0 + c1yt-5 + c2yt-4 + c3yt-3 + c4yt-2 + c5yt-1 + c6yt
Where yt is the stock value at time t. So the future value yt+1 can be predicted using the above equation.
c. Learn the coefficients (all c’s) using the train data.
d. Use the learned coefficients to predict the stock values for the test data.
e. Plot actual stock value (red line) and predicted stock value (blue line) for the test data
f. Calculate SSE for actual stock and predicted stock values. Then calculate R2
Data:
5-Oct-2020 |
34 |
6-Oct-2020 |
67 |
7-Oct-2020 |
66 |
8-Oct-2020 |
71 |
9-Oct-2020 |
77 |
10-Oct-2020 |
79 |
11-Oct-2020 |
80 |
12-Oct-2020 |
79 |
13-Oct-2020 |
86 |
14-Oct-2020 |
88 |
15-Oct-2020 |
87 |
16-Oct-2020 |
88 |
17-Oct-2020 |
89 |
18-Oct-2020 |
92 |
19-Oct-2020 |
94 |
20-Oct-2020 |
95 |
21-Oct-2020 |
93 |
22-Oct-2020 |
96 |
23-Oct-2020 |
96 |
24-Oct-2020 |
97 |
25-Oct-2020 |
97 |
26-Oct-2020 |
99 |
27-Oct-2020 |
100 |
28-Oct-2020 |
101 |
29-Oct-2020 |
101 |
30-Oct-2020 |
102 |
31-Oct-2020 |
105 |
1-Nov-2020 |
106 |
2-Nov-2020 |
106 |
3-Nov-2020 |
110 |
4-Nov-2020 |
110 |
2. In this part, you we will fit the following two cubic polynomials p(t) and q(t) at the same time
Train data:
p(1) = 2,
p(2) = 7,
p(5) =2,
p(7) =12,
p(8) = 13,
p(10) =6,
p(17) = 6,
q(5) = 4,
q(10) = 5,
q(12) = 10,
q(10) = 8,
q(12) = 19,
p(7) = q(7),
p’(19) = q’(10),
p’’(1) = q’’(7),
Test Data:
p(6) =1,
p(10) =2,
p(18) = 30,
p(20) =36,
p(22) = 16,
q(15) = 14,
q(20) = 15,
q(22) = 29,
q(18) = 18,
a) From train data, create vandermonde matrix A. And output vector b_train
b) Use A and b_train, calculate the coefficients c_hat = [c0, c1, c2, d0, d1, d2]T. You cannot use pinv() function anyway.
c) Now you have coefficients for both polynomials.
d) Use the corresponding coefficients to calculate the predicted output p_test_hat for test input t for polynomial p. Plot actual p(t) and p_test_hat(t) for test input t
e) Use the corresponding coefficients to calculate the predicted output q_test_hat for test input t for polynomial q. Plot actual q(t) and q_test_hat(t) for test input t
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme