Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating RcppArmadillo initialization #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/specs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ arma::vec ridge (const arma::vec y,const arma::mat x,arma::mat XX) {
arma::mat x_train = x.rows(0,tau-1); arma::mat x_test = x.rows(tau,t-1);
arma::mat xx = x_train.t() * x_train; arma::vec xy = x_train.t() * y_train;
arma::vec s = svd(xx); //singular values of x'x
arma::vec a; a << 0.0 << arma::endr << (max(s)*tol - min(s))/(1-tol) << arma::endr; //vector with (0,LB)
arma::vec a({ 0.0, (max(s)*tol - min(s))/(1-tol) }); //vector with (0,LB)
double lambda_min = max(a); //minimum penalty to ensure good conditioning
arma::vec lambdas = arma::zeros(6); //initial lambdas
arma::vec CVs = arma::zeros(6); //store cross-validation results
Expand Down