Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

ESYE501 Optional Final Problem Set Problem 1: Below is the USD/TRY conversion rates for April and May XXXXXXXXXXIt will prove practical to use the date number as your independent variable rather than...

1 answer below »
ESYE501 Optional Final Problem Set
Problem 1:

Below is the USD/TRY conversion rates for April and May XXXXXXXXXXIt will prove practical to use the
date number as your independent variable rather than the date.)

(a) Get the data into R.
(b) Plot the data.
(c) Choose a reasonable polynomial to fit the data.
(d) Predict the price of the US Dollars on election day, June 24th.

Hints in R:

lm() is the function to use for regression. Although the name is 
“linear model”, it can be used for general regression. 
 
Try the following commands: 
 
x <- c(1, 2, 3, 4, 5) ​x values 
y <- c(1.5, 2.1, 3.7, 4.2, 5.5) ​y values 
z <- data.frame(x) ​create a data frame 
Z ​see what it looks like 
z$y <- y ​add the values column 
Z ​look at it again 
model <- lm(y ~ x, data=z) ​linear model, y “described by” x   
summary(model) ​see model parameters 
model2 <- lm(y ~ poly(x, 2), data=z) ​quadratic model 
summary(model2) ​see model parameters 
 

The data (real!):

Day Number Date XXXXXXXXXXPrice
2 02-Apr XXXXXXXXXX
3 03-Apr XXXXXXXXXX
4 04-Apr XXXXXXXXXX
5 05-Apr XXXXXXXXXX
6 06-Apr XXXXXXXXXX
9 09-Apr XXXXXXXXXX
10 10-Apr XXXXXXXXXX
11 11-Apr XXXXXXXXXX
12 12-Apr XXXXXXXXXX
13 13-Apr XXXXXXXXXX
16 16-Apr XXXXXXXXXX
17 17-Apr XXXXXXXXXX
18 18-Apr XXXXXXXXXX
19 19-Apr XXXXXXXXXX
20 20-Apr XXXXXXXXXX
23 23-Apr XXXXXXXXXX
24 24-Apr XXXXXXXXXX
25 25-Apr XXXXXXXXXX
26 26-Apr XXXXXXXXXX
27 27-Apr XXXXXXXXXX
30 30-Apr XXXXXXXXXX
31 01-May XXXXXXXXXX
32 02-May XXXXXXXXXX
33 03-May XXXXXXXXXX
34 04-May XXXXXXXXXX
37 07-May XXXXXXXXXX
38 08-May XXXXXXXXXX
39 09-May XXXXXXXXXX
40 10-May XXXXXXXXXX
41 11-May XXXXXXXXXX
44 14-May XXXXXXXXXX
45 15-May XXXXXXXXXX
46 16-May XXXXXXXXXX
47 17-May XXXXXXXXXX
48 18-May XXXXXXXXXX
51 21-May XXXXXXXXXX

Problem 2:
Below is a table of x and y values.

(a) Get the data into R
(b) Plot the data
(c) Peform regression analysis to find a good fit for the data.


x y
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
Answered Same Day May 22, 2020

Solution

Pooja answered on May 23 2020
152 Votes
1)
a)
    > x <- c(2,3,4,5,6,9,10,11,12,13,16,17,18,19,20,23,24,25,26,27,30,31,32,33,34,37,38,39,40,41,44,45,46,47,48,51)

y <- c(3.9735, 3.9887,3.9991, 4.0515, 4.0449, 4.0737, 4.1121, 4.136, 4.1102, 4.0969, 4.0963, 4.0963, 4.0086, 4.0403, 4.0766,
+ 4.1079, 4.086, 4.0809, 4.0664, 4.0422, 4.0617, 4.103, 4.1771, 4.2131, 4.226, 4.2669,
+ 4.3327, 4.2876, 4.2352, 4.3136, 4.3674, 4.445, 4.4139, 4.4606, 4.4917, 4.5774)

z <- data.frame(x)
z$y <- y
z
x y
1 2 3.9735
2 3 3.9887
3 4 3.9991
4 5 4.0515
5 6 4.0449
6 9 4.0737
7 10 4.1121
8 11 4.1360
9 12 4.1102
10 13 4.0969
11 16 4.0963
12 17 4.0963
13 18 4.0086
14 19 4.0403
15 20 4.0766
16 23 4.1079
17 24 4.0860
18 25 4.0809
19 26 4.0664
20 27 4.0422
21 30 4.0617
22 31 4.1030
23 32 4.1771
24 33 4.2131
25 34 4.2260
26 37 4.2669
27 38 4.3327
28 39 4.2876
29 40 4.2352
30 41 4.3136
31 44 4.3674
32 45 4.4450
33 46 4.4139
34 47 4.4606
35 48 4.4917
36 51 4.5774
    
        >
)
li
ary(Publish)
li
ary(dplyr)
plot(x, y,
+ xlab="day",
+ ylab="price", main="Scatter Plot")
There is a fluctuating trend from day 2 co
esponding to 02-Apr-18 till day 30 co
esponding to 30-Apr-18. After day 30 which co
esponds to date 30-Apr-18, there is a continuous rising trend in the price till day 51 co
esponding to date 21-May-18.
c)
model <- lm(y ~ x, data=z)
summary(model)
Call:
lm(formula = y ~ x, data = z)
Residuals:
Min 1Q Median 3Q Max
-0.152626 -0.059618 ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here