Answered step by step
Verified Expert Solution
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 : In the following marketing set, we have years with the sales in million
euro and the advertising expenditure in million euro.
a Formulate the response vector which has nine entries.
b Formulate the data matrix of the first column should be all ones corresponding to
the intercept, and the second column should be the predictors. The dimension of should
be
c Write R code to compute
d Write code to compute This is the estimated linear regression
coefficient of the linear model with as the response and as the data matrix.
eRun the linear regression using as the response and as the predictor using
command in and compare the output with your own calculation.
f Now two additional data points arrived. They are Year Sales and Advertisement
; Year Sales and Advertisement 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
Note here in the updating scheme hathat the term will be the
sum of the squared prediction errors over the two new observations:
hathat
In this example, we implement the online algorithm when the new data come in batches, not
one at a time.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started