Loglinearizing CES function

Hello all,

I am trying to code

\widetilde{m_{t}} \equiv \left[\int_{0}^{1}(m_{jt}S_{jt-1}^{-\theta})^{1-\eta}\right]^{\frac{1}{1-\eta}}

in dynare. I log-linearized it to

\widetilde{\widetilde{m_{t}^{d}}}=\widetilde{m_{jt}}-\theta\widetilde{S_{t-1}}. Is this a good step to coding CES production function in dynare?

Sincerely,
Amina

Without knowing what exactly you are trying to do it is impossible to tell.