-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from sor16/Rcpp-to-speed-up-mcmc
Rcpp to speed up mcmc (and various other changes)
- Loading branch information
Showing
342 changed files
with
36,686 additions
and
16,397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Package: bdrc | ||
Title: Bayesian Discharge Rating Curves | ||
Version: 1.1.0.9000 | ||
Version: 2.0.0 | ||
Authors@R: c(person("Birgir", "Hrafnkelsson", email = "[email protected]", role = c("aut","cph"),comment=c(ORCID="0000-0003-1864-9652")), | ||
person("Solvi", "Rognvaldsson", email = "[email protected]", role = c("aut","cre"),comment=c(ORCID="0000-0002-4376-3361")), | ||
person("Axel Orn", "Jansson", email = "axelorn94@gmail.com", role = c("aut")), | ||
person("Rafael Daníel", "Vias", email = "raffidv@gmail.com", role = c("aut"),comment=c(ORCID="0009-0007-2601-6800")) | ||
person("Solvi", "Rognvaldsson", email = "[email protected]", role = c("aut"),comment=c(ORCID="0000-0002-4376-3361")), | ||
person(given = "Rafael Daníel", family = "Vias", email = "raffidv@gmail.com", role = c("aut", "cre"), comment=c(ORCID = "0009-0007-2601-6800")), | ||
person("Axel Orn", "Jansson", email = "axelorn94@gmail.com", role = c("aut")) | ||
) | ||
Maintainer: Solvi Rognvaldsson <solviro@gmail.com> | ||
Maintainer: Rafael Daníel Vias <raffidv@gmail.com> | ||
Description: Fits a discharge rating curve based on the power-law and the generalized power-law from data on paired stage and discharge measurements in a given river using a Bayesian hierarchical model as described in Hrafnkelsson et al. (2020) <arXiv:2010.04769>. | ||
Depends: R (>= 3.5.0) | ||
License: MIT + file LICENSE | ||
|
@@ -16,6 +16,7 @@ Imports: | |
ggplot2, | ||
grid, | ||
gridExtra, | ||
Rcpp, | ||
rlang, | ||
scales | ||
Suggests: | ||
|
@@ -28,3 +29,6 @@ VignetteBuilder: knitr | |
URL: https://sor16.github.io/bdrc | ||
BugReports: https://github.com/sor16/bdrc/issues | ||
Encoding: UTF-8 | ||
LinkingTo: | ||
Rcpp, | ||
RcppArmadillo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
gplm_density_evaluation_unknown_c_cpp <- function(theta, P, h, B, dist, A, y, epsilon, h_min, nugget, n_unique, mu_x, Sig_ab, Z, lambda_c, lambda_sb, lambda_pb, lambda_eta_1, lambda_seta) { | ||
.Call(`_bdrc_gplm_density_evaluation_unknown_c_cpp`, theta, P, h, B, dist, A, y, epsilon, h_min, nugget, n_unique, mu_x, Sig_ab, Z, lambda_c, lambda_sb, lambda_pb, lambda_eta_1, lambda_seta) | ||
} | ||
|
||
gplm_density_evaluation_known_c_cpp <- function(theta, P, h, B, dist, A, y, epsilon, nugget, n_unique, mu_x, Sig_ab, Z, lambda_sb, lambda_pb, lambda_eta_1, lambda_seta, c) { | ||
.Call(`_bdrc_gplm_density_evaluation_known_c_cpp`, theta, P, h, B, dist, A, y, epsilon, nugget, n_unique, mu_x, Sig_ab, Z, lambda_sb, lambda_pb, lambda_eta_1, lambda_seta, c) | ||
} | ||
|
||
gplm_predict_u_unknown_c_cpp <- function(theta, x, P, B_u, h_unique, h_u, dist_all, h_min, nugget, n_unique, n_u) { | ||
.Call(`_bdrc_gplm_predict_u_unknown_c_cpp`, theta, x, P, B_u, h_unique, h_u, dist_all, h_min, nugget, n_unique, n_u) | ||
} | ||
|
||
gplm_predict_u_known_c_cpp <- function(theta, x, P, B_u, h_unique, h_u, dist_all, c, nugget, n_unique, n_u) { | ||
.Call(`_bdrc_gplm_predict_u_known_c_cpp`, theta, x, P, B_u, h_unique, h_u, dist_all, c, nugget, n_unique, n_u) | ||
} | ||
|
||
gplm0_density_evaluation_unknown_c_cpp <- function(theta, h, y, A, dist, epsilon, h_min, nugget, n_unique, mu_x, Sig_ab, Z, lambda_c, lambda_se, lambda_sb, lambda_pb) { | ||
.Call(`_bdrc_gplm0_density_evaluation_unknown_c_cpp`, theta, h, y, A, dist, epsilon, h_min, nugget, n_unique, mu_x, Sig_ab, Z, lambda_c, lambda_se, lambda_sb, lambda_pb) | ||
} | ||
|
||
gplm0_density_evaluation_known_c_cpp <- function(theta, h, y, A, dist, epsilon, c, nugget, n_unique, mu_x, Sig_ab, Z, lambda_se, lambda_sb, lambda_pb) { | ||
.Call(`_bdrc_gplm0_density_evaluation_known_c_cpp`, theta, h, y, A, dist, epsilon, c, nugget, n_unique, mu_x, Sig_ab, Z, lambda_se, lambda_sb, lambda_pb) | ||
} | ||
|
||
gplm0_predict_u_unknown_c_cpp <- function(theta, x, h_unique, h_u, dist_all, h_min, nugget, n_unique, n_u) { | ||
.Call(`_bdrc_gplm0_predict_u_unknown_c_cpp`, theta, x, h_unique, h_u, dist_all, h_min, nugget, n_unique, n_u) | ||
} | ||
|
||
gplm0_predict_u_known_c_cpp <- function(theta, x, h_unique, h_u, dist_all, c, nugget, n_unique, n_u) { | ||
.Call(`_bdrc_gplm0_predict_u_known_c_cpp`, theta, x, h_unique, h_u, dist_all, c, nugget, n_unique, n_u) | ||
} | ||
|
||
matMult <- function(A, B) { | ||
.Call(`_bdrc_matMult`, A, B) | ||
} | ||
|
||
choleskyDecomp <- function(X) { | ||
.Call(`_bdrc_choleskyDecomp`, X) | ||
} | ||
|
||
solveArma <- function(A, B) { | ||
.Call(`_bdrc_solveArma`, A, B) | ||
} | ||
|
||
matInverse <- function(A) { | ||
.Call(`_bdrc_matInverse`, A) | ||
} | ||
|
||
compute_L <- function(X, Sig_x, Sig_eps, nugget) { | ||
.Call(`_bdrc_compute_L`, X, Sig_x, Sig_eps, nugget) | ||
} | ||
|
||
compute_w <- function(L, y, X, mu_x) { | ||
.Call(`_bdrc_compute_w`, L, y, X, mu_x) | ||
} | ||
|
||
get_MCMC_summary_cpp <- function(X, h) { | ||
.Call(`_bdrc_get_MCMC_summary_cpp`, X, h) | ||
} | ||
|
||
calc_variogram_arma <- function(param_mat, i, burnin, nr_iter) { | ||
.Call(`_bdrc_calc_variogram_arma`, param_mat, i, burnin, nr_iter) | ||
} | ||
|
||
variogram_chain <- function(T_max, param_mat1, param_mat2, burnin, nr_iter) { | ||
.Call(`_bdrc_variogram_chain`, T_max, param_mat1, param_mat2, burnin, nr_iter) | ||
} | ||
|
||
distance_matrix <- function(x) { | ||
.Call(`_bdrc_distance_matrix`, x) | ||
} | ||
|
||
create_A_cpp <- function(h) { | ||
.Call(`_bdrc_create_A_cpp`, h) | ||
} | ||
|
||
pri <- function(type, args) { | ||
.Call(`_bdrc_pri`, type, args) | ||
} | ||
|
||
chain_statistics_cpp <- function(chains) { | ||
.Call(`_bdrc_chain_statistics_cpp`, chains) | ||
} | ||
|
||
plm_density_evaluation_unknown_c_cpp <- function(theta, P, h, B, y, epsilon, Sig_x, mu_x, h_min, nugget, lambda_c, lambda_eta_1, lambda_seta) { | ||
.Call(`_bdrc_plm_density_evaluation_unknown_c_cpp`, theta, P, h, B, y, epsilon, Sig_x, mu_x, h_min, nugget, lambda_c, lambda_eta_1, lambda_seta) | ||
} | ||
|
||
plm_density_evaluation_known_c_cpp <- function(theta, P, h, B, y, epsilon, Sig_x, mu_x, c, nugget, lambda_eta_1, lambda_seta) { | ||
.Call(`_bdrc_plm_density_evaluation_known_c_cpp`, theta, P, h, B, y, epsilon, Sig_x, mu_x, c, nugget, lambda_eta_1, lambda_seta) | ||
} | ||
|
||
plm_predict_u_unknown_c_cpp <- function(theta, x, P, B_u, h_u, h_min, n_u) { | ||
.Call(`_bdrc_plm_predict_u_unknown_c_cpp`, theta, x, P, B_u, h_u, h_min, n_u) | ||
} | ||
|
||
plm_predict_u_known_c_cpp <- function(theta, x, P, B_u, h_u, c) { | ||
.Call(`_bdrc_plm_predict_u_known_c_cpp`, theta, x, P, B_u, h_u, c) | ||
} | ||
|
||
plm0_density_evaluation_unknown_c_cpp <- function(theta, h, y, epsilon, Sig_ab, mu_x, h_min, nugget, lambda_c, lambda_se) { | ||
.Call(`_bdrc_plm0_density_evaluation_unknown_c_cpp`, theta, h, y, epsilon, Sig_ab, mu_x, h_min, nugget, lambda_c, lambda_se) | ||
} | ||
|
||
plm0_density_evaluation_known_c_cpp <- function(theta, h, y, epsilon, Sig_ab, mu_x, c, nugget, lambda_se) { | ||
.Call(`_bdrc_plm0_density_evaluation_known_c_cpp`, theta, h, y, epsilon, Sig_ab, mu_x, c, nugget, lambda_se) | ||
} | ||
|
||
plm0_predict_u_unknown_c_cpp <- function(theta, x, h_u, h_min) { | ||
.Call(`_bdrc_plm0_predict_u_unknown_c_cpp`, theta, x, h_u, h_min) | ||
} | ||
|
||
plm0_predict_u_known_c_cpp <- function(theta, x, h_u, c) { | ||
.Call(`_bdrc_plm0_predict_u_known_c_cpp`, theta, x, h_u, c) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## usethis namespace: start | ||
#' @importFrom Rcpp sourceCpp | ||
#' @useDynLib bdrc, .registration = TRUE | ||
## usethis namespace: end | ||
NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.