Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Github actions. * Roxygen * package logo
- Loading branch information
Showing
120 changed files
with
6,316 additions
and
3,563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
^genlogo.R$ | ||
#All packages | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^\.gitignore$ | ||
^NEWS$ | ||
#For the pkgdown website | ||
^pkgdown*$ | ||
^docs*$ | ||
#For the cached chunks of README.Rmd | ||
^cache*$ | ||
^README_cache*$ | ||
#If README too big, not on CRAN but only on git | ||
^man/figures*$ | ||
^README\.Rmd$ | ||
^README\.md$ | ||
#If README too big, not on CRAN but only on git | ||
#^man/figures*$ | ||
#^README\.md$ | ||
#Specific | ||
^fullrespdf*$ | ||
^inst/animation*$ | ||
^\.github$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. | ||
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
name: R-CMD-check | ||
|
||
jobs: | ||
R-CMD-check: | ||
runs-on: macOS-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: r-lib/actions/setup-r@v1 | ||
- name: Install dependencies | ||
run: | | ||
install.packages(c("remotes", "rcmdcheck")) | ||
remotes::install_deps(dependencies = TRUE) | ||
shell: Rscript {0} | ||
- name: Check | ||
run: | | ||
options(crayon.enabled = TRUE) | ||
rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") | ||
shell: Rscript {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
import(MASS) | ||
|
||
importFrom("graphics", "plot") | ||
importFrom("stats", "coef", "cor", "sd") | ||
|
||
## and exported functions | ||
export(benchmark.pls,coef.plsdof,dA,dvvtz,information.criteria,krylov,normalize,pcr,pls.dof,pls.model,tr,vvtz,benchmark.regression,compute.lower.bound,dnormalize,first.local.minimum, kernel.pls.fit, linear.pls.fit, pcr.cv,pls.cv, pls.ic, ridge.cv,vcov.plsdof) | ||
|
||
S3method(coef, plsdof) | ||
S3method(vcov, plsdof) | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
S3method(coef,plsdof) | ||
S3method(vcov,plsdof) | ||
export(benchmark.pls) | ||
export(benchmark.regression) | ||
export(compute.lower.bound) | ||
export(dA) | ||
export(dnormalize) | ||
export(dvvtz) | ||
export(first.local.minimum) | ||
export(information.criteria) | ||
export(kernel.pls.fit) | ||
export(krylov) | ||
export(linear.pls.fit) | ||
export(normalize) | ||
export(pcr) | ||
export(pcr.cv) | ||
export(pls.cv) | ||
export(pls.dof) | ||
export(pls.ic) | ||
export(pls.model) | ||
export(ridge.cv) | ||
export(tr) | ||
export(vvtz) | ||
import(MASS) | ||
importFrom(graphics,plot) | ||
importFrom(stats,coef) | ||
importFrom(stats,cor) | ||
importFrom(stats,sd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# plsdof 0.3-0 | ||
|
||
* Github actions. | ||
* Roxygen | ||
|
||
# plsdof 0.2-9 | ||
|
||
* Added a website for the package. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,40 @@ | ||
#' Regression coefficients | ||
#' | ||
#' This function returns the regression coefficients of a plsdof-object. | ||
#' | ||
#' The function returns the regression coefficients (without intercept) for the | ||
#' optimal number of components. | ||
#' | ||
#' @param object an object of class "plsdof" that is returned by the functions | ||
#' \code{pls.ic} and \code{pls.cv}. | ||
#' @param ... additional parameters | ||
#' @return regression coefficients. | ||
#' @author Nicole Kraemer | ||
#' @seealso \code{\link{vcov.plsdof}}, \code{\link{pls.model}}, | ||
#' \code{\link{pls.ic}}, \code{\link{pls.cv}} | ||
#' @references | ||
#' | ||
#' Kraemer, N., Sugiyama M. (2011). "The Degrees of Freedom of Partial Least | ||
#' Squares Regression". Journal of the American Statistical Association 106 | ||
#' (494) \url{https://www.tandfonline.com/doi/abs/10.1198/jasa.2011.tm10107} | ||
#' | ||
#' Kraemer, N., Braun, M.L. (2007) "Kernelizing PLS, Degrees of Freedom, and | ||
#' Efficient Model Selection", Proceedings of the 24th International Conference | ||
#' on Machine Learning, Omni Press, 441 - 448 | ||
#' @keywords models | ||
#' @examples | ||
#' | ||
#' | ||
#' n<-50 # number of observations | ||
#' p<-5 # number of variables | ||
#' X<-matrix(rnorm(n*p),ncol=p) | ||
#' y<-rnorm(n) | ||
#' | ||
#' | ||
#' pls.object<-pls.ic(X,y,criterion="bic") | ||
#' mycoef<-coef(pls.object) | ||
#' | ||
#' @export | ||
coef.plsdof=function(object,...){ | ||
return(object$coefficients) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
#' Derivative of normalization function | ||
#' | ||
#' This function computes the derivative of the function \deqn{v\mapsto | ||
#' \frac{w}{\|w\|_A}} with respect to y. | ||
#' | ||
#' The first derivative of the normalization operator is | ||
#' \deqn{\frac{\partial}{\partial y}\left(w\mapsto | ||
#' \frac{w}{\|w\|_A}\right)=\frac{1}{\|w\|}\left(I_n - \frac{w w^ \top | ||
#' A}{w^\top w}\right) \frac{\partial w}{\partial y}} | ||
#' | ||
#' @param w vector of length n. | ||
#' @param A square matrix that defines the norm | ||
#' @param dw derivative of w with respect to y. As y is a vector of length n, | ||
#' the derivative is a matrix of size nxn. | ||
#' @return the Jacobian matrix of the normalization function. This is a matrix | ||
#' of size nxn. | ||
#' @author Nicole Kraemer | ||
#' @seealso \code{\link{normalize}}, \code{\link{dnormalize}} | ||
#' @references Kraemer, N., Sugiyama M. (2011). "The Degrees of Freedom of | ||
#' Partial Least Squares Regression". Journal of the American Statistical | ||
#' Association 106 (494) | ||
#' \url{https://www.tandfonline.com/doi/abs/10.1198/jasa.2011.tm10107} | ||
#' | ||
#' Kraemer, N., Braun, M.L. (2007) "Kernelizing PLS, Degrees of Freedom, and | ||
#' Efficient Model Selection", Proceedings of the 24th International Conference | ||
#' on Machine Learning, Omni Press, 441 - 448 | ||
#' @keywords math | ||
#' @examples | ||
#' | ||
#' w<-rnorm(15) | ||
#' dw<-diag(15) | ||
#' A<-diag(1:15) | ||
#' d.object<-dA(w,A,dw) | ||
#' | ||
#' @export dA | ||
dA<-function(w,A,dw){ | ||
wa<-sqrt(sum((w*(A%*%w)))) | ||
dummy<-(1/wa)*(diag(length(w))- w%*%t(w)%*%A/(wa^2))%*%dw | ||
return(dummy) | ||
} | ||
} |
Oops, something went wrong.