Simulation scenario 3. Time and precision of QR decomposition

Run a cycle over a matrix size n from 100 to 1000 with step 100, doing the following operations.

Generate an upper triangular matrix R_true, n by n, by first generating the general random matrix, and then nullifying its lower part by function numpy.triu(). Make the diagonal of R_true positive by taking the abs function of diagonal elements.

Generate an orthogonal matrix Q_true, n by n, by function scipy.stats.ortho_group.rvs().

Compute a product A = Q_true * R_true.

Invert this product by QR-decomposing A: Q_est, R_est = np.linalg.qr(A).

Compute norm_2, abs(det) and cond of matrices A, Q_true, R_true, Q_est, R_est.

Find an error matrix abs(Q_true – Q_est), average its elements in the number avg_q_error.

Find an error matrix abs(R_true – R_est), average its elements in the number avg_r_error.

After the cycle, plot the following values against n, both – on a regular and logarithmic scale: avg_q_error, avg_r_error. Also plot norm_2, abs(det) and cond of matrices A, Q_true, R_true, Q_est, R_est.

On a regular scale, plot the times of computing the product A = Q_true * R_true, and decomposition np.linalg.qr(A).

The "article sharing for free answers" option enables you to get a discount of up to 100% based on the level of engagement that your social media post attracts. When you get a discount code, you use it to place an order through this link, and a waiver applies based on the code you get via email, for example, a 100% discount means no charges will apply.
The level of engagement is determined by aspects like organic clicks, active sign ups or even potential leads to your classmates who can pay for the specific paper. In this regard, adding images, Social media tags and mentions are likely to boost the visibility of your posts to the targeted audience and enable you to get a higher discount code.
Please share the post as many times as you can.

Share test to get free answers

This option allows you to get some discount for suggesting friends who would order a copy of this assignment.
1 Successful suggestion = 30% discount
2 Successful suggestions= 60% Discount
2 Successful Suggestions= 100% Discount ***Free Copy*** Proceed