Publications by Stéphane Laurent

Multiple integral over a polyhedron

26.02.2019

You are a R user and you have to evaluate the integral \[ \int_{-5}^4\int_{-5}^{3-x}\int_{-10}^{6-x-y} f(x,y,z) \,\mathrm{d}z\,\mathrm{d}y\,\mathrm{d}x \] for a certain function \(f\). How? A possibility is to nest the integrate function: f <- function(x,y,z) x + y*z integrate(Vectorize(function(x) { integra...

3259 sym R (1769 sym/10 pcs) 2 img

Generalized circles and inversions

12.03.2019

Let \(\iota_0\) be the inversion with respect to the unit circle: \[ \iota_0(z) = \frac{1}{\bar{z}}, \quad z \neq 0. \] Consider a generalized circle \(\mathcal{G}\mathcal{C}\) having equation \[ \boxed{Az\bar{z} + \bar{\gamma}z + \gamma\bar{z} = D} \] which is equivalent, by dividi...

8582 sym R (7428 sym/29 pcs) 4 img

Drawing hyperbolic polyhedra

04.04.2019

A. A. Ungar has developed the concept of gyrovector space. His theory provides a (gyro)vector approach to hyperbolic geometry. Ungar deeply studied three examples of gyrovector spaces; they correspond to three models of hyperbolic geometry: the Beltrami model, the Poincaré ball model, and the hyperboloid ...

6149 sym R (16687 sym/18 pcs) 24 img

Useful callbacks for DT (in Shiny)

13.06.2019

Edit cells on pressing Tab and arrow keys Select rows on click and drag Getting the selected rows Edit columns headers Child tables Change row CSS properties on clicking an icon Capturing the autofilled cells Select page with a numeric input Edit cells on pressing Tab and arrow keys This callback allows a more friendly way to edit...

3497 sym R (21647 sym/10 pcs) 14 img

Plotting the columns of a Datatable

09.07.2019

Here is the code of this app: library(shiny) library(shinyBS) library(DT) library(ggplot2) ui <- fluidPage( uiOutput("modals"), DTOutput("table") ) server <- function(input, output, session){ dat <- iris buttons <- lapply(1:ncol(dat), function(i){ actionButton( paste0("this_id_is_not_used",i), "plot", class = "b...

439 sym R (3280 sym/1 pcs) 2 img

Drawing nested Steiner chains

12.07.2019

This is a Steiner chain with its enveloping cyclide: And these are nested Steiner chains: With R We will include the cyclides in the plot. We firstly write a function returning a mesh of a cyclide. It is obtained by applying an inversion to the mesh of a torus. library(rgl) torusMesh <- function(R, r, S, s, arc, ...){...

1118 sym R (14740 sym/6 pcs) 12 img

The Beta distribution of the third kind (or generalised Beta prime)

21.07.2019

Preliminaries: the (scaled) Beta prime distribution Beta distribution of the third kind Update 2019-09-05: generalised Beta distribution Cumulative distribution function Sampling the Beta distribution of the third kind Application to the Bayesian binomial model Application to the Bayesian “two Poisson samples” model We present ...

10155 sym R (3269 sym/9 pcs) 6 img

Five-parameters logistic regression

19.11.2019

The five-parameters logistic curve is commonly defined by \[ f(x) = A + \frac{D-A}{\Bigl(1+\exp\bigl(B(C-x)\bigr)\Bigr)^S}. \] Assuming \(B>0\) and \(S>0\), \(A\) is the value of the horizontal asymptote when \(x \to -\infty\); \(D\) is the value of the horizontal asy...

4025 sym R (4502 sym/13 pcs) 6 img

A shinytest script in testthat

22.11.2019

The shiny app Here is a simple shiny app: library(shiny) library(ggplot2) # UI #### ui <- fluidPage( titlePanel("Set axis breaks"), sidebarLayout( # sidebar #### sidebarPanel( fluidRow( column( width = 4, numericInput("from", "From:", value = NULL) ), column( width = 4, ...

979 sym R (2286 sym/4 pcs) 2 img

Stereographic truncated tesseract

15.12.2019

The stereographic truncated tesseract Drawing with rgl (R) Drawing with Asymptote Drawing with POV-Ray The stereographic truncated tesseract We show how to draw a stereographic truncated tesseract with rgl (R), Asymptote, and POV-Ray. The truncated tesseract is a uniform polychoron. Among its cells, there ...

1162 sym R (30724 sym/3 pcs) 6 img