fix: typos (in Doc comments)
This commit is contained in:
parent
92b1a49d2b
commit
10ae55bd81
|
@ -43,7 +43,7 @@
|
||||||
#' supplied.
|
#' supplied.
|
||||||
#' @param method specifies the CVE method variation as one of
|
#' @param method specifies the CVE method variation as one of
|
||||||
#' \itemize{
|
#' \itemize{
|
||||||
#' \item "simple" exact implementation as describet in the paper listed
|
#' \item "simple" exact implementation as described in the paper listed
|
||||||
#' below.
|
#' below.
|
||||||
#' \item "weighted" variation with addaptive weighting of slices.
|
#' \item "weighted" variation with addaptive weighting of slices.
|
||||||
#' }
|
#' }
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
#' dr <- cve(Y ~ X)
|
#' dr <- cve(Y ~ X)
|
||||||
#' round(dr[[2]]$B, 1)
|
#' 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}}].
|
#' [\code{\link{formula}}].
|
||||||
#' @export
|
#' @export
|
||||||
cve <- function(formula, data, method = "simple", max.dim = 10L, ...) {
|
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
|
#' @param nObs parameter for choosing bandwidth \code{h} using
|
||||||
#' \code{\link{estimate.bandwidth}} (ignored if \code{h} is supplied).
|
#' \code{\link{estimate.bandwidth}} (ignored if \code{h} is supplied).
|
||||||
#' @param X data matrix with samples in its rows.
|
#' @param X data matrix with samples in its rows.
|
||||||
#' @param Y Responces (1 dimensional).
|
#' @param Y Responses (1 dimensional).
|
||||||
#' @param k Dimension of lower dimensional projection, if given only the
|
#' @param k Dimension of lower dimensional projection, if \code{k} is given only the specified dimension \code{B} matrix is estimated.
|
||||||
#' specified dimension is estimated.
|
|
||||||
#' @param min.dim lower bounds for \code{k}, (ignored if \code{k} is supplied).
|
#' @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 max.dim upper bounds for \code{k}, (ignored if \code{k} is supplied).
|
||||||
#' @param tau Initial step-size.
|
#' @param tau Initial step-size.
|
||||||
#' @param tol Tolerance for break condition.
|
#' @param tol Tolerance for break condition.
|
||||||
#' @param epochs maximum number of optimization steps.
|
#' @param epochs maximum number of optimization steps.
|
||||||
#' @param attempts number of arbitrary different starting points.
|
#' @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
|
#' @rdname cve
|
||||||
#' @export
|
#' @export
|
||||||
cve.call <- function(X, Y, method = "simple",
|
cve.call <- function(X, Y, method = "simple",
|
||||||
|
@ -235,7 +234,7 @@ cve.call <- function(X, Y, method = "simple",
|
||||||
return(dr)
|
return(dr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#' Loss distribution kink plot.
|
#' Loss distribution elbow plot.
|
||||||
#'
|
#'
|
||||||
#' @param x Object of class \code{"cve"} (result of [\code{\link{cve}}]).
|
#' @param x Object of class \code{"cve"} (result of [\code{\link{cve}}]).
|
||||||
#' @param ... Pass through parameters to [\code{\link{plot}}] and
|
#' @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.
|
#' as well as \code{\link{plot}}, the standard plot utility.
|
||||||
#' @importFrom graphics plot lines points
|
#' @importFrom graphics plot lines points
|
||||||
#' @method plot cve
|
#' @method plot cve
|
||||||
|
#' Boxplots of the loss from \code{min.dim} to \code{max.dim} \code{k} values.
|
||||||
#' @export
|
#' @export
|
||||||
plot.cve <- function(x, ...) {
|
plot.cve <- function(x, ...) {
|
||||||
L <- c()
|
L <- c()
|
||||||
|
@ -256,7 +256,7 @@ plot.cve <- function(x, ...) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
L <- matrix(L, ncol = length(k)) / var(x$Y)
|
L <- matrix(L, ncol = length(k)) / var(x$Y)
|
||||||
boxplot(L, main = "Kink plot",
|
boxplot(L, main = "elbow plot",
|
||||||
xlab = "SDR dimension",
|
xlab = "SDR dimension",
|
||||||
ylab = "Sample loss distribution",
|
ylab = "Sample loss distribution",
|
||||||
names = k)
|
names = k)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#' Generates test datasets.
|
#' Generates test datasets.
|
||||||
#'
|
#'
|
||||||
#' Provides sample datasets. There are 5 different datasets named
|
#' 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:
|
#' The general model is given by:
|
||||||
#' \deqn{Y ~ g(B'X) + \epsilon}
|
#' \deqn{Y ~ g(B'X) + \epsilon}
|
||||||
#'
|
#'
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
#' Bandwidth estimation for CVE.
|
#' Bandwidth estimation for CVE.
|
||||||
#'
|
#'
|
||||||
#' Estimates a propper bandwidth \code{h} according
|
#' Estimates a bandwidth \code{h} according
|
||||||
#' \deqn{%
|
#' \deqn{%
|
||||||
#' h = \chi_{k}^{-1}\left(\frac{nObs - 1}{n-1}\right)\frac{2 tr(\Sigma)}{p}}{%
|
#' 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)}
|
#' 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}
|
#' (\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 X data matrix with samples in its rows.
|
||||||
#' @param k Dimension of lower dimensional projection.
|
#' @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}}]
|
#' @seealso [\code{\link{qchisq}}]
|
||||||
#' @export
|
#' @export
|
||||||
|
|
|
@ -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 p row dimension
|
||||||
#' @param q col dim.
|
#' @param q col dimension
|
||||||
#' @return `(p, q)` semi-orthogonal matrix
|
#' @return \code{p} times \code{q} semi-orthogonal matrix.
|
||||||
#' @examples
|
#' @examples
|
||||||
#' V <- rStiefel(6, 4)
|
#' V <- rStiefel(6, 4)
|
||||||
#' @export
|
#' @export
|
||||||
|
|
|
@ -20,7 +20,7 @@ supplied.}
|
||||||
|
|
||||||
\item{method}{specifies the CVE method variation as one of
|
\item{method}{specifies the CVE method variation as one of
|
||||||
\itemize{
|
\itemize{
|
||||||
\item "simple" exact implementation as describet in the paper listed
|
\item "simple" exact implementation as described in the paper listed
|
||||||
below.
|
below.
|
||||||
\item "weighted" variation with addaptive weighting of slices.
|
\item "weighted" variation with addaptive weighting of slices.
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -28,7 +28,7 @@ List with elements
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Provides sample datasets. There are 5 different datasets named
|
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:
|
The general model is given by:
|
||||||
\deqn{Y ~ g(B'X) + \epsilon}
|
\deqn{Y ~ g(B'X) + \epsilon}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
% Please edit documentation in R/CVE.R
|
% Please edit documentation in R/CVE.R
|
||||||
\name{plot.cve}
|
\name{plot.cve}
|
||||||
\alias{plot.cve}
|
\alias{plot.cve}
|
||||||
\title{Creates a kink plot of the sample loss distribution over SDR dimensions.}
|
\title{Loss distribution elbow plot.}
|
||||||
\usage{
|
\usage{
|
||||||
\method{plot}{cve}(x, ...)
|
\method{plot}{cve}(x, ...)
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
[\code{\link{lines}}]}
|
[\code{\link{lines}}]}
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Creates a kink plot of the sample loss distribution over SDR dimensions.
|
Loss distribution elbow plot.
|
||||||
}
|
}
|
||||||
\seealso{
|
\seealso{
|
||||||
see \code{\link{par}} for graphical parameters to pass through
|
see \code{\link{par}} for graphical parameters to pass through
|
||||||
|
|
|
@ -76,7 +76,7 @@ cve <- function(formula, data, method = "simple", max.dim = 10L, ...) {
|
||||||
return(dr)
|
return(dr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @param nObs as describet in the Paper.
|
#' @param nObs as described in the Paper.
|
||||||
#' @param X Data
|
#' @param X Data
|
||||||
#' @param Y Responces
|
#' @param Y Responces
|
||||||
#' @param nObs Like in the paper.
|
#' @param nObs Like in the paper.
|
||||||
|
|
|
@ -142,7 +142,7 @@ cve_rcg <- function(X, Y, k,
|
||||||
|
|
||||||
# Reset beta if needed.
|
# Reset beta if needed.
|
||||||
if (loss.prime < 0) {
|
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.FR <- (norm(A, type = 'F') / norm(A.last, type = 'F'))^2
|
||||||
beta.PR <- sum(A * (A - A.last)) / norm(A.last, type = 'F')^2
|
beta.PR <- sum(A * (A - A.last)) / norm(A.last, type = 'F')^2
|
||||||
if (beta.PR < -beta.FR) {
|
if (beta.PR < -beta.FR) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#' Generates test datasets.
|
#' Generates test datasets.
|
||||||
#'
|
#'
|
||||||
#' Provides sample datasets. There are 5 different datasets named
|
#' 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:
|
#' The general model is given by:
|
||||||
#' \deqn{Y ~ g(B'X) + \epsilon}
|
#' \deqn{Y ~ g(B'X) + \epsilon}
|
||||||
#'
|
#'
|
||||||
|
|
|
@ -30,7 +30,7 @@ See: \code{\link{formula}}.}
|
||||||
|
|
||||||
\item{Y}{Responces}
|
\item{Y}{Responces}
|
||||||
|
|
||||||
\item{nObs}{as describet in the Paper.}
|
\item{nObs}{as described in the Paper.}
|
||||||
|
|
||||||
\item{k}{guess for SDR dimension.}
|
\item{k}{guess for SDR dimension.}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ List with elements
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Provides sample datasets. There are 5 different datasets named
|
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:
|
The general model is given by:
|
||||||
\deqn{Y ~ g(B'X) + \epsilon}
|
\deqn{Y ~ g(B'X) + \epsilon}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue