I’d like to use the Newton method of root finding, but I’m getting the message algebra_solver_newton not found. I was able to use the Powell method with algebra_solver(), so not sure why the Newton method is not recognized.

Edit: posted a link to outdated instructions; here are better ones.

Note that you can get more recent versions of Rstan (which aren’t yet available on CRAN for annoying reasons) as follows:

# Uncomment the next line if you have previously installed rstan
# remove.packages(c("StanHeaders", "rstan"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

Thanks both, I’ removed and reinstalled the packages according to @jscolar. Now when I check the exact same stan file that compiled before, I get the error:

Error in stanc(filename, allow_undefined = TRUE) : 0

Syntax error in ‘string’, line 63, column 35 to column 36, parsing error:

Expected end of file after end of generated quantities block.

Yes there’s a blank line after the generated quantities block.

Alrighty thanks everyone. My immediate workaround was to use cmdstanr instead as that loads a more recent version of stan, and I was able to use algebra_solver_newton().
I’ll try installing rstan from mc-stan.org at some point and restarting RStudio.