Skip to content

Commit

Permalink
styler on aeddo()
Browse files Browse the repository at this point in the history
  • Loading branch information
telkamp7 committed Nov 8, 2023
1 parent fa7c7de commit 191c00f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions R/aeddo.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ aeddo <- function(
lower,
upper,
method = "BFGS") {

# Count the number of observations
n_observations <- length(y)

Expand All @@ -24,7 +23,8 @@ aeddo <- function(
u_probability = numeric(),
outbreak_alarm = logical()
),
class = "aedseo")
class = "aedseo"
)

# Loop over the observations to perform windowed estimation
for (i in 1:(n_observations - k)) {
Expand Down Expand Up @@ -99,5 +99,4 @@ aeddo <- function(
}

return(results)

}
5 changes: 2 additions & 3 deletions tests/testthat/test-aeddo.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
test_that("Proper 'aedseo' class is returned", {

# Generate some sample data
y <- rnbinom(n = 40, size = 10, prob = 0.7)

Expand All @@ -14,9 +13,9 @@ test_that("Proper 'aedseo' class is returned", {
init_theta = c(1, 1),
lower = c(-Inf, 1e-6),
upper = c(Inf, 1e2),
method = "L-BFGS-B")
method = "L-BFGS-B"
)

# Test that the correct class is returned
expect_s3_class(aeddo_results, "aedseo")

})

0 comments on commit 191c00f

Please sign in to comment.