Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .Rprofile

This file was deleted.

20 changes: 5 additions & 15 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,16 @@ name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (R ${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel'}
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
r-version: 'release'

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -37,4 +26,5 @@ jobs:

- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran")'
upload-snapshots: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ tests/testthat/_snaps/
# devtools / roxygen
/doc/
/Meta/

# local R session config (machine-specific)
.Rprofile
.Renviron
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ Imports:
parallel
Suggests:
testthat (>= 3.0.0)
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
17 changes: 10 additions & 7 deletions tests/testthat/test-optim_SQGDE.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ library(graDiEnt)
test_that("MLE factorizable MVN recovers sample means", {
set.seed(42)
true_mu <- c(-1, 1, 0, 2)
data <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), nrow = 500, ncol = 4)
data <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1),
nrow = 500, ncol = 4 ,byrow = TRUE)
analytic_mu <- colMeans(data)

neg_log_lik <- function(x, data) {
Expand Down Expand Up @@ -44,7 +45,7 @@ test_that("MLE factorizable MVN recovers sample means", {

test_that("univariate objective recovers sample mean", {
set.seed(42)
obs <- rnorm(300, mean = 2.5, sd = 1)
obs <- rnorm(300, mean = 4, sd = 1)
analytic_mu <- mean(obs)

neg_log_lik_1d <- function(x, obs) {
Expand All @@ -59,9 +60,9 @@ test_that("univariate objective recovers sample mean", {
n_params = 1,
n_iter = 500,
n_particles = 6,
n_diff = 1,
n_diff = 2,
init_center = 0,
init_sd = 2
init_sd = 1
),
obs = obs
)
Expand Down Expand Up @@ -155,8 +156,9 @@ test_that("PSOCK parallel execution returns valid solution", {
skip_on_cran()

set.seed(42)
true_mu <- c(-1, 1, 0, 2)
data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), nrow = 500, ncol = 4)
true_mu <- c(-1, 8, 0, 2)
data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1),
nrow = 500, ncol = 4 ,byrow = TRUE)
analytic_mu <- colMeans(data_par)

neg_log_lik <- function(x, data_par) {
Expand Down Expand Up @@ -201,7 +203,8 @@ test_that("FORK parallel execution returns valid solution", {

set.seed(42)
true_mu <- c(-1, 1, 0, 2)
data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1), nrow = 500, ncol = 4)
data_par <- matrix(rnorm(500 * 4, mean = true_mu, sd = 1),
nrow = 500, ncol = 4 ,byrow = TRUE)
analytic_mu <- colMeans(data_par)

neg_log_lik <- function(x, data_par) {
Expand Down
Loading