Question: Do task 5 , i also provided an example code of another problem here below: # import numpy module import numpy as np import math
Do task i also provided an example code of another problem here below:
# import numpy module
import numpy as np
import math
def gx:
return nplogx
def gx:
return npcosx
def gx:
return npexpx
x nparray
# create matrix A and vector y of the exervise on Slide of Topic
A npzeros
A: gxravel # numpy.ravel functions returns d array
A: gxravel
A: gxravel
y nparray
# compute AA
ATA npmatmulnptransposeA A
# compute inverse of AA
invATA nplinalg.invATA
# compute Ay
ATy npmatmulnptransposeA y
# compute z inverseAAAy
z npmatmulinvATA, ATy
printz
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
