Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Codes in A1 StudentMatriculationNumber.py file: The WLS solution for w=argminwWMSE(w) is known to be w=(XAX)1XAy. Write a Python script to find the WLS solution for
Codes in "A1 StudentMatriculationNumber.py" file:
The WLS solution for w=argminwWMSE(w) is known to be w=(XAX)1XAy. Write a Python script to find the WLS solution for w given an arbitrary matrix XR52, a vector yR5 and a diagonal matrix AR55. Submit your Python code as a function ("def A1 MatricNumber (X,A,y )") that takes in X,A and y as inputs and generates (XAX)1 and w as outputs in a single-file with the filename "A1 StudentMatriculationNumber .py". Your Python routine should return a matrix (XAX)1 and the WLS solution vector w (as a numpy array). Hint: you will need "import numpy as" and its matrix manipulation functions. import numpy as np def A1_A1234567M(X,A, A): Input type : type: numpy. ndarray :A type: numpy. ndarray :y type: numpy.ndarray Return type : InvXTAX type: numpy.ndarray :w type: numpy. ndarray "*" \# your code goes here pass \# return in this order return InvXTAX, W
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