Function to compute the data for partial regression plot
int ocmath_partial_reg_plots( const double * pX, UINT nOSizeN, UINT nVSizeM, const double * pY, const LROptions * psLROptions, double * pPlotMat, uint nMPlotMat )
EX1
void mr_plot() { Matrix mat1("MBook1"); matrix mX = mat1; Dataset dsY("Book1_A"); vector vY = dsY; int nVSizeM = mX.GetNumCols(); int nOSizeN = mX.GetNumRows(); LROptions sLROptions; sLROptions.FixIntercept = false; matrix mPlot; int nFitSize = sLROptions.FixIntercept ? nVSizeM : nVSizeM + 1; mPlot.SetSize(nOSizeN, 2*nFitSize); int nRet = ocmath_partial_reg_plots(mX, nOSizeN, nVSizeM, vY, &sLROptions, mPlot, 2*nFitSize); Matrix mat2("MBook2"); mat2 = mPlot; }
origin.h