Optimization model examine the samples trend model:if(Model_Type==trend){int info,i,j;//define working variables CLinearModelShell LM;//define a special object model CLRReportShell AR;//define a special object report CLSFitReportShell report;//define yet another object CMatrixDouble MATRIX(points,variables+1);//define a metric for storing all data if(Model_Growth==0){Alert(“Zero model growth!”);error=true;return;}//varify the model parameters for(j=0;j<points;j++)//calculation the target function by optimization interval points{double x=(double)j/(points-1) -Model_Phase;//calculate the X coorderinate if(Model_Absolute)x=MathAbs(x);//make the model symmetrical if necessary MODEL[j]=Model_Growth*x;//calculate the Y coorderinate} double zero_shift= -MIDEL[0];if(zero_shift!=0)for(j=0;j<points;j++)MODEL[j]+=zero_shift;//shift the model vertically to the zero point
Leave a comment