Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## cdk-commits

 [Cdk-commits] CVS: cdk/src/org/openscience/cdk/qsar/model/R LinearRegressionModelFit.java,1.3,1.4 LinearRegressionModelPredict.java,1.3,1.4 From: Rajarshi Guha - 2005-06-27 23:40:01 ```Update of /cvsroot/cdk/cdk/src/org/openscience/cdk/qsar/model/R In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv518/src/org/openscience/cdk/qsar/model/R Modified Files: LinearRegressionModelFit.java LinearRegressionModelPredict.java Log Message: Fixed Javadoc errors noted by doccheck Index: LinearRegressionModelFit.java =================================================================== RCS file: /cvsroot/cdk/cdk/src/org/openscience/cdk/qsar/model/R/LinearRegressionModelFit.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LinearRegressionModelFit.java 14 Feb 2005 22:04:05 -0000 1.3 +++ LinearRegressionModelFit.java 27 Jun 2005 23:39:51 -0000 1.4 @@ -39,6 +39,15 @@ double[] coeff, res, fitted; int rank, dfResidual; + /** + * Construct the object to contain a linear regression fit. + * + * @param coeff A 1-dimensional array of coefficients + * @param res A 1-dimensional array of residuals + * @param fitted A 1-dimensional array of fitted values + * @param rank An integer indicating the rank of the fit + * @param degreesOfFreedom The degrees of freedom + */ public LinearRegressionModelFit(double[] coeff, double[] res, double[] fitted, int rank, int degreesOfFreedom) { setCoefficients(coeff); setResiduals(res); @@ -46,25 +55,113 @@ setRank(rank); setdfResidual(degreesOfFreedom); } + + /** + * Get the rank of the fit. + * + * @return The rank of the fit + * @see #setRank + */ public int getRank() { return(this.rank); } + + /** + * Set the rank of the fit. + * + * This method should not be called outside this class + * + * @param rank The rank of the fit + * @see #getRank + */ public void setRank(int rank) { this.rank = rank; }; + /** + * Get the residuals of the fit. + * + * The number of residuals equals the number of observations used + * to build the model + * + * @return A 1-dimensional array containing the residuals. + * @see #setResiduals + */ public double[] getResiduals() { return(this.res); } + + /** + * Set the residuals of the fit. + * + * This method should not be called outside this class + * + * @param residuals A 1-dimensional array of residual values + * @see #getResiduals + */ public void setResiduals(double[] residuals) { this.res = new double[residuals.length]; for (int i = 0; i < residuals.length; i++) this.res[i] = residuals[i]; } + /** + * Get the fitted coefficients. + * + * The number of coefficients equals the number of independent + * variables used to build the model + * + * @return A 1-dimensional array containing the coefficients. + * @see #setCoefficients + */ public double[] getCoefficients() { return(this.coeff); } + + /** + * Set the fitted coefficients. + * + * + * This method should not be called outside this class + * + * @param coeff A 1-dimensional array containing the coefficients. + * @see #getCoefficients + */ public void setCoefficients(double[] coeff) { this.coeff = new double[coeff.length]; for (int i = 0; i < coeff.length; i++) this.coeff[i] = coeff[i]; } + /** + * Get the DOF of the residuals. + * + * @return An integer indicating the D.O.F + * @see #setdfResidual + */ public int getdfResidual() { return(this.dfResidual); } + + /** + * Set the DOF of the residuals. + * + * This method should not be called outside this class + * + * @param degreesOfFreedom The degrees of freedom + * @see #getdfResidual + */ public void setdfResidual(int degreesOfFreedom) { this.dfResidual = degreesOfFreedom; } + + /** + * Get the fitted values. + * + * Returns the predicted values for the observations used to + * build the model. The number of fitted values equals the number + * observations used to build the model. + * + * @return A 1-dimensional array containing the fitted values + * @see #setFitted + */ public double[] getFitted() { return(this.fitted); } + + /** + * Set the fitted values. + * + * This method should not be called outside this class + * + * @param fitted A 1-dimensional array of fitted values + * @see #getFitted + */ public void setFitted(double[] fitted) { this.fitted = new double[fitted.length]; for (int i = 0; i < fitted.length; i++) this.fitted[i] = fitted[i]; Index: LinearRegressionModelPredict.java =================================================================== RCS file: /cvsroot/cdk/cdk/src/org/openscience/cdk/qsar/model/R/LinearRegressionModelPredict.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LinearRegressionModelPredict.java 14 Feb 2005 22:04:05 -0000 1.3 +++ LinearRegressionModelPredict.java 27 Jun 2005 23:39:51 -0000 1.4 @@ -39,6 +39,16 @@ int degreesOfFreedom; double residualScale; + /** + * Construct the object to contain linear regression predictions. + * + * @param predicted A 1-dimensional array of predicted values + * @param standardErrors A 1-dimensional array of standard errors of prediction + * @param lowerBounds A 1-dimensional array of lower confidence bounds + * @param upperBounds A 1-dimensional array of upper confidence bounds + * @param degreesOfFreedom The degrees of freedom of hte predictions + * @param residualScale The scale of the residuals + */ public LinearRegressionModelPredict(double[] predicted, double[] standardErrors, double[] lowerBounds, double[] upperBounds, int degreesOfFreedom, double residualScale) { @@ -50,28 +60,129 @@ setResidualScale(residualScale); } + /** + * Get the degrees of freedom. + * + * @return An integer indicating the degrees of freedom + * @see #setDF + */ public int getDF() { return(this.degreesOfFreedom); } + + /** + * Set the degrees of freedom. + * + * This method should not be called outside this class + * + * @param degreesOfFreedom An integer indicating the degrees of freedom + * @see #getDF + */ public void setDF(int degreesOfFreedom) { this.degreesOfFreedom = degreesOfFreedom; } + /** + * Get the scale of residuals. + * + * @return A double indicating the residual scale + * @see #setResidualScale + */ public double getResidualScale() { return(this.residualScale); } + + /** + * Set the scale of the residuals. + * + * This method should not be called outside this class + * + * @param scale The scale of the residuals + * @see #getResidualScale + */ public void setResidualScale(double scale) { this.residualScale = scale; } + /** + * Get predicted values. + * + * Get the predictions for a set of observations from the current linear + * regression fit + * + * @return A 1-dimensional array containing the predicted values + * @see #setPredicted + */ public double[] getPredicted() { return(this.pred); } + + /** + * Set the predicted values. + * + * This method should not be called outside this class + * + * @param predicted A 1-dimensional array of predicted values + * @see #getPredicted + */ public void setPredicted(double[] predicted) { this.pred = new double[predicted.length]; for (int i = 0; i < predicted.length; i++) this.pred[i] = predicted[i]; } + + /** + * Get the lower confidence bounds. + * + * Gets the lower confidence bounds for the predicted values of + * the observations + * + * @return A 1-dimensional array of lower confidence bounds + * @see #setLower + */ public double[] getLower() { return(this.lwr); } + + /** + * Set the lower confidence bounds. + * + * This method should not be called outside this class + * + * @param lowerBounds A 1-dimensional array of lower confidence bounds + * @see #getLower + */ public void setLower(double[] lowerBounds) { this.lwr = new double[lowerBounds.length]; for (int i = 0; i < lowerBounds.length; i++) this.lwr[i] = lowerBounds[i]; } + + /** + * Get the upper confidence bounds. + * + * Gets the upper confidence bounds for the predicted values of + * the observations + * + * @return A 1-dimensional array of upper confidence bounds + * @see #setUpper + */ public double[] getUpper() { return(this.upr); } + + /** + * Set the upper confidence bounds. + * + * This method should not be called outside this class + * + * @param upperBounds A 1-dimensional array of upper confidence bounds + * @see #getUpper + */ public void setUpper(double[] upperBounds) { this.upr = new double[upperBounds.length]; for (int i = 0; i < upperBounds.length; i++) this.upr[i] = upperBounds[i]; } + + + /** + * Get the standard errors of prediction. + * + * @return A 1-dimensional array of standard errors + * @see #setSEFit + */ public double[] getSEFit() { return(this.sefit); } + + /** + * Set the standard errors of predictions. + * + * @param standardErrors A 1-dimensional array of standard errors + * @see #getSEFit + */ public void setSEFit(double[] standardErrors) { this.sefit = new double[standardErrors.length]; for (int i = 0; i < standardErrors.length; i++) this.sefit[i] = standardErrors[i]; ```