-
Notifications
You must be signed in to change notification settings - Fork 8
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
truncate_model() generic #144
Conversation
|
||
#' @export | ||
#' @rdname truncate_model | ||
truncate_model.rvine_matrix <- function(object, trunc_lvl, ...) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not set to zero the correct elements directly ?
R/truncate_model.R
Outdated
#' @export | ||
#' @rdname truncate_model | ||
truncate_model.vinecop_dist <- function(object, trunc_lvl, ...) { | ||
if (trunc_lvl < dim(object)["trunc_lvl"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check_trunc_lvl before using it in an if ?
R/truncate_model.R
Outdated
) | ||
assert_that( | ||
is.scalar(trunc_lvl), | ||
is.number(trunc_lvl), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a detail, but with is.count
, you can remove the next line.
R/truncate_model.R
Outdated
is.scalar(trunc_lvl), | ||
is.number(trunc_lvl), | ||
trunc_lvl >= 1, | ||
trunc_lvl < dim(object)[1], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also at least warn the user when trunc_lvl > dim(object)[2]
?
* vinecopulib -> rvinecopulib in NEWS (#114) * vinecopulib -> rvinecopulib in NEWS * update API docs * Weights (#118) * pull new sources * update * gumbel parameter * update sources * update sources * add students stuff * Improve doc (#120) * example for mBICv * improve truncate_model * clean-up * fix compiler warnings (#123) * use a single wrapper file (#124) * fix bugs in vine class generics (solves #128) (#131) * improve print generics * improve summary methods * adapt unit tests * rename margin summary functions * remove is.null(x$data) since ll is always stored * modularize code for print generics * rename to summary_df * prallelize pdf/simulate etc (#130) * use distr instead of name in vine_dist (solves #132) (#134) * use distr instead of name in vine_dist * fix rvcl example * use keep_data = FALSE as default (#133) * use keep_data = FALSE as default * adapt examples * add quasi-random numbers (#126) * add cores to doc (#139) * remove non-portable compilation flag (#141) * refactor rvine-structure (#136) * refactor rvine-structure * more refactoring * correct doc * refactor wrappers (#140) * check -> is, to -> as, unit tests * add rvine_structure constructor and unit tests * updates for CRAN checks * updates for CRAN checks + 1 * update generics * r-vine -> R-vine (#143) * new (inverse_)rosenblatt() functions (#142) * new inverse_rosenblatt() function * add examples * fix docs * add unit tests * pull sources for rosenblatt transform * add rosenblatt transform * add unit tests * truncate_model() generic (#144) * rewrite truncate_model() as generic * add unit tests * remove trunc_lvl as required argument * make rvine_matrix method more efficient * use is.count * always check trunc_lvl early * warning for ineffective trunc_lvl * Prepare release [wait for #144 first] (#145) * bump version * update NEWS * add news item for truncate_model() * pull latest sources * add rvine_structure and rvine_matrix to NEWS * add vinereg notice * add revdep info * update API docs * add BOOST_MATH_PROMOTE_DOUBLE_POLICY preprocesser flag
No description provided.