Sure enough, it turns out I'm running blavaan v. 0.5-3. Deleting those lines from the Stan file worked and the model is sampling. I have a couple follow-up questions:1) Is there any harm of initially running bsem(..., burnin=1, sample=1, ...) to quickly generate the Stan code, and then setting the proper number of samples later when directly running through Rstan?2) Is there an easy way to recover the parameter names as written in the lavaan model syntax?Thanks for the quick help and the great package.-SpencerOn Wednesday, April 16, 2025 at 1:58:46 PM UTC-5 Ed Merkle wrote:
Spencer,Thanks for the report. Your stan() call looks correct, and I wonder whether you are using blavaan 0.5-5 or below. There was an issue in the Stan file where a commented-out "#" character led to "parser failed badly" on some systems.If this is the problem, there are at least two possible fixes: upgrade to the newest version of blavaan (0.5-8), or open that sem.stan file, do a text search for "https", and delete those lines. (The problematic hashtags appear in urls, so you would just need to delete the urls.)EdOn Wednesday, April 16, 2025 at 1:51:27 PM UTC-5 aesch....@gmail.com wrote:
Hi all,I have a working model in blavaan that I want to run on an HPC cluster I have access to (the outputs are quite cumbersome for the memory on my personal machine). I'm having some package installation issues on the cluster, but I do have Rstan up and running--so I want to use the `sem.stan` and `semstan.rda` files to run my model directly on Rstan.However, I am running into some issues. Trying this out on my local machine, my R script looks like this:library(rstan)
options(mc.cores= parallel::detectCores())
load("lavExport/semstan.rda")stan_data <- stantrans$datafit <-stan(file="lavExport/sem.stan",data= stan_data,pars= stantrans$monitors,chains=4,warmup=500,iter=1000,cores=4)print(fit)Unfortunately, this fails immediately with the error: "parser failed badly; maybe try installing the V8 package"Am I using the `sem.stan` and `stantrans` objects incorrectly?Thanks,-Spencer
--You received this message because you are subscribed to the Google Groups "blavaan" group.To unsubscribe from this group and stop receiving emails from it, send an email to blavaan+u...@googlegroups.com.To view this discussion visit https://groups.google.com/d/msgid/blavaan/6c9c2c52-8875-40a7-9746-be3e4f30764en%40googlegroups.com.
2) Is there an easy way to recover the parameter names as written in the lavaan model syntax?