How to specify operations on parameters? (Damped Oscillator model) #62
-
|
Hi, I'm trying to fit a damped oscillator model in ctsem and facing issues: I transformed it into the following two equations for level and velocity: Following is the code I used: I'm facing issues with the operations on parameters and was wondering if you had any suggestions on how to code this model? The error I get is: My impression is that the way I'm specifying the parameter multiplication is not being read correctly for stan's syntax. But I also tried running the following example from the manual (which looked to have an operation on parameters) but even this model did not run for me: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I don't think you need a nonlinear model for a damped linear oscillator -- the manual ( https://cran.r-project.org/web/packages/ctsem/vignettes/hierarchicalmanual.pdf ) shows a linear version with the sunspots data. To proceed with the nonlinear form, you need to make sure all your 'complex' parameters are specified as additional parameters in the PARS matrix -- you've only specified mu_x , but you also need to specify omega_x as an extra parameter. The example you found that is not working doesn't exist in the current ctsem code, I guess there was a temporary bug at some point -- to fix it you just need to make sure the PARS are properly specified, change 'freqbystate' in the DRIFT matrix to 'freqbylevel' which we have an additional parameter for. |
Beta Was this translation helpful? Give feedback.
-
|
Great :)
…On Sat, Jan 18, 2025, 00:25 Rohit Batra ***@***.***> wrote:
Great, that did the trick! I assumed we wouldn't need to to declare
omega_x since it's already declared elsewhere. Thank you!
—
Reply to this email directly, view it on GitHub
<#62 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7LCBI775GJ3Z4TNOAM4O32LGGPPAVCNFSM6AAAAABVKQH5DSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBXGIZTMOA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
I don't think you need a nonlinear model for a damped linear oscillator -- the manual ( https://cran.r-project.org/web/packages/ctsem/vignettes/hierarchicalmanual.pdf ) shows a linear version with the sunspots data. To proceed with the nonlinear form, you need to make sure all your 'complex' parameters are specified as additional parameters in the PARS matrix -- you've only specified mu_x , but you also need to specify omega_x as an extra parameter. The example you found that is not working doesn't exist in the current ctsem code, I guess there was a temporary bug at some point -- to fix it you just need to make sure the PARS are properly specified, change 'freqbystate' in the DRIFT matri…