Description Usage Arguments Value See Also Examples
View source: R/CRISP_functions.R
This function implements CRISP, which considers the problem of predicting an outcome variable on the basis of two covariates, using an interpretable yet non-additive model. CRISP partitions the covariate space into blocks in a data-adaptive way, and fits a mean model within each block. Unlike other partitioning methods, CRISP is fit using a non-greedy approach by solving a convex optimization problem, resulting in low-variance fits. More details are provided in Petersen, A., Simon, N., and Witten, D. (2016). Convex Regression with Interpretable Sharp Partitions. Journal of Machine Learning Research, 17(94): 1-31 <http://jmlr.org/papers/volume17/15-344/15-344.pdf>.
1 2 3 |
y |
An n-vector containing the response. |
X |
An n x 2 matrix with each column containing a covariate. |
q |
The desired granularity of the CRISP fit, |
lambda.min.ratio |
The smallest value for |
n.lambda |
The number of lambda values to consider - the default is 50. |
lambda.seq |
A user-supplied sequence of positive lambda values to consider. The typical usage is to calculate
|
rho |
The penalty parameter for our ADMM algorithm. The default is 0.1. |
e_abs, e_rel |
Values used in the stopping criterion for our ADMM algorithm, and discussed in Appendix C.2 of the CRISP paper. |
varyrho |
Should |
double.run |
The initial complete run of our ADMM algorithm will yield sparsity in z_1i and z_2i, but not
necessarily exact equality of the rows and columns of |
An object of class crisp
, which can be summarized using summary
, plotted using plot
, and used to predict outcome values for new covariates using predict
.
M.hat.list
: A list of length n.lambda
giving M.hat
for each value of lambda.seq
.
num.blocks
: A vector of length n.lambda
giving the number of blocks in M.hat
for each value of lambda.seq
.
obj.vec
: A vector of length n.lambda
giving the value of the objective of Eqn (4) in the CRISP paper for each value of lambda.seq
.
Other elements: As specified by the user.
crispCV
, plot
, summary
, predict
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
#See ?'crisp-package' for a full example of how to use this package
#generate data (using a very small 'n' for illustration purposes)
set.seed(1)
data <- sim.data(n = 15, scenario = 2)
#fit model for a range of tuning parameters, i.e., lambda values
#lambda sequence is chosen automatically if not specified
crisp.out <- crisp(X = data$X, y = data$y)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.