Skip to content

Commit

Permalink
Begin working on delay_samples functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
athowes committed Jul 30, 2024
1 parent 9757409 commit 7f5f730
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions R/delay-samples.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
delay_samples <- function(fit) {
dpars <- fit$family$dpars
lp_mu <- brms::posterior_linpred(fit, transform = TRUE, dpar = dpars[1])

Check warning on line 3 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=3,col=3,[object_usage_linter] local variable 'lp_mu' assigned but may not be used
lp_sigma <- brms::posterior_linpred(fit, transform = TRUE, dpar = dpars[2])

Check warning on line 4 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=4,col=3,[object_usage_linter] local variable 'lp_sigma' assigned but may not be used

Check warning on line 5 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=5,col=1,[trailing_whitespace_linter] Trailing whitespace is superfluous.
# lp_mu <- brms::posterior_linpred(fit, transform = TRUE, dpar = "mu") |>
# as.table() |>
# as.data.table()

Check warning on line 8 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=8,col=7,[commented_code_linter] Commented code should be removed.
# names(lp_mu) <- c("draw", "index", "mu")

Check warning on line 9 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=9,col=5,[commented_code_linter] Commented code should be removed.
# lp_sigma <- brms::posterior_linpred(fit, transform = TRUE, dpar = "sigma") |>

Check warning on line 10 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=10,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 81 characters.
# as.table() |>
# as.data.table(value.name = "sigma")

Check warning on line 12 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=12,col=7,[commented_code_linter] Commented code should be removed.
# names(lp_sigma) <- c("draw", "index", "sigma")

Check warning on line 13 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=13,col=5,[commented_code_linter] Commented code should be removed.
# lp <- dplyr::left_join(lp_mu, lp_sigma)

Check warning on line 14 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=14,col=5,[commented_code_linter] Commented code should be removed.
# class(lp) <- c(class(lp), "lognormal_samples")

Check warning on line 15 in R/delay-samples.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/delay-samples.R,line=15,col=5,[commented_code_linter] Commented code should be removed.
# x <- add_mean_sd(lp)
}

0 comments on commit 7f5f730

Please sign in to comment.