Question: Use the R language Q8. Create an R matrix object named A using the following data: 4.5 -2.1 6.3 2.7 1.6 -2.6 3.6 8.4 5.2
Q8. Create an R matrix object named A using the following data: 4.5 -2.1 6.3 2.7 1.6 -2.6 3.6 8.4 5.2 8.3 2.5 1.7 3.7-4.4 3.7 3.8 5.8 5.2 1.9 -4.2 Do this by sin the scan) function to read in the data from screen. Perfor following operations and report the result of each operation: the (a) extract the middle 3 elements of row 3 of A to a vector y; (b) create the following 3 x 3 matrix B by subsetting matrix A: 3.6 5.2 8.3 1.7-4.4 3.7 5.8 19 -4.2 (c) compute vector d-By (d) append the data vector (9.4, 10.5,-11.5)' to the left hand side of B to form W; (e) compute matrix P WW (f) compute the inverse of P: (g) solve the equation Pa d for a using a P- (h) solve the equation Pa d for a using function solve) (i) factorize P so that P- R'R, where R is an upper triangular matrix
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
