Skip to content

Commit

Permalink
update spinar_est_param, spinar_penal, spinar_penal_val
Browse files Browse the repository at this point in the history
  • Loading branch information
MFaymon committed Mar 1, 2024
1 parent 4691b30 commit 71f646e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/spinar_est_param.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#'
#' @export spinar_est_param
spinar_est_param <- function(x, p, type, distr){
assert_integerish(p, lower = 1, upper = 2, len = 1)
assert_integerish(p, lower = 1, upper = 2, len = 1, any.missing = FALSE)
assert_integerish(x, min.len = p+1, lower = 0)
assert(checkChoice(type, c("mom", "ml")))
assert(checkChoice(distr, c("poi", "geo", "nb")))
Expand Down
2 changes: 1 addition & 1 deletion R/spinar_penal.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#'
#' @export spinar_penal
spinar_penal <- function(x, p, penal1 = 0, penal2 = 0) {
assert_integerish(p, lower = 1, upper = 2, len = 1)
assert_integerish(p, lower = 1, upper = 2, len = 1, any.missing = FALSE)
assert_integerish(x, lower = 0, min.len = p+1)
assert_numeric(penal1, len = 1)
assert_numeric(penal2, len = 1)
Expand Down
4 changes: 2 additions & 2 deletions R/spinar_penal_val.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
#'
#' @export spinar_penal_val
spinar_penal_val <- function(x, p, validation, penal1 = NA, penal2 = NA, over = NA, folds = 10, init1 = 1, init2 = 1, progress = TRUE){
assert_integerish(p, lower = 1, len = 1, upper = 2)
assert_integerish(p, lower = 1, len = 1, upper = 2, any.missing = FALSE)
assert_integerish(x, lower = 0, min.len = p+1)
assert_logical(validation, any.missing = FALSE)
assert_numeric(penal1, len = 1)
assert_numeric(penal2, len = 1)

Expand All @@ -64,7 +65,6 @@ spinar_penal_val <- function(x, p, validation, penal1 = NA, penal2 = NA, over =
if(is.na(penal2)){penal2 <- 0}
parameters <- spinar_penal(x, p, penal1, penal2)
} else{
assert_logical(validation)
assert(checkChoice(over, c("L1", "L2", "both")))
assert_integerish(folds, lower = 2, upper = floor((length(x)/(p+1))), len = 1)
assert_numeric(init1, len = 1)
Expand Down

0 comments on commit 71f646e

Please sign in to comment.