Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 : In the following marketing set, we have 9 years with the sales in 1 0 million euro and the advertising expenditure in

Question 3: In the following marketing set, we have 9 years with the sales in 10 million
euro and the advertising expenditure in million euro.
a) Formulate the response vector Y, which has nine entries.
b) Formulate the data matrix of x, the first column should be all ones corresponding to
the intercept, and the second column should be the predictors. The dimension of x should
be 92.
c) Write R code to compute xtx.
d) Write R code to compute =(xtx)-xtY. This is the estimated linear regression
coefficient of the linear model with Y as the response and x as the data matrix.
e)Run the linear regression using Y as the response and x as the predictor using lm
command in R and compare the output with your own calculation.
f) Now two additional data points arrived. They are Year 10, Sales 96, and Advertisement
53; Year 11, Sales 120, and Advertisement 63. Please use the online algorithm to update
the linear model. Use the two new observations together to perform the sequential learning
and update the model using stochastic gradient descent algorithm using the learning rate
=0.0001. Note here in the updating scheme hat()new=hat()old-gradEn, the term En will be the
sum of the squared prediction errors over the two new observations:
En=(y10-hat(y)10)2+(y11-hat(y)11)2.
In this example, we implement the online algorithm when the new data come in batches, not
one at a time.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

What other issues of merger integration may arise?

Answered: 1 week ago

Question

Deploy the tools of persuasion and advocacy

Answered: 1 week ago