# NOT RUN {
## LaTeX mathematic for an R expression of SDEs
## Copy and paste the following output in your LaTeX file
# Example 1
f <- expression(-mu1 * x)
g <- expression(mu2 * sqrt(x))
TEX.sde(object = c(drift = f, diffusion = g))
# 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 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 table for object of class 'MCM.sde'
## Copy and paste the following output in your LaTeX file
# Example 4
# }
# NOT RUN {
mu1=0.25; mu2=3; sigma=0.05; alpha=0.03
mod3d <- snssde3d(drift=f,diffusion=g,x0=c(x=0,y=0,z=0),M=100,T=10)
stat.fun3d <- function(data, i){
d <- data[i,]
return(c(mean(d$x),mean(d$y),mean(d$z),
var(d$x),var(d$y),var(d$z)))
}
mcm.mod3d = MCM.sde(mod3d,statistic=stat.fun3d,R=10,parallel="snow",ncpus=parallel::detectCores(),
names=c("m1","m2","m3","S1","S2","S3"))
TEX.sde(object = mcm.mod3d, booktabs = TRUE, align = "r", caption ="\LaTeX~
table for Monte Carlo results generated by \code{TEX.sde()} method.")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab