View source: R/penalised_models.R
| PenalisedRegression | R Documentation | 
Runs penalised regression using implementation from
glmnet. This function is not using stability.
PenalisedRegression(
  xdata,
  ydata,
  Lambda = NULL,
  family,
  penalisation = c("classic", "randomised", "adaptive"),
  gamma = NULL,
  ...
)
| xdata | matrix of predictors with observations as rows and variables as columns. | 
| ydata | optional vector or matrix of outcome(s). If  | 
| Lambda | matrix of parameters controlling the level of sparsity. | 
| family | type of regression model. This argument is defined as in
 | 
| penalisation | type of penalisation to use. If
 | 
| gamma | parameter for randomised or adaptive regularisation. Default is
 | 
| ... | additional parameters passed to  | 
A list with:
| selected | matrix of binary selection status. Rows correspond to different model parameters. Columns correspond to predictors. | 
| beta_full | array of model coefficients. Rows correspond to different model parameters. Columns correspond to predictors. Indices along the third dimension correspond to outcome variable(s). | 
AdaptiveLassosharp
\insertReflassosharp
SelectionAlgo, VariableSelection
Other underlying algorithm functions: 
CART(),
ClusteringAlgo(),
PenalisedGraphical(),
PenalisedOpenMx()
# Data simulation
set.seed(1)
simul <- SimulateRegression(pk = 50)
# Running the LASSO
mylasso <- PenalisedRegression(
  xdata = simul$xdata, ydata = simul$ydata,
  Lambda = c(0.1, 0.2), family = "gaussian"
)
# Using glmnet arguments
mylasso <- PenalisedRegression(
  xdata = simul$xdata, ydata = simul$ydata,
  Lambda = c(0.1), family = "gaussian",
  penalty.factor = c(rep(0, 10), rep(1, 40))
)
mylasso$beta_full
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.