2019-12-10 07:45:07 +00:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
% Please edit documentation in R/predict_dim.R
|
|
|
|
\name{predict_dim}
|
|
|
|
\alias{predict_dim}
|
2020-02-26 15:43:57 +00:00
|
|
|
\title{Estimate Dimension of the Sufficient Reduction.}
|
2019-12-10 07:45:07 +00:00
|
|
|
\usage{
|
2019-12-16 16:34:35 +00:00
|
|
|
predict_dim(object, ..., method = "CV")
|
2019-12-10 07:45:07 +00:00
|
|
|
}
|
|
|
|
\arguments{
|
2019-12-20 08:40:46 +00:00
|
|
|
\item{object}{an object of class \code{"cve"}, usually, a result of a call to
|
|
|
|
\code{\link{cve}} or \code{\link{cve.call}}.}
|
2019-12-10 07:45:07 +00:00
|
|
|
|
|
|
|
\item{...}{ignored.}
|
2019-12-16 16:34:35 +00:00
|
|
|
|
2020-02-26 15:43:57 +00:00
|
|
|
\item{method}{This parameter specifies which method is used in dimension
|
|
|
|
estimation. It provides three options: \code{'CV'} (default),
|
|
|
|
\code{'elbow'} and \code{'wilcoxon'}.}
|
2019-12-10 07:45:07 +00:00
|
|
|
}
|
|
|
|
\value{
|
2020-02-26 15:43:57 +00:00
|
|
|
A \code{list} with
|
2019-12-17 20:43:14 +00:00
|
|
|
\describe{
|
2020-02-26 15:43:57 +00:00
|
|
|
\item{}{criterion for method and \code{k = min.dim, ..., max.dim}.}
|
|
|
|
\item{k}{estimated dimension is the minimizer of the criterion.}
|
2019-12-10 07:45:07 +00:00
|
|
|
}
|
2019-12-16 16:34:35 +00:00
|
|
|
}
|
2019-12-17 20:43:14 +00:00
|
|
|
\description{
|
2020-02-26 15:43:57 +00:00
|
|
|
This function estimates the dimension, i.e. the rank of \eqn{B}. The default
|
|
|
|
method \code{'CV'} performs leave-one-out (LOO) cross-validation using
|
|
|
|
\code{mars} as follows for \code{k = min.dim, ..., max.dim} a
|
|
|
|
cross-validation via \code{mars} is
|
2019-12-20 08:40:46 +00:00
|
|
|
performed on the dataset \eqn{(Y_i, B_k' X_i)_{i = 1, ..., n}} where
|
|
|
|
\eqn{B_k} is the \eqn{p \times k}{p x k} dimensional CVE estimate. The
|
|
|
|
estimated SDR dimension is the \eqn{k} where the
|
|
|
|
cross-validation mean squared error is minimal. The method \code{'elbow'}
|
|
|
|
estimates the dimension via \eqn{k = argmin_k L_n(V_{p - k})} where
|
2020-02-26 15:43:57 +00:00
|
|
|
\eqn{V_{p - k}} is the space that is orthogonal to the column space of the
|
|
|
|
CVE estimate of \eqn{B_k}. Method \code{'wilcoxon'} finds the minimum using
|
|
|
|
the Wilcoxon test.
|
2019-12-16 16:34:35 +00:00
|
|
|
}
|
2019-12-10 07:45:07 +00:00
|
|
|
\examples{
|
|
|
|
# create B for simulation
|
|
|
|
B <- rep(1, 5) / sqrt(5)
|
|
|
|
|
|
|
|
set.seed(21)
|
|
|
|
# creat predictor data x ~ N(0, I_p)
|
|
|
|
x <- matrix(rnorm(500), 100)
|
|
|
|
|
|
|
|
# simulate response variable
|
|
|
|
# y = f(B'x) + err
|
|
|
|
# with f(x1) = x1 and err ~ N(0, 0.25^2)
|
|
|
|
y <- x \%*\% B + 0.25 * rnorm(100)
|
|
|
|
|
|
|
|
# Calculate cve for unknown k between min.dim and max.dim.
|
2021-03-05 13:52:45 +00:00
|
|
|
cve.obj.simple <- cve(y ~ x)
|
2019-12-10 07:45:07 +00:00
|
|
|
|
|
|
|
predict_dim(cve.obj.simple)
|
|
|
|
|
|
|
|
}
|