Skip to content
Snippets Groups Projects
Commit 2a65e98e authored by hgb's avatar hgb
Browse files

update small fixes all over

parent 228d2856
Branches 3d_watershed
No related tags found
No related merge requests found
...@@ -21,14 +21,27 @@ Rcpp::List rq_simplex_cpp(arma::mat X, ...@@ -21,14 +21,27 @@ Rcpp::List rq_simplex_cpp(arma::mat X,
arma::vec cC = arma::join_cols(arma::ones<arma::vec>(K) * tau, arma::ones<arma::vec>(K) * (1-tau)); arma::vec cC = arma::join_cols(arma::ones<arma::vec>(K) * tau, arma::ones<arma::vec>(K) * (1-tau));
// This here below will give problem if there is NA in the design matrix
// The sort_index will fail, and so, somehow in sorting then we need to make sure that
// index with NA needs to be removed or not used.
//Rcout << Xny .rows(Ihc) << "\n"; //Rcout << Xny .rows(Ihc) << "\n";
// Rcout << X.rows(Ihc) << "\n";
// Rcout << "bingooo" << "\n";
// Rcout << Ihc << "\n";
// Rcout << "faar" << "\n";
// Rcout << invXh << "\n";
arma::mat IB2 = -(P * arma::ones<arma::vec>(K).t() % X.rows(Ihc))*invXh; arma::mat IB2 = -(P * arma::ones<arma::vec>(K).t() % X.rows(Ihc))*invXh;
// Rcout << cB << "\n";
// Rcout << "bluee" << "\n";
// Rcout << IB2.t() << "\n";
arma::vec g = IB2.t() * cB; arma::vec g = IB2.t() * cB;
//Rcout << g << "\n";
//Rcout << cC << "\n";
arma::vec d = cC - arma::join_cols(g,-g); arma::vec d = cC - arma::join_cols(g,-g);
d.elem(find(abs(d) < 1.e-15)).fill(0); d.elem(find(abs(d) < 1.e-15)).fill(0);
// Rcout << d << "\n";
arma::uvec s = sort_index(d); arma::uvec s = sort_index(d);
arma::vec md = sort(d); arma::vec md = sort(d);
......
...@@ -33,7 +33,7 @@ Rcpp::List rq_update_cpp(arma::mat newX, ...@@ -33,7 +33,7 @@ Rcpp::List rq_update_cpp(arma::mat newX,
X = W * X; X = W * X;
} }
X = join_cols(X, newX); // X = join_cols(X, newX);
// Rolling window of leaving the design matrix // Rolling window of leaving the design matrix
// i.e. the last observation leaves the matrix // i.e. the last observation leaves the matrix
...@@ -110,7 +110,8 @@ Rcpp::List rq_update_cpp(arma::mat newX, ...@@ -110,7 +110,8 @@ Rcpp::List rq_update_cpp(arma::mat newX,
double rny = arma::as_scalar(newX(kk, Iy)) - Ypred; double rny = arma::as_scalar(newX(kk, Iy)) - Ypred;
//Rcout << "rny" << rny << "\n"; //Rcout << "rny" << rny << "\n";
X = join_cols(X, newX);
int szR = Rny.size(); int szR = Rny.size();
Rny.resize(szR+1); Rny.resize(szR+1);
Rny(szR) = rny; Rny(szR) = rny;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment