## 4.6-2 ## source('utils.R') ## Solve 4.2-8 to get x^1 using only three significant digits: ## source('section_4_2_ex_8.R') ## What is the residual r for this approximate solution: ## residual = W_orig[, 5] - W_orig[, 1:4] %*% x print('residual= ') print(residual) ## Solve A e = r (for e) ## res = GE_w_scaled_partial_pivoting(W_orig[, 1:4], residual) print('The error vector e=') print(res$X) ## The new solution using iterative improvement: ## print(x + res$X)