Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 92a9b60

Browse files
Merge pull request #25 from alexmccreight/master
fix fallback ash grid, add more ash iterations
2 parents bb1bd9b + fd8e7a6 commit 92a9b60

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

R/sufficient_stats_methods.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ update_variance_components.ss <- function(data, params, model, ...) {
348348
est_sa2 <- c(0, mom_result$tau2 * grid_factors)
349349
} else {
350350
# Fallback if MoM gives tau2 = 0
351-
est_sa2 <- (2^((0:(20-1)) / 5) - 1)^2 * 0.1
351+
est_sa2 <- c(0, (2^(0.05*(1:20-1)) - 1)^4)
352+
est_sa2 <- est_sa2 * (0.1 / max(est_sa2))
352353
}
353354

354355
# Simplify precision matrix for ash
@@ -370,7 +371,8 @@ update_variance_components.ss <- function(data, params, model, ...) {
370371
tausq = 0,
371372
sum_Dsq = sum(data$eigen_values),
372373
Dsq = data$eigen_values,
373-
VtXt = data$VtXt
374+
VtXt = data$VtXt,
375+
max.iter = 3000
374376
)
375377

376378
return(list(

0 commit comments

Comments
 (0)