print.enetLTS: print from the '"enetLTS"' object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/print.enetLTS.R

Description

Print a summary of the enetLTS object.

Usage

1
2
## S3 method for class 'enetLTS'
print(x,vers=c("reweighted","raw"),zeros=FALSE,...)

Arguments

x

fitted enetLTS object

vers

a character string specifying for which fit to make predictions. Possible values are "reweighted" (the default) for predicting values from the reweighted fit, "raw" for predicting values from the raw fit.

zeros

a logical indicating whether to keep zero coefficients (FALSE, the default) or to keep them (TRUE).

...

additional arguments from the enetLTS object if needed.

Details

The call that produced the enetLTS object is printed, followed by the coefficients, the number of nonzero coefficients and penalty parameters.

Value

The produced object, the coefficients, the number of nonzero coefficients and penalty parameters are returned.

Author(s)

Fatma Sevinc KURNAZ, Irene HOFFMANN, Peter FILZMOSER
Maintainer: Fatma Sevinc KURNAZ <fatmasevinckurnaz@gmail.com>;<fskurnaz@yildiz.edu.tr>

See Also

enetLTS, predict.enetLTS, coef.enetLTS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## for gaussian

set.seed(86)
n <- 100; p <- 25                             # number of observations and variables
beta <- rep(0,p); beta[1:6] <- 1              # 10% nonzero coefficients
sigma <- 0.5                                  # controls signal-to-noise ratio
x <- matrix(rnorm(n*p, sigma),nrow=n)
e <- rnorm(n,0,1)                             # error terms
eps <- 0.1                                    # contamination level
m <- ceiling(eps*n)                           # observations to be contaminated
eout <- e; eout[1:m] <- eout[1:m] + 10        # vertical outliers
yout <- c(x %*% beta + sigma * eout)          # response
xout <- x; xout[1:m,] <- xout[1:m,] + 10      # bad leverage points


fit1 <- enetLTS(xout,yout,alphas=0.5,lambdas=0.05,plot=FALSE)
print(fit1)
print(fit1,vers="raw")
print(fit1,vers="raw",zeros=TRUE)
print(fit1,zeros=TRUE)

## for binomial

eps <-0.05                                     # %10 contamination to only class 0
m <- ceiling(eps*n)
y <- sample(0:1,n,replace=TRUE)
xout <- x
xout[y==0,][1:m,] <- xout[1:m,] + 10;          # class 0
yout <- y                                      # wrong classification for vertical outliers



fit2 <- enetLTS(xout,yout,family="binomial",alphas=0.5,lambdas=0.05,plot=FALSE)
print(fit2)
print(fit2,vers="raw")
print(fit2,vers="raw",zeros=TRUE)
print(fit2,zeros=TRUE)

enetLTS documentation built on May 1, 2019, 7:43 p.m.