Vanguard Software
Forecasting & Planning Solutions
Home Products Solutions Services Customers Partners Company
 
Applying science to business management

contents.gifindex.gifprev1.gifnext1.gif

linefit

Format: linefit( [x1,x2,...], y, zero )

Arguments: [real] [x1,x2] Lists of independent values

[real] y List of dependent values

(bool) zero Optional zero y-intercept; default = no

Returns: [real] List of regression coefficients b, m1, m2, ..., mn

Description: Linefit performs a least-squares regression analysis to find the coefficients, b, m1, m2, ..., mn that cause a line of the form

  dsc00255.gif

to best fit the series of data points specified. Each data point is defined by all corresponding elements in the lists x1, x2, ..., and y. For example, the first elements in each of these lists together define one point. If the argument zero is true (any non-zero value), the constant b is forced to zero.

Examples: Fit a line of the form y(x)=b+m*x to the data points:

  (1,7), (3,15), (4,14), (7,20), and (8,30).

x:=[1,3,4,7,8]

y:=[7,15,14,20,30]

linefit(x,y) = [4.398,2.783]


The result [4.40,2.78] means that y(x) = 4.398 + 2.783*x

See Also: stderror, rsquared, solve

  Demand Planning  |  Financial Forecasting
Forecasting Software  |  Strategic Planning Software  |  Decision Tree Software
Decision Support Software  |  Expert System Software  |  Online Surveys

Contact Us  |  Terms of Use  |  Privacy Policy  |  Site Map
Vanguard Software
© 2011 Vanguard Software Corporation
Print this page   Email this page to a friend