Client Account:   Login
Home Site Statistics   Contact   About Us   Sunday, March 26, 2017

users on-line: 2 | Forum entries: 6   
j0182084- Back to Home
   Skip Navigation LinksHOME › AREAS OF EXPERTISE › Curve Fitting Solutions › ~ Straight Line Fit Method


"Curve Fitting Solutions"
Straight Line Fit Method
f(x) =
(constant)                (x)               (standard deviation)


x-array = { , , , , , }
y-array = { , , , , , }



[ Initial x-array: { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 } ]
[ Initial y-array: { 1.9, 2.7, 3.3, 4.4, 5.5, 6.5 } ]
                       

IMPLEMENTATION
Curve Fitting Linear Fit

The most popular curve fitting technique is the least squares method. The simplest linear regression is the straight line fit, which attempts to fit a straight line using the least squares technique.

Algorithm Creation

The model function has the following simple form:

f(x;α) = a + bx

where the sum of the linear regression becomes,

S(a,b) = ∑ni=0[yi - f(xi;α]2 = ∑ni=0(yi - a - bxi)2

The standard deviation α can be expressed by,

α = √ S / n - m

Testing the Straight Line Fit Method

In order to test theStraight Line Fit Method as defined above, a new TestStraightLineFit() static method has been added and executed. Supporting code and methods are not shown.

           static void TestStraightLineFit();
              {
                 ListBox1.Items.Clear();
                 double[] xarray = new double[] { t1, t2, t3, t4, t5, t6 };
                 double[] yarray = new double[] { t7, t8, t9, t10, t11, t12 };
                 double[] x = new double[] { t11, t12, t13, t14 };
                 double[] results = CurveFitting.StraightLineFit(xarray, yarray);
                 VectorR v = new VectorR(results);
                 ListBox1.Items.Add(" " + v.ToString());
              }

As a sample we provide the input data points using two double arrays x-array and y-array. Running this example generates results (1.729, 0.929, 0.191). Therefore, the regression line is given by:

f(x) = 1.729 + 0.929x

and the standard deviation is,

0.191

The user can manipulate all values and try variations on the arrays themselves by specifying new estimate values.



Other Implementations...


Object-Oriented Implementation
Graphics and Animation
Sample Applications
Ore Extraction Optimization
Vectors and Matrices
Complex Numbers and Functions
Ordinary Differential Equations - Euler Method
Ordinary Differential Equations 2nd-Order Runge-Kutta
Ordinary Differential Equations 4th-Order Runge-Kutta
Higher Order Differential Equations
Nonlinear Systems
Numerical Integration
Numerical Differentiation
Function Evaluation

Skip Navigation Links.

Home Skip Navigation Links
   Algorithms, Graphics, Vectors,
            implementation techniques.
   Mineral Transactions info,
            sales, agreements...
   Numerical Modeling services
            mineral environment.
   Want to know about Mining?
            basic knowledge here...
   What are Mineral Commodities?
            our elementary charts.
   Math, Analysis and More...
            our expertise in the matter.

 

Platform Implementation

Home Algorithm Implementation
We design applications for different environments and platforms...
        Home Graphics and Animation
The graphics classes in Smalltalk were designed...
        Home Optimization Algorithms
An optimization problem is a numerical problem...
        Home Vectors and Matrices
The concise notation introduced in linear algebra for vector...
 



2017 © Keystone Mining Post  |   2461 E. Orangethorpe Av., Fullerton, CA 92631 USA  |   info@keystoneminingpost.com