Skip to main content
Log in

A MATLAB™ code to perform weighted linear regression with (correlated or uncorrelated) errors in bivariate data

  • Published:
Journal of the Geological Society of India

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

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.

    Article  Google Scholar 

  • 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.

    Google Scholar 

  • 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.

    Article  Google Scholar 

  • 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.

    Article  Google Scholar 

  • York, D. (1966) Least-squares fitting of a straight line, Canadian Jour. Physics, v.44, pp.1079–1086.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kaustubh Thirumalai.

Electronic supplementary material

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12594-011-0044-1

Keywords

Navigation