diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index 03c395c..30655f3 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -1,5 +1,5 @@
-Contributor Code of Conduct • xrnetContributor Code of Conduct • xrnet
diff --git a/authors.html b/authors.html
index 2b3d36b..b2bd727 100644
--- a/authors.html
+++ b/authors.html
@@ -1,5 +1,5 @@
-Authors and Citation • xrnetAuthors and Citation • xrnet
@@ -66,13 +66,13 @@ Citation
Weaver G, Shen D (2024).
xrnet: Hierarchical Regularized Regression.
-R package version 0.1.7, https://github.com/USCbiostats/xrnet.
+R package version 0.1.7, https://uscbiostats.github.io/xrnet/, https://github.com/USCbiostats/xrnet.
@Manual{,
title = {xrnet: Hierarchical Regularized Regression},
author = {Garrett Weaver and Dixin Shen},
year = {2024},
- note = {R package version 0.1.7},
+ note = {R package version 0.1.7, https://uscbiostats.github.io/xrnet/},
url = {https://github.com/USCbiostats/xrnet},
}
diff --git a/index.html b/index.html
index 8da2c8d..d4c2225 100644
--- a/index.html
+++ b/index.html
@@ -19,7 +19,7 @@
-
+
Changelog • xrnetChangelog • xrnet
diff --git a/pkgdown.yml b/pkgdown.yml
index de427da..d7a3384 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -2,5 +2,8 @@ pandoc: 3.1.11
pkgdown: 2.0.9
pkgdown_sha: ~
articles: {}
-last_built: 2024-06-26T05:21Z
+last_built: 2024-06-26T05:28Z
+urls:
+ reference: https://uscbiostats.github.io/xrnet/reference
+ article: https://uscbiostats.github.io/xrnet/articles
diff --git a/reference/coef.tune_xrnet.html b/reference/coef.tune_xrnet.html
index 23d3383..e3083b1 100644
--- a/reference/coef.tune_xrnet.html
+++ b/reference/coef.tune_xrnet.html
@@ -3,7 +3,7 @@
only support returning coefficient estimates that are in the original
path(s).">
Get coefficient estimates from "tune_xrnet" model object. — coef.tune_xrnet • xrnet
diff --git a/reference/coef.xrnet.html b/reference/coef.xrnet.html
index 0f09637..4ed6335 100644
--- a/reference/coef.xrnet.html
+++ b/reference/coef.xrnet.html
@@ -3,7 +3,7 @@
only support returning coefficient estimates that are in the original
path(s).">
Get coefficient estimates from "xrnet" model object. — coef.xrnet • xrnet
diff --git a/reference/define_enet.html b/reference/define_enet.html
index c483e77..6b363c0 100644
--- a/reference/define_enet.html
+++ b/reference/define_enet.html
@@ -1,7 +1,7 @@
Define elastic net regularization object for predictor and external data — define_enet • xrnet
diff --git a/reference/define_lasso.html b/reference/define_lasso.html
index 394989c..8ed801b 100644
--- a/reference/define_lasso.html
+++ b/reference/define_lasso.html
@@ -1,7 +1,7 @@
Define lasso regularization object for predictor and external data — define_lasso • xrnet
diff --git a/reference/define_penalty.html b/reference/define_penalty.html
index 627d6e3..09c76ec 100644
--- a/reference/define_penalty.html
+++ b/reference/define_penalty.html
@@ -3,7 +3,7 @@
variables in xrnet fitting. Use helper functions define_lasso,
define_ridge, or define_enet to specify a common penalty on x or external.">
Define regularization object for predictor and external data. — define_penalty • xrnet
diff --git a/reference/define_ridge.html b/reference/define_ridge.html
index 7c6f77f..05b7511 100644
--- a/reference/define_ridge.html
+++ b/reference/define_ridge.html
@@ -1,7 +1,7 @@
Define ridge regularization object for predictor and external data — define_ridge • xrnet
diff --git a/reference/ext_linear.html b/reference/ext_linear.html
index 8768b2f..dfd5e62 100644
--- a/reference/ext_linear.html
+++ b/reference/ext_linear.html
@@ -1,5 +1,5 @@
-
Simulated external data — ext_linear • xrnetSimulated external data — ext_linear • xrnet
diff --git a/reference/index.html b/reference/index.html
index 4d41cc4..1dd08c6 100644
--- a/reference/index.html
+++ b/reference/index.html
@@ -1,5 +1,5 @@
-
Function reference • xrnetFunction reference • xrnet
diff --git a/reference/plot.tune_xrnet.html b/reference/plot.tune_xrnet.html
index 01ad4a7..9be027d 100644
--- a/reference/plot.tune_xrnet.html
+++ b/reference/plot.tune_xrnet.html
@@ -11,7 +11,7 @@
external data was used in the model fit, a contour plot of the
cross-validated errors is created. Error curves can also be generated for a
fixed value of the primary penalty on x (p) or the external penalty (pext)
-when external data is used.">
diff --git a/reference/predict.tune_xrnet.html b/reference/predict.tune_xrnet.html
index 697e315..e8b9c82 100644
--- a/reference/predict.tune_xrnet.html
+++ b/reference/predict.tune_xrnet.html
@@ -3,7 +3,7 @@
fitted model from a tune_xrnet object. Note that we currently
only support returning results that are in the original path(s).">
Predict function for "tune_xrnet" object — predict.tune_xrnet • xrnet
diff --git a/reference/predict.xrnet.html b/reference/predict.xrnet.html
index 74cdf07..1289e3a 100644
--- a/reference/predict.xrnet.html
+++ b/reference/predict.xrnet.html
@@ -3,7 +3,7 @@
fitted model from an xrnet object. Note that we currently only
support returning coefficient estimates that are in the original path(s).">
Predict function for "xrnet" object — predict.xrnet • xrnet
diff --git a/reference/tune_xrnet.html b/reference/tune_xrnet.html
index 8717c8e..d081b22 100644
--- a/reference/tune_xrnet.html
+++ b/reference/tune_xrnet.html
@@ -1,7 +1,7 @@
k-fold cross-validation for hierarchical regularized regression — tune_xrnet • xrnet
diff --git a/reference/x_linear.html b/reference/x_linear.html
index 2ad9fc6..6a93d4f 100644
--- a/reference/x_linear.html
+++ b/reference/x_linear.html
@@ -1,5 +1,5 @@
-
Simulated example data for hierarchical regularized linear regression — x_linear • xrnetSimulated example data for hierarchical regularized linear regression — x_linear • xrnet
diff --git a/reference/xrnet.html b/reference/xrnet.html
index 5f4cc94..be3da0e 100644
--- a/reference/xrnet.html
+++ b/reference/xrnet.html
@@ -13,7 +13,7 @@
grid of penalties (a separate penalty path is computed for the predictors and
external variables). Currently support regularized linear and logistic
regression, future extensions to other outcomes (i.e. Cox regression) will be
-implemented in the next major update.">
diff --git a/reference/xrnet_control.html b/reference/xrnet_control.html
index 8ee74ea..3c63c3c 100644
--- a/reference/xrnet_control.html
+++ b/reference/xrnet_control.html
@@ -1,5 +1,5 @@
-
Control function for xrnet fitting — xrnet_control • xrnetControl function for xrnet fitting — xrnet_control • xrnet
diff --git a/reference/y_linear.html b/reference/y_linear.html
index 4f5e10e..977abcd 100644
--- a/reference/y_linear.html
+++ b/reference/y_linear.html
@@ -1,5 +1,5 @@
-
Simulated outcome data — y_linear • xrnetSimulated outcome data — y_linear • xrnet
diff --git a/search.json b/search.json
index 3ac64f3..03fc5f1 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"/CODE_OF_CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (http://contributor-covenant.org), version 1.0.0, available http://contributor-covenant.org/version/1/0/0/","code":""},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Garrett Weaver. Author, maintainer. Dixin Shen. Author. Juan Pablo Lewinger. Contributor, thesis advisor.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Weaver G, Shen D (2024). xrnet: Hierarchical Regularized Regression. R package version 0.1.7, https://github.com/USCbiostats/xrnet.","code":"@Manual{, title = {xrnet: Hierarchical Regularized Regression}, author = {Garrett Weaver and Dixin Shen}, year = {2024}, note = {R package version 0.1.7}, url = {https://github.com/USCbiostats/xrnet}, }"},{"path":[]},{"path":"/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Hierarchical Regularized Regression","text":"xrnet R package extension regularized regression (.e. ridge regression) enables incorporation external data may informative effects predictors outcome interest. Let y n-dimensional observed outcome vector, X set p potential predictors observed n observations, Z set q external features available p predictors. model builds standard two-level hierarchical regression model, allows regularization predictors external features, beta vector coefficients describing association predictor outcome alpha vector coefficients describing association external feature predictor coefficients, beta. example, assume outcome continuous want apply ridge penalty predictors lasso penalty external features. minimize following objective function (ignoring intercept terms): Note model allows predictor coefficients, beta, shrink towards potentially informative values based matrix Z. event external data informative, can shrink alpha towards zero, returning back standard regularized regression. efficiently fit model, rewrite convex optimization variable substitution gamma = beta − Z * alpha. problem solved standard regularized regression allow penalty value type (ridge / lasso) variable-specific: package extends coordinate descent algorithm Friedman et al. 2010 (used R package glmnet) allow variable-specific generalization fit model described . Currently, allow continuous binary outcomes, plan extend outcomes (.e. survival) next release.","code":""},{"path":[]},{"path":"/index.html","id":"from-cran","dir":"","previous_headings":"","what":"From CRAN","title":"Hierarchical Regularized Regression","text":"","code":"install.packages(\"xrnet\")"},{"path":"/index.html","id":"from-github-most-up-to-date","dir":"","previous_headings":"","what":"From Github (most up-to-date)","title":"Hierarchical Regularized Regression","text":"Windows: Install RTools (R package) Mac: Verify GNU Fortran version >= 6.1. older version, go install required version. Install R package devtools Install xrnet package install_github() function (optionally install potentially unstable development branch)","code":"# Master branch devtools::install_github(\"USCbiostats/xrnet\")"},{"path":"/index.html","id":"a-first-example","dir":"","previous_headings":"","what":"A First Example","title":"Hierarchical Regularized Regression","text":"example might use xrnet, provided small set simulated external data variables (ext), predictors (x), continuous outcome variable (y). First, load package example data:","code":"library(xrnet) data(GaussianExample)"},{"path":"/index.html","id":"fitting-a-model","dir":"","previous_headings":"","what":"Fitting a Model","title":"Hierarchical Regularized Regression","text":"fit linear hierarchical regularized regression model, use main xrnet function. minimum, specify predictor matrix x, outcome variable y, family (outcome distribution). external option allows incorporate external data regularized regression model. include external data, standard regularized regression model fit. default, lasso penalty applied predictors external data.","code":"xrnet_model <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\" )"},{"path":"/index.html","id":"modifying-regularization-terms","dir":"","previous_headings":"","what":"Modifying Regularization Terms","title":"Hierarchical Regularized Regression","text":"modify regularization terms penalty path associated predictors external data, can use define_penalty function. function allows configure following regularization attributes: Ridge = 0 Elastic Net = (0, 1) Lasso / Quantile = 1 (additional parameter quantile used specify quantile, currently implemented) Number penalty values full penalty path (default = 20) Ratio min(penalty) / max(penalty) User-defined set penalties example, may want apply ridge penalty x variables lasso penalty external data variables. addition, may want 30 penalty values computed regularization path associated x external. modify model call xrnet follows. penalty_main used specify regularization x variables penalty_external used specify regularization external variables Helper functions also available define available penalty types (define_lasso, define_ridge, define_enet). example exemplifies fitting standard ridge regression model 100 penalty values using define_ridge helper function. mentioned previously, standard regularized regression fit external data provided.","code":"xrnet_model <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", penalty_main = define_penalty(0, num_penalty = 30), penalty_external = define_penalty(1, num_penalty = 30) ) xrnet_model <- xrnet( x = x_linear, y = y_linear, family = \"gaussian\", penalty_main = define_ridge(100) )"},{"path":"/index.html","id":"tuning-penalty-parameters-by-cross-validation","dir":"","previous_headings":"","what":"Tuning Penalty Parameters by Cross-Validation","title":"Hierarchical Regularized Regression","text":"general, need method determine penalty values produce optimal --sample prediction. provide simple two-dimensional grid search uses k-fold cross-validation determine optimal values penalties. cross-validation function tune_xrnet used follows. visualize results cross-validation provide contour plot mean cross-validation error across grid penalties plot function. Cross-validation error curves can also generated plot fixing value either penalty x external penalty external. default, either penalty defaults optimal penalty x external. predict function can used predict responses obtain coefficient estimates optimal penalty combination (default) penalty combination within penalty path(s). coef another help function can used return coefficients combination penalty values well.","code":"cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", penalty_main = define_ridge(), penalty_external = define_lasso() ) plot(cv_xrnet) plot(cv_xrnet, p = \"opt\") predy <- predict(cv_xrnet, newdata = x_linear) estimates <- coef(cv_xrnet)"},{"path":"/index.html","id":"using-the-bigmemory-r-package-with-xrnet","dir":"","previous_headings":"","what":"Using the bigmemory R package with xrnet","title":"Hierarchical Regularized Regression","text":"example using bigmemory xrnet, provided ASCII file, x_linear.txt, contains data x. bigmemory function read.big.matrix() can used create big.matrix version file. ASCII file located inst/extdata repository also included install R package. access file R package, use system.file(\"extdata\", \"x_linear.txt\", package = \"xrnet\") shown example . can now fit ridge regression model big.matrix version data verify get estimates:","code":"x_big <- bigmemory::read.big.matrix(system.file(\"extdata\", \"x_linear.txt\", package = \"xrnet\"), type = \"double\") xrnet_model_big <- xrnet( x = x_big, y = y_linear, family = \"gaussian\", penalty_main = define_ridge(100) ) all.equal(xrnet_model$beta0, xrnet_model_big$beta0) #> [1] TRUE all.equal(xrnet_model$betas, xrnet_model_big$betas) #> [1] TRUE all.equal(xrnet_model$alphas, xrnet_model_big$alphas) #> [1] TRUE"},{"path":"/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Hierarchical Regularized Regression","text":"report bug, ask question, propose feature, create new issue . project released following Contributor Code Conduct. like contribute, please abide terms.","code":""},{"path":"/index.html","id":"funding","dir":"","previous_headings":"","what":"Funding","title":"Hierarchical Regularized Regression","text":"Supported National Cancer Institute Grant #1P01CA196596.","code":""},{"path":"/reference/coef.tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Get coefficient estimates from ","title":"Get coefficient estimates from ","text":"Returns coefficients 'xrnet' model. Note currently support returning coefficient estimates original path(s).","code":""},{"path":"/reference/coef.tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get coefficient estimates from ","text":"","code":"# S3 method for tune_xrnet coef(object, p = \"opt\", pext = \"opt\", ...)"},{"path":"/reference/coef.tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get coefficient estimates from ","text":"object tune_xrnet object. p vector penalty values apply predictor variables. Default optimal value tune_xrnet object. pext vector penalty values apply external data variables. Default optimal value tune_xrnet object. ... pass arguments xrnet function (needed).","code":""},{"path":"/reference/coef.tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get coefficient estimates from ","text":"list coefficient estimates requested penalty combinations. beta0 matrix first-level intercepts indexed penalty values, NULL first-level intercept original model fit. betas 3-dimensional array first-level penalized coefficients indexed penalty values. gammas 3-dimensional array first-level non-penalized coefficients indexed penalty values, NULL unpen NULL original model fit. alpha0 matrix second-level intercepts indexed penalty values, NULL second-level intercept original model fit. alphas 3-dimensional array second-level external data coefficients indexed penalty values, NULL external NULL original model fit.","code":""},{"path":"/reference/coef.tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get coefficient estimates from ","text":"","code":"## Cross validation of hierarchical linear regression model data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## Get coefficient estimates at optimal penalty combination coef_opt <- coef(cv_xrnet)"},{"path":"/reference/coef.xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Get coefficient estimates from ","title":"Get coefficient estimates from ","text":"Returns coefficients 'xrnet' model. Note currently support returning coefficient estimates original path(s).","code":""},{"path":"/reference/coef.xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get coefficient estimates from ","text":"","code":"# S3 method for xrnet coef(object, p = NULL, pext = NULL, ...)"},{"path":"/reference/coef.xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get coefficient estimates from ","text":"object xrnet object. p vector penalty values apply predictor variables. pext vector penalty values apply external data variables. ... pass arguments xrnet function (needed).","code":""},{"path":"/reference/coef.xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get coefficient estimates from ","text":"list coefficient estimates requested penalty combinations. beta0 matrix first-level intercepts indexed penalty values, NULL first-level intercept original model fit. betas 3-dimensional array first-level penalized coefficients indexed penalty values. gammas 3-dimensional array first-level non-penalized coefficients indexed penalty values, NULL unpen NULL original model fit. alpha0 matrix second-level intercepts indexed penalty values, NULL second-level intercept original model fit. alphas 3-dimensional array second-level external data coefficients indexed penalty values, NULL external NULL original model fit.","code":""},{"path":"/reference/coef.xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get coefficient estimates from ","text":"","code":"data(GaussianExample) fit_xrnet <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\" ) lambda1 <- fit_xrnet$penalty[10] lambda2 <- fit_xrnet$penalty_ext[10] coef_xrnet <- coef( fit_xrnet, p = lambda1, pext = lambda2, )"},{"path":"/reference/define_enet.html","id":null,"dir":"Reference","previous_headings":"","what":"Define elastic net regularization object for predictor and external data — define_enet","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"Helper function define elastic net penalty regularization object. See define_penalty details.","code":""},{"path":"/reference/define_enet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"","code":"define_enet( en_param = 0.5, num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"/reference/define_enet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"en_param elastic net parameter, 0 1 num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"/reference/define_enet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet. list elements match returned define_penalty, penalty_type set match value en_param.","code":""},{"path":"/reference/define_lasso.html","id":null,"dir":"Reference","previous_headings":"","what":"Define lasso regularization object for predictor and external data — define_lasso","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"Helper function define lasso penalty regularization object. See define_penalty details.","code":""},{"path":"/reference/define_lasso.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"","code":"define_lasso( num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"/reference/define_lasso.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"/reference/define_lasso.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet. list elements match returned define_penalty, penalty_type automatically set 1.","code":""},{"path":"/reference/define_penalty.html","id":null,"dir":"Reference","previous_headings":"","what":"Define regularization object for predictor and external data. — define_penalty","title":"Define regularization object for predictor and external data. — define_penalty","text":"Defines regularization predictors external data variables xrnet fitting. Use helper functions define_lasso, define_ridge, define_enet specify common penalty x external.","code":""},{"path":"/reference/define_penalty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define regularization object for predictor and external data. — define_penalty","text":"","code":"define_penalty( penalty_type = 1, quantile = 0.5, num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"/reference/define_penalty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define regularization object for predictor and external data. — define_penalty","text":"penalty_type type regularization. Default 1 (Lasso). Can supply either scalar value vector length equal number variables matrix. 0 = Ridge (0,1) = Elastic-Net 1 = Lasso / Quantile quantile specifies quantile quantile penalty. Default 0.5 reduces lasso (currently implemented). num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"/reference/define_penalty.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define regularization object for predictor and external data. — define_penalty","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet: penalty_type penalty type, scalar value range [0, 1]. quantile Quantile quantile penalty, 0.5 defaults lasso (currently implemented). num_penalty number penalty values penalty path. penalty_ratio ratio minimum penalty value compared maximum penalty value. user_penalty User-defined numeric vector penalty values, NULL provided user. custom_multiplier User-defined feature-specific penalty multipliers, NULL provided user.","code":""},{"path":"/reference/define_penalty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define regularization object for predictor and external data. — define_penalty","text":"","code":"# define ridge penalty with penalty grid split into 30 values my_penalty <- define_penalty(penalty_type = 0, num_penalty = 30) # define elastic net (0.5) penalty with user-defined penalty my_custom_penalty <- define_penalty( penalty_type = 0.5, user_penalty = c(100, 50, 10, 1, 0.1) )"},{"path":"/reference/define_ridge.html","id":null,"dir":"Reference","previous_headings":"","what":"Define ridge regularization object for predictor and external data — define_ridge","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"Helper function define ridge penalty regularization object. See define_penalty details.","code":""},{"path":"/reference/define_ridge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"","code":"define_ridge( num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"/reference/define_ridge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"/reference/define_ridge.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet. list elements match returned define_penalty, penalty_type automatically set 0.","code":""},{"path":"/reference/ext_linear.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated external data — ext_linear","title":"Simulated external data — ext_linear","text":"Simulated external data","code":""},{"path":"/reference/ext_linear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated external data — ext_linear","text":"","code":"ext_linear"},{"path":"/reference/ext_linear.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated external data — ext_linear","text":"matrix 50 rows 4 columns","code":""},{"path":"/reference/plot.tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot k-fold cross-validation error grid — plot.tune_xrnet","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"Generates plots visualize mean cross-validation error. external data used model fit, plot cross-validated error standard error bars generated penalty values. external data used model fit, contour plot cross-validated errors created. Error curves can also generated fixed value primary penalty x (p) external penalty (pext) external data used.","code":""},{"path":"/reference/plot.tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"","code":"# S3 method for tune_xrnet plot(x, p = NULL, pext = NULL, ...)"},{"path":"/reference/plot.tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"x tune_xrnet class object p (optional) penalty value x (generating error curve across external penalties). Use value \"opt\" use optimal penalty value. pext (optional) penalty value external (generating error curve across primary penalties). Use value \"opt\" use optimal penalty value. ... Additional graphics parameters","code":""},{"path":"/reference/plot.tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"None","code":""},{"path":"/reference/plot.tune_xrnet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"parameter values p pext can used generate profiled error curves fixing either penalty x penalty external fixed value. specify time return single point.","code":""},{"path":"/reference/plot.tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"","code":"## load example data data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## contour plot of cross-validated error plot(cv_xrnet) ## error curve of external penalties at optimal penalty value plot(cv_xrnet, p = \"opt\")"},{"path":"/reference/predict.tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict function for ","title":"Predict function for ","text":"Extract coefficients predict response new data using fitted model tune_xrnet object. Note currently support returning results original path(s).","code":""},{"path":"/reference/predict.tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict function for ","text":"","code":"# S3 method for tune_xrnet predict( object, newdata = NULL, newdata_fixed = NULL, p = \"opt\", pext = \"opt\", type = c(\"response\", \"link\", \"coefficients\"), ... )"},{"path":"/reference/predict.tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict function for ","text":"object tune_xrnet object newdata matrix new values penalized variables newdata_fixed matrix new values unpenalized variables p vector penalty values apply predictor variables. Default optimal value tune_xrnet object. pext vector penalty values apply external data variables. Default optimal value tune_xrnet object. type type prediction make using xrnet model, options include: response link (linear predictor) coefficients ... pass arguments xrnet function (needed)","code":""},{"path":"/reference/predict.tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict function for ","text":"object returned based value type follows: response: array response predictions based data penalty combination link: array linear predictions based data penalty combination coefficients: list coefficient estimates penalty combination. See coef.xrnet.","code":""},{"path":"/reference/predict.tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict function for ","text":"","code":"data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## Get coefficients and predictions at optimal penalty combination coef_xrnet <- predict(cv_xrnet, type = \"coefficients\") pred_xrnet <- predict(cv_xrnet, newdata = x_linear, type = \"response\")"},{"path":"/reference/predict.xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict function for ","title":"Predict function for ","text":"Extract coefficients predict response new data using fitted model xrnet object. Note currently support returning coefficient estimates original path(s).","code":""},{"path":"/reference/predict.xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict function for ","text":"","code":"# S3 method for xrnet predict( object, newdata = NULL, newdata_fixed = NULL, p = NULL, pext = NULL, type = c(\"response\", \"link\", \"coefficients\"), ... )"},{"path":"/reference/predict.xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict function for ","text":"object xrnet object newdata matrix new values penalized variables newdata_fixed matrix new values unpenalized variables p vector penalty values apply predictor variables pext vector penalty values apply external data variables type type prediction make using xrnet model, options include: response link (linear predictor) coefficients ... pass arguments xrnet function (needed)","code":""},{"path":"/reference/predict.xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict function for ","text":"object returned based value type follows: response: array response predictions based data penalty combination link: array linear predictions based data penalty combination coefficients: list coefficient estimates penalty combination. See coef.xrnet.","code":""},{"path":"/reference/predict.xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict function for ","text":"","code":"data(GaussianExample) fit_xrnet <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\" ) lambda1 <- fit_xrnet$penalty[10] lambda2 <- fit_xrnet$penalty_ext[10] coef_xrnet <- predict( fit_xrnet, p = lambda1, pext = lambda2, type = \"coefficients\" ) pred_xrnet <- predict( fit_xrnet, p = lambda1, pext = lambda2, newdata = x_linear, type = \"response\" )"},{"path":"/reference/tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"k-fold cross-validation hierarchical regularized regression xrnet","code":""},{"path":"/reference/tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"","code":"tune_xrnet( x, y, external = NULL, unpen = NULL, family = c(\"gaussian\", \"binomial\"), penalty_main = define_penalty(), penalty_external = define_penalty(), weights = NULL, standardize = c(TRUE, TRUE), intercept = c(TRUE, FALSE), loss = c(\"deviance\", \"mse\", \"mae\", \"auc\"), nfolds = 5, foldid = NULL, parallel = FALSE, control = list() )"},{"path":"/reference/tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"x predictor design matrix dimension \\(n x p\\), matrix options include: matrix big.matrix filebacked.big.matrix sparse matrix (dgCMatrix) y outcome vector length \\(n\\) external (optional) external data design matrix dimension \\(p x q\\), matrix options include: matrix sparse matrix (dgCMatrix) unpen (optional) unpenalized predictor design matrix, matrix options include: matrix family error distribution outcome variable, options include: \"gaussian\" \"binomial\" penalty_main specifies regularization object x. See define_penalty details. penalty_external specifies regularization object external. See define_penalty details. See define_penalty details. weights optional vector observation-specific weights. Default 1 observations. standardize indicates whether x /external standardized. Default c(TRUE, TRUE). intercept indicates whether intercept term included x /external. Default c(TRUE, FALSE). loss loss function cross-validation. Options include: \"deviance\" \"mse\" (Mean Squared Error) \"mae\" (Mean Absolute Error) \"auc\" (Area curve) nfolds number folds cross-validation. Default 5. foldid (optional) vector identifies user-specified fold observation. NULL, folds automatically generated. parallel use foreach function fit folds parallel TRUE, must register cluster (doParallel) using. control specifies xrnet control object. See xrnet_control details.","code":""},{"path":"/reference/tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"list class tune_xrnet components cv_mean mean cross-validated error penalty combination. Object returned vector external data (external = NULL) matrix external data. cv_sd estimated standard deviation cross-validated errors. Object returned vector external data (external = NULL) matrix external data. loss loss function used compute cross-validation error opt_loss value loss function optimal cross-validated error opt_penalty first-level penalty value achieves optimal loss opt_penalty_ext second-level penalty value achieves optimal loss (external data present) fitted_model fitted xrnet object using data, see xrnet details object","code":""},{"path":"/reference/tune_xrnet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"k-fold cross-validation used determine 'optimal' combination hyperparameter values, optimal based optimal value obtained user-selected loss function across k folds. efficiently traverse possible combinations hyperparameter values, 'warm-starts' used traverse penalty largest smallest penalty value(s). Note penalty grid folds generated fitting model entire training data. Parallelization enabled foreach doParallel R packages. use parallelization, parallel = TRUE, must first create cluster makeCluster register cluster registerDoParallel. See parallel, foreach, /doParallel R packages details setup parallelization.","code":""},{"path":"/reference/tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"","code":"## cross validation of hierarchical linear regression model data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## contour plot of cross-validated error plot(cv_xrnet)"},{"path":"/reference/x_linear.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated example data for hierarchical regularized linear regression — x_linear","title":"Simulated example data for hierarchical regularized linear regression — x_linear","text":"Simulated example data hierarchical regularized linear regression","code":""},{"path":"/reference/x_linear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated example data for hierarchical regularized linear regression — x_linear","text":"","code":"x_linear"},{"path":"/reference/x_linear.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated example data for hierarchical regularized linear regression — x_linear","text":"matrix 100 rows 50 variables","code":""},{"path":"/reference/xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit hierarchical regularized regression model — xrnet","title":"Fit hierarchical regularized regression model — xrnet","text":"Fits hierarchical regularized regression model enables incorporation external data predictor variables. predictor variables external data can regularized common penalties (lasso, ridge, elastic net). Solutions computed across two-dimensional grid penalties (separate penalty path computed predictors external variables). Currently support regularized linear logistic regression, future extensions outcomes (.e. Cox regression) implemented next major update.","code":""},{"path":"/reference/xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit hierarchical regularized regression model — xrnet","text":"","code":"xrnet( x, y, external = NULL, unpen = NULL, family = c(\"gaussian\", \"binomial\"), penalty_main = define_penalty(), penalty_external = define_penalty(), weights = NULL, standardize = c(TRUE, TRUE), intercept = c(TRUE, FALSE), control = list() )"},{"path":"/reference/xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit hierarchical regularized regression model — xrnet","text":"x predictor design matrix dimension \\(n x p\\), matrix options include: matrix big.matrix filebacked.big.matrix sparse matrix (dgCMatrix) y outcome vector length \\(n\\) external (optional) external data design matrix dimension \\(p x q\\), matrix options include: matrix sparse matrix (dgCMatrix) unpen (optional) unpenalized predictor design matrix, matrix options include: matrix family error distribution outcome variable, options include: \"gaussian\" \"binomial\" penalty_main specifies regularization object x. See define_penalty details. penalty_external specifies regularization object external. See define_penalty details. weights optional vector observation-specific weights. Default 1 observations. standardize indicates whether x /external standardized. Default c(TRUE, TRUE). intercept indicates whether intercept term included x /external. Default c(TRUE, FALSE). control specifies xrnet control object. See xrnet_control details.","code":""},{"path":"/reference/xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit hierarchical regularized regression model — xrnet","text":"list class xrnet components: beta0 matrix first-level intercepts indexed penalty values betas 3-dimensional array first-level penalized coefficients indexed penalty values gammas 3-dimensional array first-level non-penalized coefficients indexed penalty values alpha0 matrix second-level intercepts indexed penalty values alphas 3-dimensional array second-level external data coefficients indexed penalty values penalty vector first-level penalty values penalty_ext vector second-level penalty values family error distribution outcome variable num_passes total number passes data coordinate descent algorithm status error status xrnet fitting 0 = OK 1 = Error/Warning error_msg description error","code":""},{"path":"/reference/xrnet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit hierarchical regularized regression model — xrnet","text":"function extends coordinate descent algorithm R package glmnet allow type regularization (.e. ridge, lasso) feature-specific. extension used enable fitting hierarchical regularized regression models, external information predictors can included external= argument. addition, elements R package biglasso utilized enable use standard R matrices, memory-mapped matrices bigmemory package, sparse matrices Matrix package.","code":""},{"path":"/reference/xrnet.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit hierarchical regularized regression model — xrnet","text":"Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths Generalized Linear Models via Coordinate Descent. Journal Statistical Software, 33(1), 1-22. URL http://www.jstatsoft.org/v33/i01/. Zeng, Y., Breheny, P. (2017). biglasso Package: Memory- Computation-Efficient Solver Lasso Model Fitting Big Data R. arXiv preprint arXiv:1701.05936. URL https://arxiv.org/abs/1701.05936. Michael J. Kane, John Emerson, Stephen Weston (2013). Scalable Strategies Computing Massive Data. Journal Statistical Software, 55(14), 1-19. URL http://www.jstatsoft.org/v55/i14/.","code":""},{"path":"/reference/xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit hierarchical regularized regression model — xrnet","text":"","code":"### hierarchical regularized linear regression ### data(GaussianExample) ## define penalty for predictors and external variables ## default is ridge for predictors and lasso for external ## see define_penalty() function for more details penMain <- define_penalty(0, num_penalty = 20) penExt <- define_penalty(1, num_penalty = 20) ## fit model with defined regularization fit_xrnet <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", penalty_main = penMain, penalty_external = penExt )"},{"path":"/reference/xrnet_control.html","id":null,"dir":"Reference","previous_headings":"","what":"Control function for xrnet fitting — xrnet_control","title":"Control function for xrnet fitting — xrnet_control","text":"Control function xrnet fitting.","code":""},{"path":"/reference/xrnet_control.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Control function for xrnet fitting — xrnet_control","text":"","code":"xrnet_control( tolerance = 1e-08, max_iterations = 1e+05, dfmax = NULL, pmax = NULL, lower_limits = NULL, upper_limits = NULL )"},{"path":"/reference/xrnet_control.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Control function for xrnet fitting — xrnet_control","text":"tolerance positive convergence criterion. Default 1e-08. max_iterations maximum number iterations run coordinate gradient descent across penalties returning error. Default 1e+05. dfmax maximum number variables allowed model. Default \\(ncol(x) + ncol(unpen) + ncol(external) + intercept[1] + intercept[2]\\). pmax maximum number variables nonzero coefficient estimate. Default \\(min(2 * dfmax + 20, ncol(x) + ncol(unpen) + ncol(external) + intercept[2])\\). lower_limits vector lower limits coefficient. Default -Inf variables. upper_limits vector upper limits coefficient. Default Inf variables.","code":""},{"path":"/reference/xrnet_control.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Control function for xrnet fitting — xrnet_control","text":"list object following components: tolerance coordinate descent stopping criterion. dfmax maximum number variables allowed model. pmax maximum number variables nonzero coefficient estimate. lower_limits Feature-specific numeric vector lower bounds coefficient estimates upper_limits Feature-specific numeric vector upper bounds coefficient estimates","code":""},{"path":"/reference/y_linear.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated outcome data — y_linear","title":"Simulated outcome data — y_linear","text":"Simulated outcome data","code":""},{"path":"/reference/y_linear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated outcome data — y_linear","text":"","code":"y_linear"},{"path":"/reference/y_linear.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated outcome data — y_linear","text":"vector 100 elements","code":""},{"path":"/news/index.html","id":"xrnet-017","dir":"Changelog","previous_headings":"","what":"xrnet 0.1.7","title":"xrnet 0.1.7","text":"CRAN release: 2020-03-01 Patched release fix tests Solaris OS removed test dependency glmnet","code":""},{"path":"/news/index.html","id":"xrnet-016","dir":"Changelog","previous_headings":"","what":"xrnet 0.1.6","title":"xrnet 0.1.6","text":"CRAN release: 2020-02-28 First release CRAN Initial release supports linear logistic hierarchical regularized regression","code":""}]
+[{"path":"https://uscbiostats.github.io/xrnet/CODE_OF_CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (http://contributor-covenant.org), version 1.0.0, available http://contributor-covenant.org/version/1/0/0/","code":""},{"path":"https://uscbiostats.github.io/xrnet/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Garrett Weaver. Author, maintainer. Dixin Shen. Author. Juan Pablo Lewinger. Contributor, thesis advisor.","code":""},{"path":"https://uscbiostats.github.io/xrnet/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Weaver G, Shen D (2024). xrnet: Hierarchical Regularized Regression. R package version 0.1.7, https://uscbiostats.github.io/xrnet/, https://github.com/USCbiostats/xrnet.","code":"@Manual{, title = {xrnet: Hierarchical Regularized Regression}, author = {Garrett Weaver and Dixin Shen}, year = {2024}, note = {R package version 0.1.7, https://uscbiostats.github.io/xrnet/}, url = {https://github.com/USCbiostats/xrnet}, }"},{"path":[]},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Hierarchical Regularized Regression","text":"xrnet R package extension regularized regression (.e. ridge regression) enables incorporation external data may informative effects predictors outcome interest. Let y n-dimensional observed outcome vector, X set p potential predictors observed n observations, Z set q external features available p predictors. model builds standard two-level hierarchical regression model, allows regularization predictors external features, beta vector coefficients describing association predictor outcome alpha vector coefficients describing association external feature predictor coefficients, beta. example, assume outcome continuous want apply ridge penalty predictors lasso penalty external features. minimize following objective function (ignoring intercept terms): Note model allows predictor coefficients, beta, shrink towards potentially informative values based matrix Z. event external data informative, can shrink alpha towards zero, returning back standard regularized regression. efficiently fit model, rewrite convex optimization variable substitution gamma = beta − Z * alpha. problem solved standard regularized regression allow penalty value type (ridge / lasso) variable-specific: package extends coordinate descent algorithm Friedman et al. 2010 (used R package glmnet) allow variable-specific generalization fit model described . Currently, allow continuous binary outcomes, plan extend outcomes (.e. survival) next release.","code":""},{"path":[]},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"from-cran","dir":"","previous_headings":"","what":"From CRAN","title":"Hierarchical Regularized Regression","text":"","code":"install.packages(\"xrnet\")"},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"from-github-most-up-to-date","dir":"","previous_headings":"","what":"From Github (most up-to-date)","title":"Hierarchical Regularized Regression","text":"Windows: Install RTools (R package) Mac: Verify GNU Fortran version >= 6.1. older version, go install required version. Install R package devtools Install xrnet package install_github() function (optionally install potentially unstable development branch)","code":"# Master branch devtools::install_github(\"USCbiostats/xrnet\")"},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"a-first-example","dir":"","previous_headings":"","what":"A First Example","title":"Hierarchical Regularized Regression","text":"example might use xrnet, provided small set simulated external data variables (ext), predictors (x), continuous outcome variable (y). First, load package example data:","code":"library(xrnet) data(GaussianExample)"},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"fitting-a-model","dir":"","previous_headings":"","what":"Fitting a Model","title":"Hierarchical Regularized Regression","text":"fit linear hierarchical regularized regression model, use main xrnet function. minimum, specify predictor matrix x, outcome variable y, family (outcome distribution). external option allows incorporate external data regularized regression model. include external data, standard regularized regression model fit. default, lasso penalty applied predictors external data.","code":"xrnet_model <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\" )"},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"modifying-regularization-terms","dir":"","previous_headings":"","what":"Modifying Regularization Terms","title":"Hierarchical Regularized Regression","text":"modify regularization terms penalty path associated predictors external data, can use define_penalty function. function allows configure following regularization attributes: Ridge = 0 Elastic Net = (0, 1) Lasso / Quantile = 1 (additional parameter quantile used specify quantile, currently implemented) Number penalty values full penalty path (default = 20) Ratio min(penalty) / max(penalty) User-defined set penalties example, may want apply ridge penalty x variables lasso penalty external data variables. addition, may want 30 penalty values computed regularization path associated x external. modify model call xrnet follows. penalty_main used specify regularization x variables penalty_external used specify regularization external variables Helper functions also available define available penalty types (define_lasso, define_ridge, define_enet). example exemplifies fitting standard ridge regression model 100 penalty values using define_ridge helper function. mentioned previously, standard regularized regression fit external data provided.","code":"xrnet_model <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", penalty_main = define_penalty(0, num_penalty = 30), penalty_external = define_penalty(1, num_penalty = 30) ) xrnet_model <- xrnet( x = x_linear, y = y_linear, family = \"gaussian\", penalty_main = define_ridge(100) )"},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"tuning-penalty-parameters-by-cross-validation","dir":"","previous_headings":"","what":"Tuning Penalty Parameters by Cross-Validation","title":"Hierarchical Regularized Regression","text":"general, need method determine penalty values produce optimal --sample prediction. provide simple two-dimensional grid search uses k-fold cross-validation determine optimal values penalties. cross-validation function tune_xrnet used follows. visualize results cross-validation provide contour plot mean cross-validation error across grid penalties plot function. Cross-validation error curves can also generated plot fixing value either penalty x external penalty external. default, either penalty defaults optimal penalty x external. predict function can used predict responses obtain coefficient estimates optimal penalty combination (default) penalty combination within penalty path(s). coef another help function can used return coefficients combination penalty values well.","code":"cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", penalty_main = define_ridge(), penalty_external = define_lasso() ) plot(cv_xrnet) plot(cv_xrnet, p = \"opt\") predy <- predict(cv_xrnet, newdata = x_linear) estimates <- coef(cv_xrnet)"},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"using-the-bigmemory-r-package-with-xrnet","dir":"","previous_headings":"","what":"Using the bigmemory R package with xrnet","title":"Hierarchical Regularized Regression","text":"example using bigmemory xrnet, provided ASCII file, x_linear.txt, contains data x. bigmemory function read.big.matrix() can used create big.matrix version file. ASCII file located inst/extdata repository also included install R package. access file R package, use system.file(\"extdata\", \"x_linear.txt\", package = \"xrnet\") shown example . can now fit ridge regression model big.matrix version data verify get estimates:","code":"x_big <- bigmemory::read.big.matrix(system.file(\"extdata\", \"x_linear.txt\", package = \"xrnet\"), type = \"double\") xrnet_model_big <- xrnet( x = x_big, y = y_linear, family = \"gaussian\", penalty_main = define_ridge(100) ) all.equal(xrnet_model$beta0, xrnet_model_big$beta0) #> [1] TRUE all.equal(xrnet_model$betas, xrnet_model_big$betas) #> [1] TRUE all.equal(xrnet_model$alphas, xrnet_model_big$alphas) #> [1] TRUE"},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"contributing","dir":"","previous_headings":"","what":"Contributing","title":"Hierarchical Regularized Regression","text":"report bug, ask question, propose feature, create new issue . project released following Contributor Code Conduct. like contribute, please abide terms.","code":""},{"path":"https://uscbiostats.github.io/xrnet/index.html","id":"funding","dir":"","previous_headings":"","what":"Funding","title":"Hierarchical Regularized Regression","text":"Supported National Cancer Institute Grant #1P01CA196596.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Get coefficient estimates from ","title":"Get coefficient estimates from ","text":"Returns coefficients 'xrnet' model. Note currently support returning coefficient estimates original path(s).","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get coefficient estimates from ","text":"","code":"# S3 method for tune_xrnet coef(object, p = \"opt\", pext = \"opt\", ...)"},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get coefficient estimates from ","text":"object tune_xrnet object. p vector penalty values apply predictor variables. Default optimal value tune_xrnet object. pext vector penalty values apply external data variables. Default optimal value tune_xrnet object. ... pass arguments xrnet function (needed).","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get coefficient estimates from ","text":"list coefficient estimates requested penalty combinations. beta0 matrix first-level intercepts indexed penalty values, NULL first-level intercept original model fit. betas 3-dimensional array first-level penalized coefficients indexed penalty values. gammas 3-dimensional array first-level non-penalized coefficients indexed penalty values, NULL unpen NULL original model fit. alpha0 matrix second-level intercepts indexed penalty values, NULL second-level intercept original model fit. alphas 3-dimensional array second-level external data coefficients indexed penalty values, NULL external NULL original model fit.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get coefficient estimates from ","text":"","code":"## Cross validation of hierarchical linear regression model data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## Get coefficient estimates at optimal penalty combination coef_opt <- coef(cv_xrnet)"},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Get coefficient estimates from ","title":"Get coefficient estimates from ","text":"Returns coefficients 'xrnet' model. Note currently support returning coefficient estimates original path(s).","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get coefficient estimates from ","text":"","code":"# S3 method for xrnet coef(object, p = NULL, pext = NULL, ...)"},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get coefficient estimates from ","text":"object xrnet object. p vector penalty values apply predictor variables. pext vector penalty values apply external data variables. ... pass arguments xrnet function (needed).","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get coefficient estimates from ","text":"list coefficient estimates requested penalty combinations. beta0 matrix first-level intercepts indexed penalty values, NULL first-level intercept original model fit. betas 3-dimensional array first-level penalized coefficients indexed penalty values. gammas 3-dimensional array first-level non-penalized coefficients indexed penalty values, NULL unpen NULL original model fit. alpha0 matrix second-level intercepts indexed penalty values, NULL second-level intercept original model fit. alphas 3-dimensional array second-level external data coefficients indexed penalty values, NULL external NULL original model fit.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/coef.xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get coefficient estimates from ","text":"","code":"data(GaussianExample) fit_xrnet <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\" ) lambda1 <- fit_xrnet$penalty[10] lambda2 <- fit_xrnet$penalty_ext[10] coef_xrnet <- coef( fit_xrnet, p = lambda1, pext = lambda2, )"},{"path":"https://uscbiostats.github.io/xrnet/reference/define_enet.html","id":null,"dir":"Reference","previous_headings":"","what":"Define elastic net regularization object for predictor and external data — define_enet","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"Helper function define elastic net penalty regularization object. See define_penalty details.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_enet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"","code":"define_enet( en_param = 0.5, num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"https://uscbiostats.github.io/xrnet/reference/define_enet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"en_param elastic net parameter, 0 1 num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_enet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define elastic net regularization object for predictor and external data — define_enet","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet. list elements match returned define_penalty, penalty_type set match value en_param.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_lasso.html","id":null,"dir":"Reference","previous_headings":"","what":"Define lasso regularization object for predictor and external data — define_lasso","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"Helper function define lasso penalty regularization object. See define_penalty details.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_lasso.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"","code":"define_lasso( num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"https://uscbiostats.github.io/xrnet/reference/define_lasso.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_lasso.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define lasso regularization object for predictor and external data — define_lasso","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet. list elements match returned define_penalty, penalty_type automatically set 1.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_penalty.html","id":null,"dir":"Reference","previous_headings":"","what":"Define regularization object for predictor and external data. — define_penalty","title":"Define regularization object for predictor and external data. — define_penalty","text":"Defines regularization predictors external data variables xrnet fitting. Use helper functions define_lasso, define_ridge, define_enet specify common penalty x external.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_penalty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define regularization object for predictor and external data. — define_penalty","text":"","code":"define_penalty( penalty_type = 1, quantile = 0.5, num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"https://uscbiostats.github.io/xrnet/reference/define_penalty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define regularization object for predictor and external data. — define_penalty","text":"penalty_type type regularization. Default 1 (Lasso). Can supply either scalar value vector length equal number variables matrix. 0 = Ridge (0,1) = Elastic-Net 1 = Lasso / Quantile quantile specifies quantile quantile penalty. Default 0.5 reduces lasso (currently implemented). num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_penalty.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define regularization object for predictor and external data. — define_penalty","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet: penalty_type penalty type, scalar value range [0, 1]. quantile Quantile quantile penalty, 0.5 defaults lasso (currently implemented). num_penalty number penalty values penalty path. penalty_ratio ratio minimum penalty value compared maximum penalty value. user_penalty User-defined numeric vector penalty values, NULL provided user. custom_multiplier User-defined feature-specific penalty multipliers, NULL provided user.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_penalty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define regularization object for predictor and external data. — define_penalty","text":"","code":"# define ridge penalty with penalty grid split into 30 values my_penalty <- define_penalty(penalty_type = 0, num_penalty = 30) # define elastic net (0.5) penalty with user-defined penalty my_custom_penalty <- define_penalty( penalty_type = 0.5, user_penalty = c(100, 50, 10, 1, 0.1) )"},{"path":"https://uscbiostats.github.io/xrnet/reference/define_ridge.html","id":null,"dir":"Reference","previous_headings":"","what":"Define ridge regularization object for predictor and external data — define_ridge","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"Helper function define ridge penalty regularization object. See define_penalty details.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_ridge.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"","code":"define_ridge( num_penalty = 20, penalty_ratio = NULL, user_penalty = NULL, custom_multiplier = NULL )"},{"path":"https://uscbiostats.github.io/xrnet/reference/define_ridge.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"num_penalty number penalty values fit grid. Default 20. penalty_ratio ratio minimum maximum penalty x. Default 1e-04 \\(n > p\\) 0.01 \\(n <= p\\). user_penalty user-defined vector penalty values use penalty path. custom_multiplier variable-specific penalty multipliers apply overall penalty. Default 1 variables. 0 penalization.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/define_ridge.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define ridge regularization object for predictor and external data — define_ridge","text":"list object regularization settings used define regularization predictors external data xrnet tune_xrnet. list elements match returned define_penalty, penalty_type automatically set 0.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/ext_linear.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated external data — ext_linear","title":"Simulated external data — ext_linear","text":"Simulated external data","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/ext_linear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated external data — ext_linear","text":"","code":"ext_linear"},{"path":"https://uscbiostats.github.io/xrnet/reference/ext_linear.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated external data — ext_linear","text":"matrix 50 rows 4 columns","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/plot.tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot k-fold cross-validation error grid — plot.tune_xrnet","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"Generates plots visualize mean cross-validation error. external data used model fit, plot cross-validated error standard error bars generated penalty values. external data used model fit, contour plot cross-validated errors created. Error curves can also generated fixed value primary penalty x (p) external penalty (pext) external data used.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/plot.tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"","code":"# S3 method for tune_xrnet plot(x, p = NULL, pext = NULL, ...)"},{"path":"https://uscbiostats.github.io/xrnet/reference/plot.tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"x tune_xrnet class object p (optional) penalty value x (generating error curve across external penalties). Use value \"opt\" use optimal penalty value. pext (optional) penalty value external (generating error curve across primary penalties). Use value \"opt\" use optimal penalty value. ... Additional graphics parameters","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/plot.tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"None","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/plot.tune_xrnet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"parameter values p pext can used generate profiled error curves fixing either penalty x penalty external fixed value. specify time return single point.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/plot.tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot k-fold cross-validation error grid — plot.tune_xrnet","text":"","code":"## load example data data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## contour plot of cross-validated error plot(cv_xrnet) ## error curve of external penalties at optimal penalty value plot(cv_xrnet, p = \"opt\")"},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict function for ","title":"Predict function for ","text":"Extract coefficients predict response new data using fitted model tune_xrnet object. Note currently support returning results original path(s).","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict function for ","text":"","code":"# S3 method for tune_xrnet predict( object, newdata = NULL, newdata_fixed = NULL, p = \"opt\", pext = \"opt\", type = c(\"response\", \"link\", \"coefficients\"), ... )"},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict function for ","text":"object tune_xrnet object newdata matrix new values penalized variables newdata_fixed matrix new values unpenalized variables p vector penalty values apply predictor variables. Default optimal value tune_xrnet object. pext vector penalty values apply external data variables. Default optimal value tune_xrnet object. type type prediction make using xrnet model, options include: response link (linear predictor) coefficients ... pass arguments xrnet function (needed)","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict function for ","text":"object returned based value type follows: response: array response predictions based data penalty combination link: array linear predictions based data penalty combination coefficients: list coefficient estimates penalty combination. See coef.xrnet.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict function for ","text":"","code":"data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## Get coefficients and predictions at optimal penalty combination coef_xrnet <- predict(cv_xrnet, type = \"coefficients\") pred_xrnet <- predict(cv_xrnet, newdata = x_linear, type = \"response\")"},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Predict function for ","title":"Predict function for ","text":"Extract coefficients predict response new data using fitted model xrnet object. Note currently support returning coefficient estimates original path(s).","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Predict function for ","text":"","code":"# S3 method for xrnet predict( object, newdata = NULL, newdata_fixed = NULL, p = NULL, pext = NULL, type = c(\"response\", \"link\", \"coefficients\"), ... )"},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Predict function for ","text":"object xrnet object newdata matrix new values penalized variables newdata_fixed matrix new values unpenalized variables p vector penalty values apply predictor variables pext vector penalty values apply external data variables type type prediction make using xrnet model, options include: response link (linear predictor) coefficients ... pass arguments xrnet function (needed)","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Predict function for ","text":"object returned based value type follows: response: array response predictions based data penalty combination link: array linear predictions based data penalty combination coefficients: list coefficient estimates penalty combination. See coef.xrnet.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/predict.xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Predict function for ","text":"","code":"data(GaussianExample) fit_xrnet <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\" ) lambda1 <- fit_xrnet$penalty[10] lambda2 <- fit_xrnet$penalty_ext[10] coef_xrnet <- predict( fit_xrnet, p = lambda1, pext = lambda2, type = \"coefficients\" ) pred_xrnet <- predict( fit_xrnet, p = lambda1, pext = lambda2, newdata = x_linear, type = \"response\" )"},{"path":"https://uscbiostats.github.io/xrnet/reference/tune_xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"k-fold cross-validation hierarchical regularized regression xrnet","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/tune_xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"","code":"tune_xrnet( x, y, external = NULL, unpen = NULL, family = c(\"gaussian\", \"binomial\"), penalty_main = define_penalty(), penalty_external = define_penalty(), weights = NULL, standardize = c(TRUE, TRUE), intercept = c(TRUE, FALSE), loss = c(\"deviance\", \"mse\", \"mae\", \"auc\"), nfolds = 5, foldid = NULL, parallel = FALSE, control = list() )"},{"path":"https://uscbiostats.github.io/xrnet/reference/tune_xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"x predictor design matrix dimension \\(n x p\\), matrix options include: matrix big.matrix filebacked.big.matrix sparse matrix (dgCMatrix) y outcome vector length \\(n\\) external (optional) external data design matrix dimension \\(p x q\\), matrix options include: matrix sparse matrix (dgCMatrix) unpen (optional) unpenalized predictor design matrix, matrix options include: matrix family error distribution outcome variable, options include: \"gaussian\" \"binomial\" penalty_main specifies regularization object x. See define_penalty details. penalty_external specifies regularization object external. See define_penalty details. See define_penalty details. weights optional vector observation-specific weights. Default 1 observations. standardize indicates whether x /external standardized. Default c(TRUE, TRUE). intercept indicates whether intercept term included x /external. Default c(TRUE, FALSE). loss loss function cross-validation. Options include: \"deviance\" \"mse\" (Mean Squared Error) \"mae\" (Mean Absolute Error) \"auc\" (Area curve) nfolds number folds cross-validation. Default 5. foldid (optional) vector identifies user-specified fold observation. NULL, folds automatically generated. parallel use foreach function fit folds parallel TRUE, must register cluster (doParallel) using. control specifies xrnet control object. See xrnet_control details.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/tune_xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"list class tune_xrnet components cv_mean mean cross-validated error penalty combination. Object returned vector external data (external = NULL) matrix external data. cv_sd estimated standard deviation cross-validated errors. Object returned vector external data (external = NULL) matrix external data. loss loss function used compute cross-validation error opt_loss value loss function optimal cross-validated error opt_penalty first-level penalty value achieves optimal loss opt_penalty_ext second-level penalty value achieves optimal loss (external data present) fitted_model fitted xrnet object using data, see xrnet details object","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/tune_xrnet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"k-fold cross-validation used determine 'optimal' combination hyperparameter values, optimal based optimal value obtained user-selected loss function across k folds. efficiently traverse possible combinations hyperparameter values, 'warm-starts' used traverse penalty largest smallest penalty value(s). Note penalty grid folds generated fitting model entire training data. Parallelization enabled foreach doParallel R packages. use parallelization, parallel = TRUE, must first create cluster makeCluster register cluster registerDoParallel. See parallel, foreach, /doParallel R packages details setup parallelization.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/tune_xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"k-fold cross-validation for hierarchical regularized regression — tune_xrnet","text":"","code":"## cross validation of hierarchical linear regression model data(GaussianExample) ## 5-fold cross validation cv_xrnet <- tune_xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", control = xrnet_control(tolerance = 1e-6) ) ## contour plot of cross-validated error plot(cv_xrnet)"},{"path":"https://uscbiostats.github.io/xrnet/reference/x_linear.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated example data for hierarchical regularized linear regression — x_linear","title":"Simulated example data for hierarchical regularized linear regression — x_linear","text":"Simulated example data hierarchical regularized linear regression","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/x_linear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated example data for hierarchical regularized linear regression — x_linear","text":"","code":"x_linear"},{"path":"https://uscbiostats.github.io/xrnet/reference/x_linear.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated example data for hierarchical regularized linear regression — x_linear","text":"matrix 100 rows 50 variables","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit hierarchical regularized regression model — xrnet","title":"Fit hierarchical regularized regression model — xrnet","text":"Fits hierarchical regularized regression model enables incorporation external data predictor variables. predictor variables external data can regularized common penalties (lasso, ridge, elastic net). Solutions computed across two-dimensional grid penalties (separate penalty path computed predictors external variables). Currently support regularized linear logistic regression, future extensions outcomes (.e. Cox regression) implemented next major update.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit hierarchical regularized regression model — xrnet","text":"","code":"xrnet( x, y, external = NULL, unpen = NULL, family = c(\"gaussian\", \"binomial\"), penalty_main = define_penalty(), penalty_external = define_penalty(), weights = NULL, standardize = c(TRUE, TRUE), intercept = c(TRUE, FALSE), control = list() )"},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit hierarchical regularized regression model — xrnet","text":"x predictor design matrix dimension \\(n x p\\), matrix options include: matrix big.matrix filebacked.big.matrix sparse matrix (dgCMatrix) y outcome vector length \\(n\\) external (optional) external data design matrix dimension \\(p x q\\), matrix options include: matrix sparse matrix (dgCMatrix) unpen (optional) unpenalized predictor design matrix, matrix options include: matrix family error distribution outcome variable, options include: \"gaussian\" \"binomial\" penalty_main specifies regularization object x. See define_penalty details. penalty_external specifies regularization object external. See define_penalty details. weights optional vector observation-specific weights. Default 1 observations. standardize indicates whether x /external standardized. Default c(TRUE, TRUE). intercept indicates whether intercept term included x /external. Default c(TRUE, FALSE). control specifies xrnet control object. See xrnet_control details.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit hierarchical regularized regression model — xrnet","text":"list class xrnet components: beta0 matrix first-level intercepts indexed penalty values betas 3-dimensional array first-level penalized coefficients indexed penalty values gammas 3-dimensional array first-level non-penalized coefficients indexed penalty values alpha0 matrix second-level intercepts indexed penalty values alphas 3-dimensional array second-level external data coefficients indexed penalty values penalty vector first-level penalty values penalty_ext vector second-level penalty values family error distribution outcome variable num_passes total number passes data coordinate descent algorithm status error status xrnet fitting 0 = OK 1 = Error/Warning error_msg description error","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit hierarchical regularized regression model — xrnet","text":"function extends coordinate descent algorithm R package glmnet allow type regularization (.e. ridge, lasso) feature-specific. extension used enable fitting hierarchical regularized regression models, external information predictors can included external= argument. addition, elements R package biglasso utilized enable use standard R matrices, memory-mapped matrices bigmemory package, sparse matrices Matrix package.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit hierarchical regularized regression model — xrnet","text":"Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths Generalized Linear Models via Coordinate Descent. Journal Statistical Software, 33(1), 1-22. URL http://www.jstatsoft.org/v33/i01/. Zeng, Y., Breheny, P. (2017). biglasso Package: Memory- Computation-Efficient Solver Lasso Model Fitting Big Data R. arXiv preprint arXiv:1701.05936. URL https://arxiv.org/abs/1701.05936. Michael J. Kane, John Emerson, Stephen Weston (2013). Scalable Strategies Computing Massive Data. Journal Statistical Software, 55(14), 1-19. URL http://www.jstatsoft.org/v55/i14/.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit hierarchical regularized regression model — xrnet","text":"","code":"### hierarchical regularized linear regression ### data(GaussianExample) ## define penalty for predictors and external variables ## default is ridge for predictors and lasso for external ## see define_penalty() function for more details penMain <- define_penalty(0, num_penalty = 20) penExt <- define_penalty(1, num_penalty = 20) ## fit model with defined regularization fit_xrnet <- xrnet( x = x_linear, y = y_linear, external = ext_linear, family = \"gaussian\", penalty_main = penMain, penalty_external = penExt )"},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet_control.html","id":null,"dir":"Reference","previous_headings":"","what":"Control function for xrnet fitting — xrnet_control","title":"Control function for xrnet fitting — xrnet_control","text":"Control function xrnet fitting.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet_control.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Control function for xrnet fitting — xrnet_control","text":"","code":"xrnet_control( tolerance = 1e-08, max_iterations = 1e+05, dfmax = NULL, pmax = NULL, lower_limits = NULL, upper_limits = NULL )"},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet_control.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Control function for xrnet fitting — xrnet_control","text":"tolerance positive convergence criterion. Default 1e-08. max_iterations maximum number iterations run coordinate gradient descent across penalties returning error. Default 1e+05. dfmax maximum number variables allowed model. Default \\(ncol(x) + ncol(unpen) + ncol(external) + intercept[1] + intercept[2]\\). pmax maximum number variables nonzero coefficient estimate. Default \\(min(2 * dfmax + 20, ncol(x) + ncol(unpen) + ncol(external) + intercept[2])\\). lower_limits vector lower limits coefficient. Default -Inf variables. upper_limits vector upper limits coefficient. Default Inf variables.","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/xrnet_control.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Control function for xrnet fitting — xrnet_control","text":"list object following components: tolerance coordinate descent stopping criterion. dfmax maximum number variables allowed model. pmax maximum number variables nonzero coefficient estimate. lower_limits Feature-specific numeric vector lower bounds coefficient estimates upper_limits Feature-specific numeric vector upper bounds coefficient estimates","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/y_linear.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulated outcome data — y_linear","title":"Simulated outcome data — y_linear","text":"Simulated outcome data","code":""},{"path":"https://uscbiostats.github.io/xrnet/reference/y_linear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulated outcome data — y_linear","text":"","code":"y_linear"},{"path":"https://uscbiostats.github.io/xrnet/reference/y_linear.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simulated outcome data — y_linear","text":"vector 100 elements","code":""},{"path":"https://uscbiostats.github.io/xrnet/news/index.html","id":"xrnet-017","dir":"Changelog","previous_headings":"","what":"xrnet 0.1.7","title":"xrnet 0.1.7","text":"CRAN release: 2020-03-01 Patched release fix tests Solaris OS removed test dependency glmnet","code":""},{"path":"https://uscbiostats.github.io/xrnet/news/index.html","id":"xrnet-016","dir":"Changelog","previous_headings":"","what":"xrnet 0.1.6","title":"xrnet 0.1.6","text":"CRAN release: 2020-02-28 First release CRAN Initial release supports linear logistic hierarchical regularized regression","code":""}]
diff --git a/sitemap.xml b/sitemap.xml
index c6d1a22..322ba62 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1,66 +1,66 @@
- /404.html
+ https://uscbiostats.github.io/xrnet/404.html
- /CODE_OF_CONDUCT.html
+ https://uscbiostats.github.io/xrnet/CODE_OF_CONDUCT.html
- /authors.html
+ https://uscbiostats.github.io/xrnet/authors.html
- /index.html
+ https://uscbiostats.github.io/xrnet/index.html
- /news/index.html
+ https://uscbiostats.github.io/xrnet/news/index.html
- /reference/coef.tune_xrnet.html
+ https://uscbiostats.github.io/xrnet/reference/coef.tune_xrnet.html
- /reference/coef.xrnet.html
+ https://uscbiostats.github.io/xrnet/reference/coef.xrnet.html
- /reference/define_enet.html
+ https://uscbiostats.github.io/xrnet/reference/define_enet.html
- /reference/define_lasso.html
+ https://uscbiostats.github.io/xrnet/reference/define_lasso.html
- /reference/define_penalty.html
+ https://uscbiostats.github.io/xrnet/reference/define_penalty.html
- /reference/define_ridge.html
+ https://uscbiostats.github.io/xrnet/reference/define_ridge.html
- /reference/ext_linear.html
+ https://uscbiostats.github.io/xrnet/reference/ext_linear.html
- /reference/index.html
+ https://uscbiostats.github.io/xrnet/reference/index.html
- /reference/plot.tune_xrnet.html
+ https://uscbiostats.github.io/xrnet/reference/plot.tune_xrnet.html
- /reference/predict.tune_xrnet.html
+ https://uscbiostats.github.io/xrnet/reference/predict.tune_xrnet.html
- /reference/predict.xrnet.html
+ https://uscbiostats.github.io/xrnet/reference/predict.xrnet.html
- /reference/tune_xrnet.html
+ https://uscbiostats.github.io/xrnet/reference/tune_xrnet.html
- /reference/x_linear.html
+ https://uscbiostats.github.io/xrnet/reference/x_linear.html
- /reference/xrnet.html
+ https://uscbiostats.github.io/xrnet/reference/xrnet.html
- /reference/xrnet_control.html
+ https://uscbiostats.github.io/xrnet/reference/xrnet_control.html
- /reference/y_linear.html
+ https://uscbiostats.github.io/xrnet/reference/y_linear.html