MATLAB Curve Fitting Question?

In summary, the conversation discusses a given homework statement and the process of fitting data in relation to mean, standard deviation, and standard error. The individual also expresses confusion about how to relate the data and asks for ideas on how to proceed.
  • #1
coffeem
91
0

Homework Statement



Given:

clear
n = 100;
x = 1:n;
err = randn(1,n);
mean(err);
std(err);
y = x + err;
cftool

Q - Relate your fitted to the data in y to the mean, S and SE values. You should also compare the fit results to the 95% point on the curve of the integral of the normal distribution.


2. The attempt at a solution

I did the following:

Mean = mean(y)

Standard_Deviation = std(y)

Standard_Error = ((Standard_Deviation).^2)./sqrt(100)


But in all honestly don't know what I have to do. I mean how do I relate the data? I think the problem here is that I do not understand the question. Thanks
 
Physics news on Phys.org
  • #2
hey does anyone have any ideas for this? i am still stuck... thanks
 
  • #3


I would suggest that you start by understanding the question and the data given. The data provided is a set of 100 points (n=100) with random errors (err) added to the values of x. The mean and standard deviation of these errors have been calculated for you. The y values are then calculated by adding the errors to the original x values.

The cftool command opens up a curve fitting tool in MATLAB, which allows you to fit a curve to your data and obtain various statistical measures of the fit.

To relate the fitted curve to the data in y, you can use the mean, standard deviation, and standard error values that you calculated. These values represent the central tendency and spread of the data. You can compare these values to the parameters of the fitted curve, such as the mean, standard deviation, and standard error of the fitted curve. This will give you an idea of how well the fitted curve represents the data in y.

Additionally, you can compare the fit results to the 95% point on the curve of the integral of the normal distribution. This means that you can compare the fit results to the values that would be expected if the data were normally distributed. This can help you determine if the fitted curve is a good representation of the data.

In summary, to relate the fitted curve to the data in y, you can compare the statistical measures of the data (mean, standard deviation, standard error) to the parameters of the fitted curve and compare the fit results to the expected values from a normal distribution. This will give you an idea of how well the fitted curve represents the data in y.
 

What is curve fitting in MATLAB?

Curve fitting in MATLAB is the process of finding a mathematical function that best represents a set of data points. This function can then be used to make predictions or analyze the data.

How do I perform curve fitting in MATLAB?

To perform curve fitting in MATLAB, you can use the built-in function "fit" or "polyfit". These functions take in the data points and return the best fitting function based on the specified model.

What is the difference between linear and nonlinear curve fitting?

Linear curve fitting involves finding a function that is a straight line, while nonlinear curve fitting involves finding a function that is not a straight line. Nonlinear curve fitting is typically used for more complex data sets.

How do I evaluate the accuracy of a curve fitting in MATLAB?

You can evaluate the accuracy of a curve fitting in MATLAB by calculating the residuals, which are the differences between the actual data points and the values predicted by the fitted function. Lower residuals indicate a better fit.

Can I customize the fitting options in MATLAB?

Yes, you can customize the fitting options in MATLAB by specifying the model, initial parameters, and other fitting parameters such as the type of regression and the optimization method. This can help you find the best fit for your data.

Similar threads

  • Introductory Physics Homework Help
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • Introductory Physics Homework Help
Replies
7
Views
886
  • Introductory Physics Homework Help
Replies
9
Views
1K
  • Introductory Physics Homework Help
Replies
17
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
845
  • Introductory Physics Homework Help
Replies
3
Views
875
Replies
16
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
812
Back
Top