Git Product home page Git Product logo

Comments (4)

ecmerkle avatar ecmerkle commented on August 24, 2024

The development version of blavaan allows you to use Stan, via the argument target="stan". See:

http://faculty.missouri.edu/~merklee/blavaan/source.html

There are a couple bugs that still exist here (and that will be fixed), but it usually works.

Ed

from blavaan.

DominiqueMakowski avatar DominiqueMakowski commented on August 24, 2024

That's super cool!

Unfortunately it didn't work :(

I've tried the following:

library(blavaan)
model <- ' 
    # latent variable definitions
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + a*y2 + b*y3 + c*y4
dem65 =~ y5 + a*y6 + b*y7 + c*y8

# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60

# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'

fit <- bsem(model, data=PoliticalDemocracy, target="stan")

After several thousand (debug?) lines, it printed me the following error:

Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! Warning message:
l'exécution de la commande 'make -f "C:/PROGRA~1/R/R-34~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file2aac41e606a.dll" WIN=64 TCLBIN=64 OBJECTS="file2aac41e606a.o"' renvoie un statut 127 
In addition: Warning messages:
1: running command '"C:/PROGRA~1/R/R-34~1.2/bin//R" CMD config CXX' had status 1 
2: running command 'C:/PROGRA~1/R/R-34~1.2/bin/x64/R CMD SHLIB file2aac41e606a.cpp 2> file2aac41e606a.cpp.err.txt' had status 1 
Error in blavaan(model, data = PoliticalDemocracy, target = "stan", model.type = "bsem",  : 
  blavaan ERROR: problem with MCMC estimation.  The model syntax and data have been exported.

😢

from blavaan.

ecmerkle avatar ecmerkle commented on August 24, 2024

This error looks like it is coming from rstan. So I wonder whether you are able to run any simple example models in rstan? For what it's worth, the model works for me with the following package versions:

other attached packages:
[1] rstan_2.16.2 StanHeaders_2.16.0-1 ggplot2_2.2.1
[4] blavaan_0.2-5.225 lavaan_0.6-1.1175 runjags_2.0.4-2

loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 MASS_7.3-47 munsell_0.4.2 mnormt_1.5-5
[5] colorspace_1.2-6 pbivnorm_0.6.0 lattice_0.20-35 quadprog_1.5-5
[9] plyr_1.8.3 MCMCpack_1.4-0 mcmc_0.9-5 tools_3.4.1
[13] parallel_3.4.1 grid_3.4.1 gtable_0.2.0 quantreg_5.33
[17] loo_1.1.0 coda_0.19-1 MatrixModels_0.4-1 matrixStats_0.52.2
[21] assertthat_0.1 lazyeval_0.2.0 tibble_1.2 Matrix_1.2-11
[25] gridExtra_2.2.1 codetools_0.2-15 inline_0.3.14 sandwich_2.4-0
[29] compiler_3.4.1 nonnest2_0.5 scales_0.4.1 stats4_3.4.1
[33] CompQuadForm_1.4.3 SparseM_1.77 mvtnorm_1.0-6 zoo_1.8-0

from blavaan.

ecmerkle avatar ecmerkle commented on August 24, 2024

Happy to revisit with further info...

from blavaan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.