Closed jburos closed 7 years ago
Not sure if this is related, but when re-installing rstanarm
I get the following message:
Reloading installed rstanarm
Error in get(Info[i, 1], envir = env) :
lazy-load database '/home/jacquelineburos/projects/xx-jointmodel-develop2/Rlib/lme4/R/lme4.rdb' is corrupt
Now that I have cleaned up my install environment (fun!) I am still seeing this issue, particularly when estimating loo
.
At the moment, when debugging, I run into the problem on line 284 of log_lik.R:
nms <- collect_nms(colnames(stanmat), get_M(object))
y <- eval(formula(object, m = m)[[2L]], data$ndL[[m]]) ## <- here
x <- data$yX[[m]]
At this point in the code, the formula & data look like:
Browse[6]> formula(object, m = m)[[2L]]
log1p(sld)
Browse[6]> names(data$ndL[[m]])
[1] "log1p(sld)" "cat" "poly(months, degree = 2)"
[4] "usubjid" "months"
Which yields the object 'sld' not found
error on evaluation of log1p(sld)
.
This is a minor issue, but posting here for the record.
Just FYI that I'm still seeing this issue on a fresh install from develop2
branch.
E.g.:
> f0 <- stan_jm(formulaLong = sqrt(CD4) ~ obstime*drug + (1 + obstime | patient),
+ dataLong = aids,
+ time_var = "obstime",
+ formulaEvent = Surv(Time, death) ~ gender + drug + AZT + prevOI,
+ dataEvent = aids.id
+ )
Error in eval(expr, envir, enclos) : object 'CD4' not found
> packageDescription('rstanarm', fields = c('GithubRepo', 'GithubUsername', 'GithubRef', 'GithubSHA1'))
GithubRepo: rstanarm
GithubUsername: sambrilleman
GithubRef: develop2
GithubSHA1: 0176bc3591d24e4442a7a4d1f44adcf1b57418d8
Hopefully the changes here help to solve this issue. But, let me know if you are still encountering them.
I'll merge these changes into the develop4 branch too, which is the branch I am going to now start using as the "most up to date". I plan to tidy and possibly change a few things in the develop4 branch, so I want to retain the develop2 branch pretty much as it is, so as we have something reasonably stable.
I'm hoping that this issue is now resolved, given the changes related to evaluation environments in stan_jm
(shown in the commit above), and the new approach constructing design matrices from a data frame instead of model frame, related to the commits surrounding this one.
Summary:
When running
loo
on a fittedstan_jm
model, I see the following error.where the
omitted
portion contains the name of a field used in my formulaLong.Description:
In this particular example, I had called
stan_jm
in a manner similar to the following:Interestingly enough, now when I go to create a reproducible example, I come across the following:
Input:
Output:
Previously I had been able to fit models using this convention. However, it doesn't appear that the latest version of code is handling formulas correctly.
Reproducible Steps:
See above.
RStanARM Version:
I installed a local fork of
develop2
branch, located here:I will do some more tests to see if this issue is specific to that fork or is evident on
develop2
as well.