\HeaderA{predict.plus}{Extract coefficients and make predictions from a plus solution path.}{predict.plus}
\aliasA{coef.plus}{predict.plus}{coef.plus}
\keyword{methods}{predict.plus}
\begin{Description}\relax
While plus() produces turning points in a path of critical points of a penalized squared loss, 
predict.plus extracts coefficients and make predictions at particular penalty levels by linear 
interpolation. The extracted coefficients are the same as these produced by plus() when the 
input lam is the same.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'plus':
predict(object, lam, newx, ...) 
## S3 method for class 'plus':
coef(object, lam, ...) 
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] A fitted plus object
\item[\code{lam}] A decreasing sequence of nonnegative numbers as penalty levels at which the 
coefficients are extracted and predictions are required. Default is the ordered values 
of lam.path generated by plus(). 

\item[\code{newx}] x values at which the fit is required. If newx is not set, coefficients are extacted 
but predictions are not produced.
\item[\code{...}] Additonal arguments for generic methods
\end{ldescription}
\end{Arguments}
\begin{Value}
A list containing the following items: 
\begin{ldescription}
\item[\code{lambda}] penalty levels at which the coefficients and predicted values are extracted.
\item[\code{coefficients}] extracted coefficients.
\item[\code{dimension}] number of nonzero coefficients.
\item[\code{r.square}] R-square as the ratio of the total centered residual sum of squares and the 
total centered sum of squares. 
\item[\code{step}] number of plus steps required to compute the coefficients.
\item[\code{method}] including the LASSO, MC+, and SCAD.
\item[\code{newy}] extracted predictions at newx; not produced if newx is not supplied.
\item[\code{...}] Additonal arguments for generic methods
\end{ldescription}
\end{Value}
\begin{Author}\relax
Cun-Hui Zhang and Ofer Melnik
\end{Author}
\begin{References}\relax
Zhang, C.-H. (2007). Penalized linear unbiased selection. Technical Report No. 2007-003. 
Department of Statistics, Rutgers University.
\end{References}
\begin{SeeAlso}\relax
print, plot, plus
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(sp500)
attach(sp500)

x <- sp500.percent[,3: (dim(sp500.percent)[2])] 
y <- sp500.percent[,1]

object <- plus(x,y,method="mc+")
## extract coefficients for the first 10 values of lam.path at values in x  
extracted.values <- predict(object, lam = sort(object$lam.path[1:10],decreasing=TRUE), newx=object$x)
extracted.coef <- coef(object, lam = sort(object$lam.path[1:10],decreasing=TRUE))
detach(sp500)
\end{ExampleCode}
\end{Examples}

