How to use REGRESSION & INTERPOLATION ?

6 views (last 30 days)
Fadi Ftouhi
Fadi Ftouhi on 9 Apr 2021
Commented: John D'Errico on 9 Apr 2021
Hey, Can anyone help with this task because i'm really stuck.
The results of a noisy measurement can be found in the attached file. The first column in the file stands for the x values, the second column for the y values. The dependency of y values from x are described by the following equation:
@(a,b,x)a*(sin(pi*x).^2+0.05*x.^3)+b*1./(x.^2+1)
Fit the equation to the measured points and determine the parameter 'a' and 'b'. Estimate the standard deviation of measurement noise.
how to write this code?

Answers (1)

the cyclist
the cyclist on 9 Apr 2021
I don't think you need interpolation for this task.
Do you have the Statistics and Machine Learning Toolbox? You could fit a non-linear model using the fitnlm function. The residuals of that model are the measurement noise.
  1 Comment
John D'Errico
John D'Errico on 9 Apr 2021
Most students don't seem to understand the difference between interpolation, and what is needed here, thus empirical model building, approximation, and nonlinear regression. But yes, this question has nothing to do with interpolation.
The curve fitting toolbox is another choice to provide easy model estimation. The problem is, if this is a student homework assignment as it certainly seems to be, it may be that none of those tools will be deemed acceptable.

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!