| coef.sgs | R Documentation |
"sgs", "sgs_cv", "gslope", "gslope_cv".Print the coefficients using model fitted with one of the following functions: fit_sgs(), fit_sgs_cv(), fit_gslope(), fit_gslope_cv(), fit_sgo(), fit_sgo_cv(), fit_goscar(), fit_goscar_cv().
The predictions are calculated for each "lambda" value in the path.
## S3 method for class 'sgs'
coef(object, ...)
object |
Object of one of the following classes: |
... |
further arguments passed to stats function. |
The fitted coefficients
fit_sgs(), fit_sgs_cv(), fit_gslope(), fit_gslope_cv()
Other SGS-methods:
as_sgs(),
fit_sgo(),
fit_sgo_cv(),
fit_sgs(),
fit_sgs_cv(),
plot.sgs(),
predict.sgs(),
print.sgs(),
scaled_sgs()
Other gSLOPE-methods:
fit_goscar(),
fit_goscar_cv(),
fit_gslope(),
fit_gslope_cv(),
plot.sgs(),
predict.sgs(),
print.sgs()
# specify a grouping structure
groups = c(1,1,1,2,2,3,3,3,4,4)
# generate data
data = gen_toy_data(p=10, n=5, groups = groups, seed_id=3,group_sparsity=1)
# run SGS
model = fit_sgs(X = data$X, y = data$y, groups = groups, type="linear", lambda = 1, alpha=0.95,
vFDR=0.1, gFDR=0.1, standardise = "l2", intercept = TRUE, verbose=FALSE)
# use predict function
model_coef = coef(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.