Description Usage Arguments Value Examples
Use ADMM to find solution pairs and approximate parameters in Gaussian, Binomial, Poisson, and Cox models.
1 2 3 4 5 6 7 | ECLasso.fit(x, y, lambda_seq = NULL, family = c("gaussian", "binomial",
"poisson", "cox"), rho = 1, intercept = TRUE, equality = FALSE,
censor = NULL, C = NULL, d = NULL, inexact = FALSE,
tol = 1e-04, maxit = 1000, nlambda = 100,
lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e-04), min.abs = 0,
lower.limits = -Inf, upper.limits = Inf, penalty.factor = 1,
toplot = TRUE, ParamCutoff = NULL, exclude = rep(FALSE, nvars))
|
x |
The design matrix of the data. |
y |
The response vector; must contain the same amount of values as rows of x. |
lambda_seq |
User-specified sequence of lambdas the algorithm forced to iterate over, default NULL. |
family |
The type of model the data comes from; gaussian, binomial, poisson, or Cox. |
rho |
Weight given to equality constraint vs. loss function, default is 1 aka equal weighting. |
intercept |
Determines whether to add an intercept to the design matrix. |
equality |
Forces the parameters to sum to zero if TRUE. |
censor |
A 0/1 vector for Cox family only, where 1 is exact and 0 is right-censored; default is NULL. |
C |
Part of equality constraints, set to 1 if equality is TRUE, 0 otherwise. |
d |
Part of equality constraints, always set to 0 unless user-defined. |
inexact |
If true, solves a quadratic approximation of the objective function at each iteration; required to be TRUE for "cox" family. |
tol |
Determines stopping criteria for the algorithm. |
maxit |
Half the max amount of time each iteration allowed to run. |
nlambda |
The number of lambdas the function iterates over, should be a multiple of 50. |
lambda.min.ratio |
Defines what fraction of the maximum lambda the minimum is. |
min.abs |
Any covariate effect with smaller absolute value than this is set to zero during iteration. |
lower.limits |
Lower boundary of parameter, any iteration with term(s) below this is reset to this value. |
upper.limits |
Upper boundary of parameter, any iteration with term(s) above this is reset to this value. |
penalty.factor |
Penalty factor for shrinkage function, involved in z update. |
toplot |
Determines if a plot of the solution path should be outputted |
ParamCutoff |
Specify a cutoff above which predictors are returned at completion, if NULL by default, returns the 6 predictors with greatest magnitude |
Solution: parameter estimates at each iteration, time: total elapsed program time, Iter: Time taken for each iteration (consider increasing maxit if this is at maximum), Lambda: the lambda for each iteration, Intercept: intercept value if specified TRUE.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | c0=0.1
beta1=1
beta2=-1
beta3=0.5
beta4=-0.5
betazeroes<-rep(0,6)
betavector<-c(beta1,beta2,beta3,beta4,t(betazeroes))
n=200
xdata<-matrix(rnorm(n*length(betavector)),ncol=length(betavector))
times=rexp(n,c0*exp(rowSums(t(t(xdata)*betavector))))
time.censor=rexp(n,c0*exp(beta1*xdata[,1]))
censorv=ifelse(times<time.censor, 1, 0)
time <- ifelse(times<time.censor, times, time.censor)
ECLasso.fit(x=xdata,y=time,family="cox",intercept=FALSE,equality=TRUE,censor=censorv,inexact=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.