You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a new .stan file named "b_np_oipi_tr_psrqkm.stan" following the naming generated by mm_name('bayes', GPP_fun='satlight', ER_fun='q10temp',pool_K600='none'). Then I edited the .stan file to include ER model as function of water temperature as per manual q10temp . However, I get a syntax error when I included temp.water as a variable in the transformed parameter ER_inst[i].
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
Variable identifier may not contain a period (.)
See below for the full code.
Based on Rstan manual variable identifiers in Stan may not contain a period character. And when I changed the variable name to water_temp I got the error
Error in mod$fit_ptr() :
Exception: variable does not exist; processing stage=data initialization; variable name=temp_water; base type=vector_d (in ‘model4b1c66371d71_b_np_oipi_tr_psrqkm’ at line 30)
After troubleshooting in Stan forum, it was found that the temp.water is hard coded in the function and can't be renamed. But the mystery is that DO.sat Do.obs are written in the form DO_stat in the stan data block and they don't cause the same error while only temp_water causes the error above in Italic. Any idea how to include the temperature function without running into this error?
What I saw on my computer
dat<-data.frame(solar.time=as.POSIXct(site$solar.time,tz="UTC",format="%d/%m/%Y %H:%M"),DO.obs=ma(site$DO.obs,10),DO.sat=site$DO.sat,depth=site$depth,temp.water=site$temp.water,light=site$light)
## Sat model with light and ER function
mm_saturator_ER<-
+ mm_name('bayes', GPP_fun='satlight', ER_fun='q10temp',pool_K600='none') %>%
+ specs(alpha_meanlog=.4,alpha_sdlog=.2,Pmax_mu=6,Pmax_sigma=.3, day_start = 4,day_end = 28,n_cores=4, n_chains=4, burnin_steps=500, saved_steps=500) %>%
+ metab(dat)
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
Variable identifier may not contain a period (.)
found period at position (indexed from 0)=4
found identifier=temp.water
Variable identifier may not contain a period (.)
found period at position (indexed from 0)=4
found identifier=temp.water
error in 'model4b1c4e6d2fdf_b_np_oipi_tr_psrqkm' at line 29, column 11
-------------------------------------------------
27: vector[d] DO_obs[n];
28: vector[d] DO_sat[n];
29: vector[d] temp.water[n];
^
30: vector[d] light[n];
-------------------------------------------------
PARSER EXPECTED: <identifier>
Timing stopped at: 0.08 0 0.09
Warning message:
In metab_fun(specs = specs, data = data, data_daily = data_daily, :
Modeling failed
Errors:
failed to parse Stan model 'b_np_oipi_tr_psrqkm' due to the above error
Session information
Run the following code line (or sessionInfo() if that doesn't work) and paste in your output.
Brief problem description
I have created a new .stan file named "b_np_oipi_tr_psrqkm.stan" following the naming generated by mm_name('bayes', GPP_fun='satlight', ER_fun='q10temp',pool_K600='none'). Then I edited the .stan file to include ER model as function of water temperature as per manual q10temp . However, I get a syntax error when I included temp.water as a variable in the transformed parameter ER_inst[i].
See below for the full code.
Based on Rstan manual variable identifiers in Stan may not contain a period character. And when I changed the variable name to water_temp I got the error
After troubleshooting in Stan forum, it was found that the temp.water is hard coded in the function and can't be renamed. But the mystery is that DO.sat Do.obs are written in the form DO_stat in the stan data block and they don't cause the same error while only temp_water causes the error above in Italic. Any idea how to include the temperature function without running into this error?
What I saw on my computer
Session information
Run the following code line (or
sessionInfo()
if that doesn't work) and paste in your output.Sample data
sample_data.txt
Stan model file
b_np_oipi_tr_psrqkm.txt
The text was updated successfully, but these errors were encountered: