[Genabel-commits] r1906 - pkg/ProbABEL/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Jan 4 21:12:28 CET 2015
Author: lckarssen
Date: 2015-01-04 21:12:27 +0100 (Sun, 04 Jan 2015)
New Revision: 1906
Modified:
pkg/ProbABEL/src/reg1.cpp
pkg/ProbABEL/src/reg1.h
Log:
Added some doxygen function descriptions to ProbABEL's reg1.{h,cpp} files.
Modified: pkg/ProbABEL/src/reg1.cpp
===================================================================
--- pkg/ProbABEL/src/reg1.cpp 2014-12-30 13:17:08 UTC (rev 1905)
+++ pkg/ProbABEL/src/reg1.cpp 2015-01-04 20:12:27 UTC (rev 1906)
@@ -413,6 +413,12 @@
}
+/**
+ * \brief Calculate the loglikelihood of a linear regression contained
+ * in a linear_reg object.
+ *
+ * @param X The design matrix.
+ */
void linear_reg::logLikelihood(const mematrix<double>& X) {
/*
loglik = 0.;
@@ -448,6 +454,16 @@
}
+/**
+ * \brief Calculate the robust standard errors and covariance.
+ *
+ * @param X The design matrix \f$X\f$.
+ * @param robust_sigma2 The variable in which to store the robust
+ * \f$\hat{\sigma}^2\f$.
+ * @param tXX_inv Matrix containing \f$(X^T X)^{-1}\f$.
+ * @param offset Offset indicating where the columns of the SNP
+ * parameters start in the linear_reg::beta vector.
+ */
void linear_reg::RobustSEandCovariance(const mematrix<double> &X,
mematrix<double> robust_sigma2,
const MatrixXd tXX_inv,
@@ -464,6 +480,15 @@
}
+/**
+ * Calculate the (plain) standard error and covariance of the betas
+ * of a linear_reg object.
+ *
+ * @param sigma2_internal The internal \f$\hat{\sigma}^2\f$.
+ * @param tXX_inv Matrix containing \f$(X^T X)^{-1}\f$.
+ * @param offset Offset indicating where the columns of the SNP
+ * parameters start in the linear_reg::beta vector.
+ */
void linear_reg::PlainSEandCovariance(const double sigma2_internal,
const MatrixXd &tXX_inv,
const int offset) {
@@ -476,13 +501,17 @@
/**
* \brief Estimate the parameters for linear regression.
*
- * @param verbose
- * @param model
+ * @param verbose Turns verbose printing of various matrices on if
+ * non-zero.
+ * @param model The number of the genetic model (e.g. additive,
+ * recessive, ...) that is to be applied by the apply_model() function.
* @param interaction
- * @param ngpreds
+ * @param ngpreds Number of genomic predictors (1 for dosages, 2 for
+ * probabilities).
* @param invvarmatrixin
- * @param robust
- * @param nullmodel
+ * @param robust If non-zero calculate robust standard errors.
+ * @param nullmodel If non-zero calculate the null model (excluding
+ * SNP information).
*/
void linear_reg::estimate(const int verbose,
const int model,
Modified: pkg/ProbABEL/src/reg1.h
===================================================================
--- pkg/ProbABEL/src/reg1.h 2014-12-30 13:17:08 UTC (rev 1905)
+++ pkg/ProbABEL/src/reg1.h 2015-01-04 20:12:27 UTC (rev 1906)
@@ -1,30 +1,14 @@
-//==============================================================================
-//
-// Filename: src/reg1.h
-//
-// Description: ProbABEL
-//
-// Version: 0.1-3
-// Created: ---
-// Revision: none
-// last modification: 11-Jan-2009
-//
-// Author: Yurii S. Aulchenko
-// modified by: Maksim V. Struchalin, 11-Jan-2009
-//
-// Modified by Han Chen (hanchen at bu.edu) on Nov 9, 2009
-// based on src/reg1.h version 0.2 as of Oct 19, 2009
-//
-// Company: ErasmusMC,
-// Epidemiology & Biostatistics Department,
-// Rotterdam,
-// The Netherlands.
-// Email: i.aoultchenko at erasmusmc.nl, m.struchalin at erasmusmc.nl
-//
-//==============================================================================
-
-/*
+/**
+ * \file reg1.h
+ * \author Yurii S. Aulchenko
+ * \author M. Kooyman
+ * \author L.C. Karssen
+ * \author Maksim V. Struchalin
+ * \author Han Chen (hanchen at bu.edu)
*
+ * \brief Describes various classes containing regression objects.
+ *
+ *
* Copyright (C) 2009--2014 Various members of the GenABEL team. See
* the SVN commit logs for more details.
*
@@ -72,13 +56,36 @@
class base_reg {
public:
+ /**
+ * \brief The vector containing the regression coefficients.
+ *
+ * Note that the SNP coefficients are the last elements of the
+ * vector. The mean and coefficients for other covariates come
+ * first.
+ *
+ */
mematrix<double> beta;
+
+ /**
+ * \brief The vector containing the standard errors of the
+ * regression coefficients.
+ *
+ */
mematrix<double> sebeta;
//Han Chen
mematrix<double> covariance;
//Oct 26, 2009
mematrix<double> residuals;
+
+ /**
+ * \brief The MLE of the residual variance.
+ *
+ * See the equation following Eq.(1) in the ProbABEL paper
+ * (Aulchenko et al. 2010).
+ *
+ */
double sigma2;
+
double loglik;
double chi2_score;
regdata reg_data;
More information about the Genabel-commits
mailing list