Skip to content

Commit

Permalink
Automated build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeksterslab committed Jan 14, 2025
1 parent 8820a1d commit 38656fe
Show file tree
Hide file tree
Showing 68 changed files with 7,111 additions and 22 deletions.
Binary file modified .setup/build/cTMed.pdf
Binary file not shown.
Binary file removed .setup/build/cTMed_1.0.4.9000.tar.gz
Binary file not shown.
Binary file added .setup/build/cTMed_1.0.5.tar.gz
Binary file not shown.
11 changes: 0 additions & 11 deletions .setup/latex/bib/quarto.bib

This file was deleted.

5 changes: 5 additions & 0 deletions .setup/latex/pdf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
*/
!*.pdf
!.gitignore
!bib.bib
5,635 changes: 5,635 additions & 0 deletions .setup/latex/pdf/bib.bib

Large diffs are not rendered by default.

Binary file added .setup/latex/pdf/cTMed-001-description.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/cTMed-999-session.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/cTMed-zzz-references.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/cTMed-zzz-tests-benchmark.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/cTMed-zzz-tests-external.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/cTMed-zzz-tests-internal.pdf
Binary file not shown.
Binary file added .setup/latex/pdf/cTMed-zzz-tests-staging.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion .setup/vignettes/fit-ct-var-dynr.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ knitr::opts_chunk$set(
```{r}
#| echo = FALSE
set.seed(42)
n <- 5
n <- 50
time <- 100
delta_t <- 0.10
k <- p <- 3
Expand Down
2 changes: 1 addition & 1 deletion .setup/vignettes/fit-ct-var-mx.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ knitr::opts_chunk$set(
```{r}
#| echo = FALSE
set.seed(42)
n <- 5
n <- 50
time <- 100
delta_t <- 0.10
k <- p <- 3
Expand Down
2 changes: 1 addition & 1 deletion .setup/vignettes/med-boot.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The `cTMed` package provides a bootstrap approach, in addition to the delta and
```{r}
#| include = FALSE
set.seed(42)
n <- 5
n <- 50
time <- 100
delta_t <- 0.10
k <- p <- 3
Expand Down
2 changes: 1 addition & 1 deletion .setup/vignettes/med-std.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ mc <- MCMedStd(
from = "x",
to = "y",
med = "m",
R = 1000L,
R = 20000L,
ncores = parallel::detectCores() # use multiple cores
)
plot(mc)
Expand Down
2 changes: 1 addition & 1 deletion .setup/vignettes/med.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mc <- MCMed(
from = "x",
to = "y",
med = "m",
R = 1000L,
R = 20000L,
ncores = parallel::detectCores() # use multiple cores
)
plot(mc)
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: 'To cite package "cTMed" in publications use:'
type: software
license: GPL-3.0-or-later
title: 'cTMed: Continuous Time Mediation'
version: 1.0.4.9000
version: 1.0.5
identifiers:
- type: doi
value: 10.32614/CRAN.package.cTMed
Expand All @@ -31,7 +31,7 @@ preferred-citation:
email: [email protected]
orcid: https://orcid.org/0000-0003-4818-8420
year: '2024'
notes: R package version 1.0.4.9000
notes: R package version 1.0.5
repository: https://CRAN.R-project.org/package=cTMed
repository-code: https://github.com/jeksterslab/cTMed
url: https://jeksterslab.github.io/cTMed/
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cTMed
Title: Continuous Time Mediation
Version: 1.0.4.9000
Version: 1.0.5
Authors@R:
person(given = "Ivan Jacob Agaloos",
family = "Pesigan",
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ S3method(summary,ctmedposteriorphi)
S3method(summary,ctmedtraj)
export(BootBeta)
export(BootBetaStd)
export(BootIndirectCentral)
export(BootMed)
export(BootMedStd)
export(BootTotalCentral)
export(DeltaBeta)
export(DeltaBetaStd)
export(DeltaIndirectCentral)
Expand Down
5 changes: 2 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# cTMed 1.0.4.9000
# cTMed 1.0.5

## Patch

* Latest development version.
* Added the `MCPhiSigma()` function.
* Minor edits to tests.
* Added the `BootIndirectCentral()` and `BootTotalCentral()` functions.

# cTMed 1.0.4

Expand Down
153 changes: 153 additions & 0 deletions R/cTMed-boot-central-dot.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
.BootCentral <- function(phi,
phi_hat,
delta_t,
total,
ncores = NULL) {
if (total) {
Fun <- .TotalCentral
} else {
Fun <- .IndirectCentral
}
# nocov start
par <- FALSE
if (!is.null(ncores)) {
ncores <- as.integer(ncores)
R <- length(phi)
if (ncores > R) {
ncores <- R
}
if (ncores > 1) {
par <- TRUE
}
}
if (par) {
os_type <- Sys.info()["sysname"]
if (os_type == "Darwin") {
fork <- TRUE
} else if (os_type == "Linux") {
fork <- TRUE
} else {
fork <- FALSE
}
if (fork) {
output <- lapply(
X = delta_t,
FUN = function(i) {
thetahatstar <- parallel::mclapply(
X = phi,
FUN = Fun,
delta_t = i,
mc.cores = ncores
)
thetahatstar <- do.call(
what = "rbind",
args = thetahatstar
)
colnames(thetahatstar) <- colnames(phi_hat)
thetahatstar <- cbind(
thetahatstar,
interval = i
)
est <- c(
Fun(
phi = phi_hat,
delta_t = i
),
i
)
names(est) <- c(
colnames(phi_hat),
"interval"
)
out <- list(
delta_t = i,
est = est,
thetahatstar = thetahatstar
)
return(out)
}
)
} else {
cl <- parallel::makeCluster(ncores)
on.exit(
parallel::stopCluster(cl = cl)
)
output <- lapply(
X = delta_t,
FUN = function(i) {
thetahatstar <- parallel::parLapply(
cl = cl,
X = phi,
fun = Fun,
delta_t = i
)
thetahatstar <- do.call(
what = "rbind",
args = thetahatstar
)
colnames(thetahatstar) <- colnames(phi_hat)
thetahatstar <- cbind(
thetahatstar,
interval = i
)
est <- c(
Fun(
phi = phi_hat,
delta_t = i
),
i
)
names(est) <- c(
colnames(phi_hat),
"interval"
)
out <- list(
delta_t = i,
est = est,
thetahatstar = thetahatstar
)
return(out)
}
)
}
# nocov end
} else {
output <- lapply(
X = delta_t,
FUN = function(i) {
thetahatstar <- lapply(
X = phi,
FUN = Fun,
delta_t = i
)
thetahatstar <- do.call(
what = "rbind",
args = thetahatstar
)
colnames(thetahatstar) <- colnames(phi_hat)
thetahatstar <- cbind(
thetahatstar,
interval = i
)
est <- c(
Fun(
phi = phi_hat,
delta_t = i
),
i
)
names(est) <- c(
colnames(phi_hat),
"interval"
)
out <- list(
delta_t = i,
est = est,
thetahatstar = thetahatstar
)
return(out)
}
)
}
return(output)
}
Loading

0 comments on commit 38656fe

Please sign in to comment.