Presentations

REGRESSION AND INTERPOLATION WITH MATLAB

Description
REGRESSION AND INTERPOLATION WITH MATLAB
Categories
Published
of 19
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  1 1 REGRESSION AND INTERPOLATION WITH MATLAB Asst. Prof. Dr. Elif SERTELsertele@itu.edu.tr Summary  2 Review of Basic Statistics mean(x):  Computes the mean (averagevalue) of the elements of the vector x. std(x):  Computes the standard deviationof the values in x. The standard deviation σ is defined as the square root of thevariance Curve Fitting with Functions Other than Polynomials  y=b x m power function y=be mx or y=b10 mx exponential function y=mln(x)+b or y=mlog(x)+b logarithmic function y=1/mx+b reciprocalfunctionFirst rewrite the functions in a form that can be fittedwith a linear polynomial (n=1) y=mx+nln(y)=mln(x)+ln(b) power functionln(y)=mx+ln(b) or log(y)=mx+log(b) exponential function1/y=mx+b reciprocalfunction  3 Curve Fitting Regression analysis is a process of fitting a function toa setof data points.Curve fitting with polynomials is done with polyfitfunction which uses the least squares method.polyfit finds the coefficients of a polynomialrepresentingthe data p=polyfit(x,y,n)p is the vector of the coefficients of the polynomial that fitsthe datax is a vector with the horizontal coordinate y is a vector with the vertical coordinaten is the degree of the polynomial polyval uses those coefficients to find new values of y,that correspond to the known values of x  4 Other  polyfit functions in Matlab  Function Power function y=bx m Exponential function y=be mx or y=b10 mx Logarithmic function y=mln(x)+b or y=mlog(x)+bReciprocalfunction y=1/mx+b Polyfit function form p=polyfit(log(x),log(y),1)p=polyfit(x,log(y),1)orp=polyfit(x,log10(y),1)p=polyfit(log(x),y,1)orp=polyfit(log10(x),y,1)p=polyfit(x,1./y,1) Other consideration when choosing a function are: Exponential functions cannot pass throughthe srcinExponential functions can only fit data withall positive y’s or all negative y’sLogarithmic functions cannot model x=0, ornegative values of xFor the power function y=0 when x=0The reciprocal equation cannot model y=0
Search
Tags
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks