diff --git a/CVE_C/R/CVE.R b/CVE_C/R/CVE.R index 0537bb7..842fe0f 100644 --- a/CVE_C/R/CVE.R +++ b/CVE_C/R/CVE.R @@ -43,7 +43,7 @@ #' supplied. #' @param method specifies the CVE method variation as one of #' \itemize{ -#' \item "simple" exact implementation as describet in the paper listed +#' \item "simple" exact implementation as described in the paper listed #' below. #' \item "weighted" variation with addaptive weighting of slices. #' } @@ -63,7 +63,7 @@ #' dr <- cve(Y ~ X) #' round(dr[[2]]$B, 1) #' -#' @seealso For a detailed description of the formula parameter see +#' @seealso For a detailed description of \code{formula} see #' [\code{\link{formula}}]. #' @export cve <- function(formula, data, method = "simple", max.dim = 10L, ...) { @@ -90,16 +90,15 @@ cve <- function(formula, data, method = "simple", max.dim = 10L, ...) { #' @param nObs parameter for choosing bandwidth \code{h} using #' \code{\link{estimate.bandwidth}} (ignored if \code{h} is supplied). #' @param X data matrix with samples in its rows. -#' @param Y Responces (1 dimensional). -#' @param k Dimension of lower dimensional projection, if given only the -#' specified dimension is estimated. +#' @param Y Responses (1 dimensional). +#' @param k Dimension of lower dimensional projection, if \code{k} is given only the specified dimension \code{B} matrix is estimated. #' @param min.dim lower bounds for \code{k}, (ignored if \code{k} is supplied). #' @param max.dim upper bounds for \code{k}, (ignored if \code{k} is supplied). #' @param tau Initial step-size. #' @param tol Tolerance for break condition. #' @param epochs maximum number of optimization steps. #' @param attempts number of arbitrary different starting points. -#' @param logger a logger function (only for addvanced user). +#' @param logger a logger function (only for advanced user, significantly slows down the computation). #' @rdname cve #' @export cve.call <- function(X, Y, method = "simple", @@ -235,7 +234,7 @@ cve.call <- function(X, Y, method = "simple", return(dr) } -#' Loss distribution kink plot. +#' Loss distribution elbow plot. #' #' @param x Object of class \code{"cve"} (result of [\code{\link{cve}}]). #' @param ... Pass through parameters to [\code{\link{plot}}] and @@ -245,6 +244,7 @@ cve.call <- function(X, Y, method = "simple", #' as well as \code{\link{plot}}, the standard plot utility. #' @importFrom graphics plot lines points #' @method plot cve +#' Boxplots of the loss from \code{min.dim} to \code{max.dim} \code{k} values. #' @export plot.cve <- function(x, ...) { L <- c() @@ -256,7 +256,7 @@ plot.cve <- function(x, ...) { } } L <- matrix(L, ncol = length(k)) / var(x$Y) - boxplot(L, main = "Kink plot", + boxplot(L, main = "elbow plot", xlab = "SDR dimension", ylab = "Sample loss distribution", names = k) diff --git a/CVE_C/R/datasets.R b/CVE_C/R/datasets.R index 1e9380d..0f84299 100644 --- a/CVE_C/R/datasets.R +++ b/CVE_C/R/datasets.R @@ -1,7 +1,7 @@ #' Generates test datasets. #' #' Provides sample datasets. There are 5 different datasets named -#' M1, M2, M3, M4 and M5 describet in the paper references below. +#' M1, M2, M3, M4 and M5 described in the paper references below. #' The general model is given by: #' \deqn{Y ~ g(B'X) + \epsilon} #' diff --git a/CVE_C/R/estimateBandwidth.R b/CVE_C/R/estimateBandwidth.R index b03538e..a5a984d 100644 --- a/CVE_C/R/estimateBandwidth.R +++ b/CVE_C/R/estimateBandwidth.R @@ -1,16 +1,16 @@ #' Bandwidth estimation for CVE. #' -#' Estimates a propper bandwidth \code{h} according +#' Estimates a bandwidth \code{h} according #' \deqn{% #' h = \chi_{k}^{-1}\left(\frac{nObs - 1}{n-1}\right)\frac{2 tr(\Sigma)}{p}}{% #' h = qchisq( (nObs - 1)/(n - 1), k ) * (2 tr(\Sigma) / p)} -#' with \eqn{n} the number of sample and \eqn{p} its dimension +#' with \eqn{n} the sample size, \eqn{p} its dimension #' (\code{n <- nrow(X); p <- ncol(X)}) and the covariance-matrix \eqn{\Sigma} -#' which is given by the standard maximum likelihood estimate. +#' which is \code{(n-1)/n} times the sample covariance estimate. #' -#' @param nObs Expected number of points in a slice, see paper. #' @param X data matrix with samples in its rows. #' @param k Dimension of lower dimensional projection. +#' @param nObs number of points in a slice, see \eqn{nObs} in CVE paper. #' #' @seealso [\code{\link{qchisq}}] #' @export diff --git a/CVE_C/R/util.R b/CVE_C/R/util.R index b114fc0..3a42ceb 100644 --- a/CVE_C/R/util.R +++ b/CVE_C/R/util.R @@ -1,8 +1,8 @@ -#' Samples uniform from the Stiefl Manifold. +#' Draws a sample from the invariant measure on the Stiefel manifold \eqn{S(p, q)}. #' -#' @param p row dim. -#' @param q col dim. -#' @return `(p, q)` semi-orthogonal matrix +#' @param p row dimension +#' @param q col dimension +#' @return \code{p} times \code{q} semi-orthogonal matrix. #' @examples #' V <- rStiefel(6, 4) #' @export diff --git a/CVE_C/man/cve.Rd b/CVE_C/man/cve.Rd index 03674d0..3f71f62 100644 --- a/CVE_C/man/cve.Rd +++ b/CVE_C/man/cve.Rd @@ -20,7 +20,7 @@ supplied.} \item{method}{specifies the CVE method variation as one of \itemize{ - \item "simple" exact implementation as describet in the paper listed + \item "simple" exact implementation as described in the paper listed below. \item "weighted" variation with addaptive weighting of slices. }} diff --git a/CVE_C/man/dataset.Rd b/CVE_C/man/dataset.Rd index d68db13..9ce9e6e 100644 --- a/CVE_C/man/dataset.Rd +++ b/CVE_C/man/dataset.Rd @@ -28,7 +28,7 @@ List with elements } \description{ Provides sample datasets. There are 5 different datasets named -M1, M2, M3, M4 and M5 describet in the paper references below. +M1, M2, M3, M4 and M5 described in the paper references below. The general model is given by: \deqn{Y ~ g(B'X) + \epsilon} } diff --git a/CVE_C/man/plot.cve.Rd b/CVE_C/man/plot.cve.Rd index 1fd71b2..16d511e 100644 --- a/CVE_C/man/plot.cve.Rd +++ b/CVE_C/man/plot.cve.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/CVE.R \name{plot.cve} \alias{plot.cve} -\title{Creates a kink plot of the sample loss distribution over SDR dimensions.} +\title{Loss distribution elbow plot.} \usage{ \method{plot}{cve}(x, ...) } @@ -13,7 +13,7 @@ [\code{\link{lines}}]} } \description{ -Creates a kink plot of the sample loss distribution over SDR dimensions. +Loss distribution elbow plot. } \seealso{ see \code{\link{par}} for graphical parameters to pass through diff --git a/CVE_R/R/CVE.R b/CVE_R/R/CVE.R index df42ed6..c0ec00a 100644 --- a/CVE_R/R/CVE.R +++ b/CVE_R/R/CVE.R @@ -76,7 +76,7 @@ cve <- function(formula, data, method = "simple", max.dim = 10L, ...) { return(dr) } -#' @param nObs as describet in the Paper. +#' @param nObs as described in the Paper. #' @param X Data #' @param Y Responces #' @param nObs Like in the paper. diff --git a/CVE_R/R/cve_rcg.R b/CVE_R/R/cve_rcg.R index f1cc8fa..0a459f5 100644 --- a/CVE_R/R/cve_rcg.R +++ b/CVE_R/R/cve_rcg.R @@ -142,7 +142,7 @@ cve_rcg <- function(X, Y, k, # Reset beta if needed. if (loss.prime < 0) { - # Compute `beta` as describet in paper. + # Compute `beta` as described in paper. beta.FR <- (norm(A, type = 'F') / norm(A.last, type = 'F'))^2 beta.PR <- sum(A * (A - A.last)) / norm(A.last, type = 'F')^2 if (beta.PR < -beta.FR) { diff --git a/CVE_R/R/datasets.R b/CVE_R/R/datasets.R index 68af0f4..70e08b5 100644 --- a/CVE_R/R/datasets.R +++ b/CVE_R/R/datasets.R @@ -1,7 +1,7 @@ #' Generates test datasets. #' #' Provides sample datasets. There are 5 different datasets named -#' M1, M2, M3, M4 and M5 describet in the paper references below. +#' M1, M2, M3, M4 and M5 described in the paper references below. #' The general model is given by: #' \deqn{Y ~ g(B'X) + \epsilon} #' diff --git a/CVE_R/man/cve.Rd b/CVE_R/man/cve.Rd index d3e0d05..07d86a2 100644 --- a/CVE_R/man/cve.Rd +++ b/CVE_R/man/cve.Rd @@ -30,7 +30,7 @@ See: \code{\link{formula}}.} \item{Y}{Responces} -\item{nObs}{as describet in the Paper.} +\item{nObs}{as described in the Paper.} \item{k}{guess for SDR dimension.} diff --git a/CVE_R/man/dataset.Rd b/CVE_R/man/dataset.Rd index da7be5b..8e65402 100644 --- a/CVE_R/man/dataset.Rd +++ b/CVE_R/man/dataset.Rd @@ -28,7 +28,7 @@ List with elements } \description{ Provides sample datasets. There are 5 different datasets named -M1, M2, M3, M4 and M5 describet in the paper references below. +M1, M2, M3, M4 and M5 described in the paper references below. The general model is given by: \deqn{Y ~ g(B'X) + \epsilon} }