Skip to content

Commit

Permalink
Fix moving window default
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahhbellum committed Jun 10, 2019
1 parent e15f885 commit 76551d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/NobBS.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ NobBS <- function(data, now, units, onset_date, report_date, moving_window=NULL,
nBurnin=1000,
nThin=1,
nSamp=10000)) {

# Check that "now" is entered as a Date
if(inherits(now, "Date")==FALSE){
stop("'Now' argument must be of datatype Date (as.Date)")
Expand All @@ -50,6 +51,9 @@ NobBS <- function(data, now, units, onset_date, report_date, moving_window=NULL,
now.T <- length(seq(min(data[,onset_date]),as.Date(now),by=units))

# Check the default arguments
if (is.null(moving_window)) {
moving_window <- now.T
}
if (is.null(max_D)) {
max_D <- now.T-1
}
Expand Down Expand Up @@ -247,4 +251,4 @@ NobBS <- function(data, now, units, onset_date, report_date, moving_window=NULL,

nowcast_results <<- list(estimates=estimates, nowcast.post.samps=nowcast.post.samps,params.post=parameter_extract[2:ncol(parameter_extract)])

}
}

0 comments on commit 76551d7

Please sign in to comment.