Skip to content

Commit 1c44539

Browse files
committed
version 4.2
2 parents 10da69d + b62e4a5 commit 1c44539

File tree

5 files changed

+50
-32
lines changed

5 files changed

+50
-32
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Sim.DiffProc
22
Type: Package
3-
Version: 4.1
4-
Date: 2018-09-09
3+
Version: 4.2
4+
Date: 2018-10-10
55
Title: Simulation of Diffusion Processes
66
Authors@R: c(
77
person("Arsalane Chouaib", "Guidoum",
@@ -13,7 +13,7 @@ Author: Arsalane Chouaib Guidoum [cre, aut],
1313
Kamal Boukhetala [aut]
1414
Maintainer: Arsalane Chouaib Guidoum <[email protected]>
1515
Depends: R (>= 2.15.1)
16-
Imports: Deriv (>= 3.8.0), MASS, parallel, rgl (>= 0.66), scatterplot3d (>= 0.3-36)
16+
Imports: Deriv (>= 3.8.0), MASS, parallel, rgl (>= 0.93.991), scatterplot3d (>= 0.3-36)
1717
Suggests: deSolve (>= 1.11), knitr, sm (>= 2.2-5.3)
1818
BugReports: https://github.com/acguidoum/Sim.DiffProc/issues
1919
URL: https://github.com/acguidoum/Sim.DiffProc

R/Tex.sde.r

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,24 @@ TEX.sde.default <- function(object, ...)
131131
cat(knitr::kable(object, format = "latex",...),
132132
"\n")
133133
}else if (class(object) == "MCM.sde"){
134-
mod <- object$MC
134+
tab <- object$MC
135+
greek_test <- as.list(c(mem_sde,mem_sde_tex,greek,greek1,greek2,greek3,greek4,greek5,
136+
greek6,greek7,greek8,greek9,greek10,greek_list,
137+
greek_list1,greek_list2,greek_list3,greek_list4,greek_list5,
138+
greek_list6,greek_list7,greek_list8,greek_list9,greek_list10))
139+
expr <- parse(text = rownames(tab))
140+
names <- all.names(expr )
141+
symbol_list <- setNames(as.list(names), names)
142+
symbol_env <- list2env(symbol_list, parent = f_env)
143+
greek_env <- clone_env(greek_env, parent = symbol_env)
144+
rownames(tab) <- sapply(1:length(names),function(i) eval(expr[i], latex_env(expr[i])))
145+
rownames(tab) <- sapply(1:length(names),function(i) ifelse(rownames(tab)[i]%in%greek_test,paste0("$", rownames(tab)[i],"$") ,rownames(tab)[i]) )
146+
colnames(tab)[length(names(tab))] <- "CI( 2.5 \\% , 97.5 \\% )"
135147
cat("%%% LaTeX table generated in R",strsplit(version[['version.string']], ' ')[[1]][3],"by TEX.sde() method",
136148
"\n")
137149
cat("%%% Copy and paste the following output in your LaTeX file",
138150
"\n\n")
139-
cat(knitr::kable(mod, format = "latex",...),
151+
cat(knitr::kable(tab, format = "latex", escape = FALSE,...),
140152
"\n")
141153
}else if (class(object) == "expression"){
142154
expr <- object

R/ftpsde.R

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ fptsde1d <- function(object, ...) UseMethod("fptsde1d")
3131
fptsde1d.default <- function(object,boundary,...)
3232
{
3333
class(object) <- "snssde1d"
34-
if (any(!is.expression(boundary))) stop(" must be expressions of a constant or time-dependent boundary ")
34+
if (any(!is.expression(boundary)))
35+
stop(" must be expressions of a constant or time-dependent boundary ")
3536
R <- data.frame(object$X)
3637
Bn <- function(t) eval(boundary)
37-
if(object$x0==Bn(object$t0)) warning(paste("x0 = S(t0) ==> crossing realized at time",object$t0))
38+
if(object$x0==Bn(object$t0))
39+
warning(paste("x0 = S(t0) ==> crossing realized at time",object$t0))
3840
F <- lapply(1:as.numeric(object$M),function(i) stats::approxfun(time(object),as.vector(R[,i])) )
3941
if (as.numeric(object$x0) > Bn(as.numeric(object$t0))){
4042
v1 <- sapply(1:length(F),function(i) ifelse(length(which(R[,i] <= Bn(time(object))))==0, NA,min(which(R[,i] <= Bn(time(object))))))
@@ -234,11 +236,13 @@ fptsde2d <- function(object, ...) UseMethod("fptsde2d")
234236
fptsde2d.default <- function(object,boundary,...)
235237
{
236238
class(object) <- "snssde2d"
237-
if (any(!is.expression(boundary))) stop(" must be expression of a constant or time-dependent boundary ")
239+
if (any(!is.expression(boundary)))
240+
stop(" must be expression of a constant or time-dependent boundary ")
238241
R1 <- data.frame(object$X)
239242
R2 <- data.frame(object$Y)
240243
Bn <- function(t) eval(boundary)
241-
if(object$x0==Bn(object$t0) | object$y0==Bn(object$t0) ) warning(paste("x0 = S(t0) or y0 =S(t0) ==> crossing realized at time",object$t0))
244+
if(object$x0==Bn(object$t0) | object$y0==Bn(object$t0) )
245+
warning(paste("x0 = S(t0) or y0 =S(t0) ==> crossing realized at time",object$t0))
242246
F1 <- lapply(1:as.numeric(object$M),function(i) stats::approxfun(time(object),as.vector(R1[,i])) )
243247
F2 <- lapply(1:as.numeric(object$M),function(i) stats::approxfun(time(object),as.vector(R2[,i])) )
244248
if (as.numeric(object$x0) > Bn(as.numeric(object$t0))){
@@ -536,12 +540,14 @@ fptsde3d <- function(object, ...) UseMethod("fptsde3d")
536540
fptsde3d.default <- function(object,boundary,...)
537541
{
538542
class(object) <- "snssde3d"
539-
if (any(!is.expression(boundary))) stop(" must be expression of a constant or time-dependent boundary ")
543+
if (any(!is.expression(boundary)))
544+
stop(" must be expression of a constant or time-dependent boundary ")
540545
R1 <- data.frame(object$X)
541546
R2 <- data.frame(object$Y)
542547
R3 <- data.frame(object$Z)
543548
Bn <- function(t) eval(boundary)
544-
if(object$x0==Bn(object$t0) | object$y0==Bn(object$t0) | object$z0==Bn(object$t0) ) warning(paste("x0 = S(t0) or y0 =S(t0) or z0 =S(t0) ==> crossing realized at time",object$t0))
549+
if(object$x0==Bn(object$t0) | object$y0==Bn(object$t0) | object$z0==Bn(object$t0) )
550+
warning(paste("x0 = S(t0) or y0 =S(t0) or z0 =S(t0) ==> crossing realized at time",object$t0))
545551
F1 <- lapply(1:as.numeric(object$M),function(i) stats::approxfun(time(object),as.vector(R1[,i])) )
546552
F2 <- lapply(1:as.numeric(object$M),function(i) stats::approxfun(time(object),as.vector(R2[,i])) )
547553
F3 <- lapply(1:as.numeric(object$M),function(i) stats::approxfun(time(object),as.vector(R3[,i])) )

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Project Status](https://www.repostatus.org/badges/latest/active.svg?style=popout)](https://cran.r-project.org/src/contrib/Archive/Sim.DiffProc/)
44
[![Travis Build Status](https://travis-ci.org/acguidoum/Sim.DiffProc.svg?branch=master)](https://travis-ci.org/acguidoum/Sim.DiffProc)
5-
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/65glhgavh266hkyk/branch/master?svg=true)](https://ci.appveyor.com/project/acguidoum/sim-diffproc/branch/master) [![codecov](https://codecov.io/gh/acguidoum/Sim.DiffProc/branch/master/graph/badge.svg)](https://codecov.io/gh/acguidoum/Sim.DiffProc)
5+
[![Build status](https://ci.appveyor.com/api/projects/status/16a70vyf8rk7nn1i?svg=true)](https://ci.appveyor.com/project/acguidoum/sim-diffproc-xal8n) [![codecov](https://codecov.io/gh/acguidoum/Sim.DiffProc/branch/master/graph/badge.svg)](https://codecov.io/gh/acguidoum/Sim.DiffProc)
66

77

88
------------------------------------------------------------------------
@@ -11,7 +11,7 @@
1111
[![minimal R version](https://img.shields.io/badge/R%3E%3D-2.15.1-blue.svg?style=flat-plastic)](https://cran.r-project.org/)
1212

1313
------------------------------------------------------------------------
14-
14+
![Github](https://img.shields.io/badge/Github-4.2(at:10.10.2018)-blue.svg)
1515
![](http://www.r-pkg.org/badges/version-last-release/Sim.DiffProc?color=blue) [![Rdoc](http://www.rdocumentation.org/badges/version/Sim.DiffProc)](http://www.rdocumentation.org/packages/Sim.DiffProc)
1616

1717

@@ -74,22 +74,22 @@ use `citation()` for information on how to cite the software;
7474

7575
```r
7676
citation("Sim.DiffProc")
77-
#>
78-
#> To cite package 'Sim.DiffProc' in publications use:
79-
#>
80-
#> Arsalane Chouaib Guidoum and Kamal Boukhetala (2018).
81-
#> Sim.DiffProc: Simulation of Diffusion Processes.R package
82-
#> version 4.1.https://cran.r-project.org/package=Sim.DiffProc
83-
#>
84-
#> A BibTeX entry for LaTeX users is
85-
#>
86-
#> @Manual{,
87-
#> title = {Sim.DiffProc: Simulation of Diffusion Processes.},
88-
#> author = {Arsalane Chouaib Guidoum and Kamal Boukhetala},
89-
#> year = {2018},
90-
#> note = {R package version 4.1},
91-
#> url = {https://cran.r-project.org/package=Sim.DiffProc},
92-
#> }
77+
78+
To cite package 'Sim.DiffProc' in publications use:
79+
80+
Arsalane Chouaib Guidoum and Kamal Boukhetala (2018).
81+
Sim.DiffProc: Simulation of Diffusion Processes.R package
82+
version 4.1.https://cran.r-project.org/package=Sim.DiffProc
83+
84+
A BibTeX entry for LaTeX users is
85+
86+
@Manual{,
87+
title = {Sim.DiffProc: Simulation of Diffusion Processes.},
88+
author = {Arsalane Chouaib Guidoum and Kamal Boukhetala},
89+
year = {2018},
90+
note = {R package version 4.1},
91+
url = {https://cran.r-project.org/package=Sim.DiffProc},
92+
}
9393
```
9494

9595
Note

man/Sim.DiffProc-package.Rd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ A package for symbolic and numerical computations on scalar and multivariate sys
1616
\tabular{ll}{
1717
Package: \tab Sim.DiffProc \cr
1818
Type: \tab Package \cr
19-
Version: \tab 4.1 \cr
20-
Date: \tab 2018-09-09 \cr
19+
Version: \tab 4.2 \cr
20+
Date: \tab 2018-10-10 \cr
2121
License: \tab GPL (>= 2) \cr
2222
Depends: \tab R (>= 2.15.1) \cr
23-
Imports: \tab Deriv (>= 3.8.0), MASS, parallel, rgl (>= 0.66), scatterplot3d (>= 0.3-36) \cr
23+
Imports: \tab Deriv (>= 3.8.0), MASS, parallel, rgl (>= 0.93.991), scatterplot3d (>= 0.3-36) \cr
2424
Suggests: \tab deSolve (>= 1.11), knitr, sm (>= 2.2-5.3) \cr
2525
Classification/MSC:\tab 37H10, 37M10, 60H05, 60H10, 60H35, 60J60, 65C05, 68N15, 68Q10 \cr
2626
}

0 commit comments

Comments
 (0)