Skip to content

Commit

Permalink
Improved errror message and disabled debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
pwbogaart committed May 8, 2017
1 parent 66d6ee5 commit 0431f77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/R/data_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ print_and_capture <- function(x){
assert_positive <- function(x, varname){
if (any(x <= 0)){
i <- which(x<=0)
stop(sprintf("Found zero or less counts for %s %s",varname, paste(names(x[i]),collapse=", ")),call.=FALSE)
msg <- if (is.null(varname)) sprintf("Found zero or less counts for %s", paste(names(x[i]),collapse=", "))
else sprintf("Found zero or less counts for %s %s",varname, paste(names(x[i]),collapse=", "))
stop(msg,call.=FALSE)
}
invisible(TRUE)
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/R/trim_workhorse.R
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,9 @@ trim_workhorse <- function(count, site.id, year, month=NULL, covars=data.frame()
V_i <- sig2 * d_mu_i
}
# if (any(abs(diag(V_i))<1e-12)) browser()
# printf("\n!!! Site: %d\n", i)
# print(mu_i)
# if (any(mu_i < 6e-18)) browser()
V_inv[[i]] <<- solve(V_i) # Store $V^{-1}# for later use
Omega[[i]] <<- d_mu_i %*% V_inv[[i]] %*% d_mu_i # idem for $\Omega_i$
}
Expand Down

0 comments on commit 0431f77

Please sign in to comment.