Comments (4)
What does devtools::session_info(c("dplyr", "tidyr"))
give you?
from measr.
Ah! I had older versions of dplyr and tidyr set (from Debian sources rather than direct from CRAN).
Next I ran into a problem as the test suite uses cmdstanr
which is not on CRAN. You might need to add
install.packages("cmdstanr", repos=c(stan="https://mc-stan.org/r-packages/",CRAN="https://cloud.r-project.org/"))
to your readme file.
There apparently also is some setup needed for cmdstanr
as I'm getting 5 failures in the test suite:
==> devtools::test()
ℹ Testing measr
✔ | F W S OK | Context
✔ | 188 | data-checks [1.7s]
✔ | 41 | data [0.1s]
✖ | 1 0 | ecpe [0.4s]
─────────────────────────────────
Error (test-ecpe.R:3:1): (code run outside of `test_that()`)
Error: CmdStan path has not been set yet. See ?set_cmdstan_path.
Backtrace:
1. utils::capture.output(...)
at test-ecpe.R:3:0
5. measr::measr_dcm(...)
6. measr:::create_stan_function(...)
at measr/R/fit-dcm.R:153:2
7. cmdstanr::cmdstan_model(...)
at measr/R/stan-utils.R:93:4
8. cmdstanr::cmdstan_version()
9. cmdstanr:::stop_no_path()
─────────────────────────────────
✔ | 17 | extract [0.5s]
✔ | 34 | m2-methods [6.6s]
✖ | 1 0 | mcmc [0.2s]
─────────────────────────────────
Error (test-mcmc.R:3:1): (code run outside of `test_that()`)
Error: CmdStan path has not been set yet. See ?set_cmdstan_path.
Backtrace:
1. utils::capture.output(...)
at test-mcmc.R:3:0
5. measr::measr_dcm(...)
6. measr:::create_stan_function(...)
at measr/R/fit-dcm.R:153:2
7. cmdstanr::cmdstan_model(...)
at measr/R/stan-utils.R:93:4
8. cmdstanr::cmdstan_version()
9. cmdstanr:::stop_no_path()
─────────────────────────────────
✔ | 20 | methods [41.1s]
✔ | 42 | param-estimates [0.2s]
✔ | 67 | priors [0.5s]
✔ | 19 | reliability [6.8s]
✖ | 3 15 | stan-scripts [2.1s]
─────────────────────────────────
Failure (test-stan-scripts.R:27:3): stan generated quantities script works
`prob_code` (`actual`) not equal to stanmodels$gqs_probs@model_code (`expected`).
lines(actual)[19:24] vs lines(expected)[19:25]
"}"
"generated quantities {"
" matrix[R,C] prob_resp_class; // post prob of respondent R in class C"
" matrix[R,A] prob_resp_attr; // post prob of respondent R master A"
+ " "
" for (r in 1:R) {"
" row_vector[C] prob_joint;"
" for (c in 1:C) {"
lines(actual)[32:37] vs lines(expected)[33:39]
" prob_joint[c] = log_Vc[c] + sum(log_items);"
" }"
" prob_resp_class[r] = exp(prob_joint) / exp(log_sum_exp(prob_joint));"
" }"
+ ""
" for (r in 1:R) {"
" for (a in 1:A) {"
" row_vector[C] prob_attr_class;"
lines(actual)[40:44] vs lines(expected)[42:46]
" }"
" prob_resp_attr[r,a] = sum(prob_attr_class);"
" }"
- " }"
+ " } "
"}"
Failure (test-stan-scripts.R:35:3): stan generated quantities script works
`ppmc_code` (`actual`) not equal to stanmodels$gqs_ppmc@model_code (`expected`).
lines(actual)[21:26] vs lines(expected)[21:27]
" matrix[R,C] prob_resp_class; // post prob of respondent R in class C"
" matrix[R,A] prob_resp_attr; // post prob of respondent R master A"
" int y_rep[N];"
" int r_class[R];"
+ ""
" for (r in 1:R) {"
" row_vector[C] prob_joint;"
" for (c in 1:C) {"
lines(actual)[34:39] vs lines(expected)[35:41]
" prob_joint[c] = log_Vc[c] + sum(log_items);"
" }"
" prob_resp_class[r] = exp(prob_joint) / exp(log_sum_exp(prob_joint));"
" }"
+ ""
" for (r in 1:R) {"
" for (a in 1:A) {"
" row_vector[C] prob_attr_class;"
lines(actual)[42:48] vs lines(expected)[44:51]
" }"
" prob_resp_attr[r,a] = sum(prob_attr_class);"
" }"
- " }"
+ " } "
+ ""
" for (r in 1:R) {"
" vector[C] r_probs = exp(log_Vc) / exp(log_sum_exp(log_Vc));"
" r_class[r] = categorical_rng(r_probs);"
Failure (test-stan-scripts.R:45:3): stan log_lik script works
`loglik_code` (`actual`) not equal to stanmodels$gqs_loglik@model_code (`expected`).
lines(actual)[18:23] vs lines(expected)[18:24]
" matrix[I,C] pi;"
"}"
"generated quantities {"
" vector[R] log_lik;"
+ ""
" for (r in 1:R) {"
" row_vector[C] prob_joint;"
" for (c in 1:C) {"
─────────────────────────────────
✔ | 14 | stan-utils
✔ | 2 | utils-display
✔ | 11 | utils-priors
✔ | 6 | utils [0.1s]
══ Results ══════════════════════
Duration: 60.6 s
[ FAIL 5 | WARN 0 | SKIP 0 | PASS 476 ]
from measr.
Ah, yes. I don't have installation instructions for cmdstanr because it is not strictly required. By default, measr will use the rstan package as a backend to estimate models, because the cmdstanr package is not yet on CRAN. Thus, cmdstanr is optional, but I've included tests to ensure that cmdstanr works, if the user has it installed and chooses to use it. I've opened another issue (#23) to track adding more installation instructions to the package vignettes. For now, this code should get everything working for you:
install.packages("remotes")
remotes::install_github("stan-dev/cmdstanr")
cmdstanr::install_cmdstan()
from measr.
from measr.
Related Issues (20)
- Support for additional DCM subtypes HOT 1
- Release measr 0.1.0
- Release measr 0.2.0
- Release measr 0.3.0
- Installation instructions
- Add Bayes factors for model comparisons HOT 1
- Pre-compiled models
- Q-matrix validation HOT 1
- Model evaluation
- Model summary
- Refining model object
- Case study
- Visualizing results
- Additional DCM support
- Update Stan definitions
- Inquiry about some errors in measr package HOT 1
- JOSS Review HOT 2
- Additional `measr_extract()` features
- Release measr 1.0.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from measr.