R Under development (unstable) (2024-03-03 r86036 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(Sim.DiffProc) Package 'Sim.DiffProc', version 4.9 browseVignettes('Sim.DiffProc') for more informations. > > ## Converting Sim.DiffProc Objects to LaTeX > > # Example 1 > > f <- expression(-mu1 * x) > g <- expression(mu2 * sqrt(x)) > TEX.sde(object = c(drift = f, diffusion = g)) %%% LaTeX equation generated in R development by TEX.sde() method %%% Copy and paste the following output in your LaTeX file \begin{equation}\label{eq:} dX_{t} = - \mu_{1} \, X_{t} \:dt + \mu_{2} \, \sqrt{X_{t}} \:dW_{t} \end{equation} > > # Example 2 > > f <- expression(mu1*cos(mu2+z),mu1*sin(mu2+z),0) > g <- expression(sigma,sigma,alpha) > TEX.sde(object = c(drift = f, diffusion = g)) %%% LaTeX equation generated in R development by TEX.sde() method %%% Copy and paste the following output in your LaTeX file \begin{equation}\label{eq:} \begin{cases} \begin{split} dX_{t} &= \mu_{1} \, \cos(\mu_{2} + Z_{t}) \:dt + \sigma \:dW_{1,t} \\ dY_{t} &= \mu_{1} \, \sin(\mu_{2} + Z_{t}) \:dt + \sigma \:dW_{2,t} \\ dZ_{t} &= 0 \:dt + \alpha \:dW_{3,t} \end{split} \end{cases} \end{equation} > > ## LaTeX mathematic for object of class 'MEM.sde' > ## Copy and paste the following output in your LaTeX file > > # Example 3 > > mem.mod3d <- MEM.sde(drift = f, diffusion = g) > TEX.sde(object = mem.mod3d) %%% LaTeX equation generated in R development by TEX.sde() method %%% Copy and paste the following output in your LaTeX file \begin{equation}\label{eq:} \begin{cases} \begin{split} \frac{d}{dt} m_{1}(t) &= \mu_{1} \, \left( 1 - 0.5 \, S_{3}(t) \right) \, \cos(\mu_{2} + m_{3}(t)) \\ \frac{d}{dt} m_{2}(t) &= \mu_{1} \, \left( 1 - 0.5 \, S_{3}(t) \right) \, \sin(\mu_{2} + m_{3}(t)) \\ \frac{d}{dt} m_{3}(t) &= 0 \\ \frac{d}{dt} S_{1}(t) &= \sigma^2 - 2 \, \left( C_{13}(t) \, \mu_{1} \, \sin(\mu_{2} + m_{3}(t)) \right) \\ \frac{d}{dt} S_{2}(t) &= 2 \, \left( C_{23}(t) \, \mu_{1} \, \cos(\mu_{2} + m_{3}(t)) \right) + \sigma^2 \\ \frac{d}{dt} S_{3}(t) &= \alpha^2 \\ \frac{d}{dt} C_{12}(t) &= \mu_{1} \, \left( C_{13}(t) \, \cos(\mu_{2} + m_{3}(t)) - C_{23}(t) \, \sin(\mu_{2} + m_{3}(t)) \right) + \sigma^2 \\ \frac{d}{dt} C_{13}(t) &= \alpha \, \sigma - S_{3}(t) \, \mu_{1} \, \sin(\mu_{2} + m_{3}(t)) \\ \frac{d}{dt} C_{23}(t) &= S_{3}(t) \, \mu_{1} \, \cos(\mu_{2} + m_{3}(t)) + \alpha \, \sigma \end{split} \end{cases} \end{equation} > > proc.time() user system elapsed 0.35 0.06 0.40