Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
onlineforecast
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
packages
onlineforecast
Commits
2a65e98e
Commit
2a65e98e
authored
3 weeks ago
by
hgb
Browse files
Options
Downloads
Patches
Plain Diff
update small fixes all over
parent
228d2856
Branches
3d_watershed
No related tags found
No related merge requests found
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rq_simplex_cpp.cpp
+15
-2
15 additions, 2 deletions
src/rq_simplex_cpp.cpp
src/rq_update_cpp.cpp
+3
-2
3 additions, 2 deletions
src/rq_update_cpp.cpp
with
18 additions
and
4 deletions
src/rq_simplex_cpp.cpp
+
15
−
2
View file @
2a65e98e
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/rq_update_cpp.cpp
+
3
−
2
View file @
2a65e98e
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment