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

truncate_model() generic #144

Merged
merged 7 commits into from
Aug 8, 2018
Merged

truncate_model() generic #144

merged 7 commits into from
Aug 8, 2018

Conversation

tnagler
Copy link
Collaborator

@tnagler tnagler commented Aug 8, 2018

No description provided.


#' @export
#' @rdname truncate_model
truncate_model.rvine_matrix <- function(object, trunc_lvl, ...) {
Copy link
Collaborator

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 ?

#' @export
#' @rdname truncate_model
truncate_model.vinecop_dist <- function(object, trunc_lvl, ...) {
if (trunc_lvl < dim(object)["trunc_lvl"]) {
Copy link
Collaborator

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 ?

)
assert_that(
is.scalar(trunc_lvl),
is.number(trunc_lvl),
Copy link
Collaborator

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.

is.scalar(trunc_lvl),
is.number(trunc_lvl),
trunc_lvl >= 1,
trunc_lvl < dim(object)[1],
Copy link
Collaborator

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] ?

@tvatter tvatter merged commit fb7bb32 into dev Aug 8, 2018
@tvatter tvatter deleted the truncate-generic branch August 8, 2018 22:51
tvatter pushed a commit that referenced this pull request Aug 9, 2018
* 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
tvatter pushed a commit that referenced this pull request Aug 9, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants