Abstract
MATLAB™ is a powerful, easy to use, software package suitable for many mathematical operations, which finds plenty of scientific applications. One such application is the fitting of trend lines for a given data set so as to interpret the relationship of the variance of the parameters involved. We provide here a code in MATLAB™ that performs the weighted linear regression with (correlated or uncorrelated) errors in bivariate data which can handle ‘force-fit’ regression as well.
Similar content being viewed by others
References
Cantrell, C.A. (2008) Technical Note: Review of methods for linear least-squares fitting of data and application to atmospheric chemistry problems. Atmospheric Chemistry and Physics Discussions, v.8, pp.6409–6436.
Huesken, G. (2006) errorbar_x, MATLAB™ Central. http://www.mathworks.com/matlabcentral/fileexchange/12751, [accessed 17 December 2009].
Pearson, K. (1901) On Lines and planes of closest fit to systems of points in space, Philosophical Magz., v.2(6), pp.559–572.
Srinivasan, G., Goswami, J.N. and Bhandari, N. (1999) 26Al in Eucrite Piplia Kalan: Plausible Heat Source and Formation Chronology. Science, v.284, 1348. doi: 10.1126/science.284.5418.1348.
York, D., Evensen, N. M., Martinez, M.L. and Delgado, J.D.B. (2004) Unified equations for the slope, intercept, and standard errors of the best straight line. American Jour. Physics, v.72(3), pp.367–375.
York, D. (1966) Least-squares fitting of a straight line, Canadian Jour. Physics, v.44, pp.1079–1086.
Author information
Authors and Affiliations
Corresponding author
Electronic supplementary material
Rights and permissions
About this article
Cite this article
Thirumalai, K., Singh, A. & Ramesh, R. A MATLAB™ code to perform weighted linear regression with (correlated or uncorrelated) errors in bivariate data. J Geol Soc India 77, 377–380 (2011). https://doi.org/10.1007/s12594-011-0044-1
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s12594-011-0044-1