R/RcppExports.R

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Ordinary Least Squares
#' 
#' Fits the standard OLS model.
#' 
#' @param y Numeric vector.
#' @param X Numeric matrix.
#' 
#' @return List containing the following:
#' \item{Beta}{Regression coefficient.}
#' \item{V}{Outcome variance.}
#' \item{Ibb}{Information matrix for beta.}
#' \item{Resid}{Outcome residuals.}
#' 
fitOLS <- function(y, X) {
    .Call('_BinReg_fitOLS', PACKAGE = 'BinReg', y, X)
}

#' Weighted Least Squares
#' 
#' Fits the following weighted least squares model: 
#' \eqn{y_{i}=x_{i}'\beta+\epsilon_{i}}. Here, the subject-specific residual is
#' normally distributed with mean zero and variance \eqn{\sigma^{2}/w_{i}}.
#' \eqn{w_{i}} is a known, subject-specific weight, and \eqn{\sigma} is a
#' common scale parameter.
#' 
#' @param y Response vector.
#' @param X Design matrix.
#' @param w Weight vector.
#' 
#' @return List containing the following:
#' \item{Beta}{Regression coefficient.}
#' \item{V}{Outcome variance.}
#' \item{Ibb}{Information matrix for beta.}
#' \item{Resid}{Outcome residuals.}
#'
fitWLS <- function(y, X, w) {
    .Call('_BinReg_fitWLS', PACKAGE = 'BinReg', y, X, w)
}

#' Matrix Determinant
#'
#' Calculates the determinant of \eqn{A}.
#'
#' @param A Numeric matrix.
#' @return Scalar. 
det <- function(A) {
    .Call('_BinReg_det', PACKAGE = 'BinReg', A)
}

#' Matrix Inner Product
#'
#' Calculates the product \eqn{A'B}.
#'
#' @param A Numeric matrix.
#' @param B Numeric matrix.
#' @return Numeric matrix. 
matIP <- function(A, B) {
    .Call('_BinReg_matIP', PACKAGE = 'BinReg', A, B)
}

#' Matrix Inverse
#' 
#' Calcualtes \eqn{A^{-1}}.
#'
#' @param A Numeric matrix.
#' @return Numeric matrix. 
matInv <- function(A) {
    .Call('_BinReg_matInv', PACKAGE = 'BinReg', A)
}

#' Matrix Matrix Product
#'
#' Calculates the product \eqn{AB}. 
#'
#' @param A Numeric matrix.
#' @param B Numeric matrix.
#' @return Numeric matrix. 
MMP <- function(A, B) {
    .Call('_BinReg_MMP', PACKAGE = 'BinReg', A, B)
}

#' Quadratic Form
#' 
#' Calculates the quadratic form \eqn{X'AX}.
#' 
#' @param X Numeric matrix.
#' @param A Numeric matrix.
#' @return Numeric matrix.
matQF <- function(X, A) {
    .Call('_BinReg_matQF', PACKAGE = 'BinReg', X, A)
}

#' Schur complement
#'
#' Calculates the efficient information \eqn{I_{bb}-I_{ba}I_{aa}^{-1}I_{ab}}. 
#'
#' @param Ibb Information of target parameter
#' @param Iaa Information of nuisance parameter
#' @param Iba Cross information between target and nuisance parameters
#' @return Numeric matrix. 
SchurC <- function(Ibb, Iaa, Iba) {
    .Call('_BinReg_SchurC', PACKAGE = 'BinReg', Ibb, Iaa, Iba)
}

#' Matrix Trace
#'
#' Calculates the trace of a matrix \eqn{A}.
#'
#' @param A Numeric matrix.
#' @return Scalar. 
tr <- function(A) {
    .Call('_BinReg_tr', PACKAGE = 'BinReg', A)
}
zrmacc/BinReg documentation built on May 9, 2019, 8:08 a.m.