get_predictions_lin {CARRoT} | R Documentation |
Predictions for linear regression
Description
Function which runs a linear regression on a training set, computes predictions for the test set
Usage
get_predictions_lin(trset,testset,outc,k,n_tr,p,Rsq,Rsq_v,marg)
Arguments
trset |
values of predictors on the training set |
testset |
values of predictors on the test set |
outc |
values of predictors on the training set |
k |
length of the test set |
n_tr |
size of the training set |
p |
weight of the model |
Rsq |
whether the R-squared statistics constraint is introduced |
Rsq_v |
value of R-squared statistics on the training spli of the data |
marg |
margin of error for R-squared statistics constraint |
Value
An array of continous variables of the length equal to the size of a testset
See Also
Function uses function lsfit
and coef
Examples
trset<-matrix(c(rnorm(90,2,4),runif(90,0,0.5),rbinom(90,1,0.5)),ncol=3)
testset<-matrix(c(rnorm(10,2,4),runif(10,0,0.5),rbinom(10,1,0.5)),ncol=3)
get_predictions_lin(trset,testset,runif(90,0,1),10)
[Package CARRoT version 3.0.2 Index]