generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to codebase to reflect recent dev (#93)
- Loading branch information
1 parent
5e6eb64
commit b3a3f1a
Showing
26 changed files
with
4,000 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ar1 <- function(mu, ac, sd, z) { | ||
n <- length(z) | ||
x <- rep(0, n) | ||
tvd <- rep(0, n) | ||
|
||
tvd[1] <- sd * z[1] | ||
x[1] <- mu[1] + tvd[1] | ||
|
||
for (i in 2:n) { | ||
tvd[i] <- ac * tvd[i - 1] + sd * z[i] | ||
x[i] <- mu[i] + tvd[i] | ||
} | ||
return(x) | ||
} | ||
|
||
p_hosp_mean <- rep(0.01, 26) | ||
p_hosp_logit <- qlogis(p_hosp_mean) | ||
ac <- 0.01 | ||
sd <- 0.3 | ||
z <- rnorm(26) | ||
|
||
p_hosp_t_logit <- ar1(p_hosp_logit, ac, sd, z) | ||
|
||
plot(plogis(p_hosp_t_logit)) |
Oops, something went wrong.