Visit Gigasoft's Web Site
 ProEssentials v9 Help

BestFitCoeffs

Scope

Pego, Pesgo

Type

Double

Default

empty

.NET

PePlot.Option.BestFitCoeffs

Ocx|Vcl

BestFitCoeffs

DLL

PEP_faBESTFITCOEFFS

 

Purpose

This read-only property provides the best fit coefficients when PlottingMethod is set to PEGPM_POINTSPLUSBFL or PEGPM_POINTSPLUSBFC. The degree of the coefficients are also controlled by BestFitDegree or SubsetDegree.

 

IMPORTANT, you can only retrieve these coefficients after the object's image has been constructed by calling PEresetimage, or via PEactions = 0.

 

This property array is structured to provide up to 14 subsets worth of coefficients.

 

This property is retrieved with PEvgetcell, the index can be 0 - 139 where

0-9 are coefficients for first subset,

10-19 are coefficients for second subset,

20-29 are coefficients for third subset and so on.

 

There are 10 possible coefficients which gives room for expansion. You will only use the first 2,3, 4 or 5 coefficients depending on PlottingMethod and BestFitDegree.

 

If you are generating a Best Fit Line, then only the first two coefficients are used.

The equation for the best fit line will be y = coeff1*x + coeff2

 

If you are generating a Best Fit Curve of 2nd order, then the equation will be

Y = coeff1*x*x + coeff2*x + coeff3

 

If you are generating a Best Fit Curve of 3rd order, then the equation will be

Y = coeff1*x*x*x + coeff2*x*x + coeff3*x + coeff4

 

If you are generating a Best Fit Curve of 4th order, then the equation will be

Y = coeff1*x*x*x*x + coeff2*x*x*x + coeff3*x*x + coeff4*x + coeff5

 

Comments

PePlot.Option.BestFitCoeffs members of Pego.PePlot.Option, Pesgo.PePlot.Option

 

See Also: BestFitFix

 

See example 009 within demo example code.

 

For example, if BestFitDegree is set for 2nd order and you have two subsets.

 

In C/C++ use:

 

double c1, c2, c3;

//-- Get First Subset Coeffs --

PEvgetcell(hPE, PEP_faBESTFITCOEFFS, 0, &c1);

PEvgetcell(hPE, PEP_faBESTFITCOEFFS, 1, &c2);

PEvgetcell(hPE, PEP_faBESTFITCOEFFS, 2, &c3);

//-- Get Second Subset Coeffs --

PEvgetcell(hPE, PEP_faBESTFITCOEFFS, 10, &c1);

PEvgetcell(hPE, PEP_faBESTFITCOEFFS, 11, &c2);

PEvgetcell(hPE, PEP_faBESTFITCOEFFS, 12, &c3);

 

With the OCX interface.

 

-- Get First Subset Coeffs

c1 = Pego1.BestFitCoeffs(0, 0)

c2 = Pego1.BestFitCoeffs(0, 1)

c3 = Pego1.BestFitCoeffs(0, 2)

 

-- Get Second Subset Coeffs --

c1 = Pego1.BestFitCoeffs(1, 0)

c2 = Pego1.BestFitCoeffs(1, 1)

c3 = Pego1.BestFitCoeffs(1, 2)

 

With the VCL interface.

 

{-- Get First Subset Coeffs }

c1 := Pego1.BestFitCoeffs[0, 0];

c2 := Pego1.BestFitCoeffs[0, 1];

c3 := Pego1.BestFitCoeffs[0, 2];

 

{-- Get Second Subset Coeffs --}

c1 := Pego1.BestFitCoeffs[1, 0];

c2 := Pego1.BestFitCoeffs[1, 1];

c3 := Pego1.BestFitCoeffs[1, 2];