TEX.sde: Converting Sim.DiffProc Objects to LaTeX

View source: R/Tex.sde.r

TEX.sdeR Documentation

Converting Sim.DiffProc Objects to LaTeX

Description

These methods produces the related LaTeX table and mathematic expression for Sim.DiffProc environment.

Usage

TEX.sde(object, ...)

## Default S3 method:
TEX.sde(object, ...)	

Arguments

object

an objects from class MCM.sde and MEM.sde. Or an R vector of expression of SDEs, i.e., drift and diffusion coefficients.

...

arguments to be passed to kable function if object from class MCM.sde.

Details

New tools for constructing tables and mathematical expressions with Sim.DiffProc package.

An overview of this package, see browseVignettes('Sim.DiffProc') for more informations.

Author(s)

A.C. Guidoum

References

Guidoum AC, Boukhetala K (2020). "Performing Parallel Monte Carlo and Moment Equations Methods for Itô and Stratonovich Stochastic Differential Systems: R Package Sim.DiffProc". Journal of Statistical Software, 96(2), 1–82. doi:10.18637/jss.v096.i02

Xie Y (2015). Dynamic Documents with R and knitr. 2nd edition. Chapman and Hall/CRC, Boca Raton, Florida. ISBN 978-1498716963, URL https://yihui.org/knitr/.

Wickham H (2015). Advanced R. Chapman & Hall/CRC The R Series. CRC Press. ISBN 9781498759809.

See Also

kable create tables in LaTeX, HTML, Markdown and reStructuredText.

toLatex converting R Objects to BibTeX or LaTeX.

Examples


## 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.")

## End(Not run)		 


Sim.DiffProc documentation built on May 29, 2024, 8:09 a.m.