POV-Ray : Newsgroups : povray.off-topic : Linear regression : Re: Linear regression Server Time
4 Sep 2024 01:17:53 EDT (-0400)
  Re: Linear regression  
From: scott
Date: 8 Jun 2010 09:23:55
Message: <4c0e446b$1@news.povray.org>
> Hi there. Does anybody here happen to know how to perform linear 
> regression?
>
> As in, I've got a list of data points that ought to lie in a nearly 
> perfect straight line, and I want to discover what the slope and intercept 
> of that line is. (But each individual point might contain a certain amount 
> of measurement error.)
>
> I've had a look on Wikipedia, but it starts talking about chi-squared and 
> Student t-distributions and covariance and basically I have no clue what 
> the hell any of it means. :-/

This page:

http://en.wikipedia.org/wiki/Simple_linear_regression

Gives the formula for the coefficients alpha and beta for the line of best 
fit.  It's pretty self-explanatory if you know how to calculate a summation.

The simplest form for you seems to be:

b = (mean[x*y] - mean[x] * mean[y]) / ( mean[x^2] - mean[x]^2 )

a = mean[y] - b * mean[x]

then your line of best fit is:

y = a + b*x


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.