Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Fit the following model in Python: Y = a+bx+ced x Use a numpy or scipy function, considering the following steps: a) c) Obtain 100
Fit the following model in Python: Y = a+bx+ced x Use a numpy or scipy function, considering the following steps: a) c) Obtain 100 pairs of points (x,y) from the above model using the parameters: a=2, b=3, c=-1 and d=1.2, with x = [-3,3]. Obtain z by adding Gaussian noise with standard deviation =0.2 to the y's calculated above, obtain, z=y+ where n is a normal random variable with standard deviation 0.2. Show the points (x,y) and (x,z) above in the same figure. For the points (x,y) use two styles: line and points. Note: note that to display the 'line' style the x's must be ordered from least to older. Write a function in Python that receives as parameters, the data (X,Z) and return the estimated parameters of the model. Show in the same figure: the original model and the estimated model, for x [-3,3].
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Algorithm of the code 1 Import necessary libraries Import numpy for numerical operations matplotlibpyplot for plotting and scipyoptimizecurvefit for fitting the model to data 2 Define parameters Set t...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