Skip to content

Commit 7fdfe1e

Browse files
committed
Update version of actions/cache in CI.
1 parent b98a876 commit 7fdfe1e

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Restore R package cache
5656
if: runner.os != 'Windows'
57-
uses: actions/cache@v2
57+
uses: actions/cache@v4
5858
with:
5959
path: ${{ env.R_LIBS_USER }}
6060
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}

packages/nimbleSMC/R/BootstrapFilter.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,17 @@ buildBootstrapFilter <- nimbleFunction(
361361
if(logL == Inf) {lastLogLik <<- -Inf; return(-Inf)}
362362
}
363363
lastLogLik <<- logL
364+
nimCat("lastLogLik is ", logL, "\n")
364365
return(logL)
365366
},
366367
methods = list(
367-
getLastLogLik = function() {
368+
getLastLogLik = function() {
369+
nimCat("getting lastLogLik as ", lastLogLik, "\n")
368370
return(lastLogLik)
369371
returnType(double())
370372
},
371373
setLastLogLik = function(lll = double()) {
374+
nimCat("setting lastLogLik as ", lll, "\n")
372375
lastLogLik <<- lll
373376
},
374377
returnESS = function(){

packages/nimbleSMC/R/MCMCSamplers.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,17 @@ sampler_RW_PF_block <- nimbleFunction(
323323
if(!all(dim(propCov) == d)) stop('propCov matrix must have dimension ', d, 'x', d, '\n')
324324
if(!isSymmetric(propCov)) stop('propCov matrix must be symmetric')
325325
if(length(targetAsScalar) < 2) stop('less than two top-level targets; cannot use RW_PF_block sampler, try RW_PF sampler')
326-
if(any(target%in%model$expandNodeNames(latents))) stop('PMCMC \'target\' argument cannot include latent states')
326+
if(any(target%in%model$expandNodeNames(latents))) stop('PMCMC \'target\' argument cannot include latent states')
327+
targetID <- 0
328+
if(target[1] == "x") targetID <- 1
329+
if(target[1] == "std2_1") targetID <- 2
330+
if(target[1] == "rho") targetID <- 3
331+
327332
},
328333
run = function() {
329-
storeParticleLP <<- my_particleFilter$getLastLogLik()
334+
cat("starting sampler: ", targetID, "\n")
335+
storeParticleLP <<- my_particleFilter$getLastLogLik()
336+
cat("initial LL is ", storeParticleLP, "\n")
330337
modelLP0 <- storeParticleLP + getLogProb(model, target)
331338
propValueVector <- generateProposalVector()
332339
my_setAndCalculate$run(propValueVector)

0 commit comments

Comments
 (0)