Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

x

x<-c(10,20,25,30,35,45) y<-c(13,16,14,18,16,19) x0 <- c(1,1,1,1,1,1) X<-data.frame(list(x0=x0,x=x)) X<-as.matrix(X) n<-nrow(X) p<-ncol(X) X #Computing the b vector b <- solve(t(X)%*%X)%*%t(X)%*%y b #inverse of transpose matrix C <- solve(t(X)%*%X) C #Compute H Matrix H = X%*%solve((t(X)%*%X))%*%t(X) # can compute H using C H = X%*%C%*%t(X) round(H,2) # Compute the predicted values yhat=X%*%solve((t(X)%*%X))%*%t(X)%*%y # compute predicted values using H yhat= H%*%y yhat

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

College Algebra Graphs and Models

Authors: Marvin L. Bittinger, Judith A. Beecher, David J. Ellenbogen, Judith A. Penna

5th edition

321845404, 978-0321791009, 321791002, 978-0321783950, 321783956, 978-0321845405

More Books

Students also viewed these Mathematics questions

Question

=+ b. At what output level would the monopolist produce?

Answered: 1 week ago

Question

x

Answered: 1 week ago