simMatrix: Simulating 3x3 matrix with binomial random variables

Description Usage Arguments Value Note Author(s) References Examples

Description

This function simulates a matrix of size 3x3 and fills these with bernoulli random variables under a probability of p. An optional parameter sierp is added in order to set the center of the matrix to 0 as for the general Sierpinski-Carpet.

Usage

1
simMatrix(p, sierp)

Arguments

p

A numeric value between 0 and 1 indicating the probability of success (0 or 1) for the Bernoulli random variables of the matrix.

sierp

An optional logical parameter: if TRUE then the center of the matrix is automatically set to 0 as for the general Sierpinski-Carpet, else also a Bernoulli random variable is simulated.

Value

The function creates a 3x3 matrix containing simulated zeros and ones from Bernoulli distribution under given probability p.

Note

Shall not be called or changed by user.

Author(s)

Philipp Hermann; Jozef Kiselak; Milan Stehlik\ philipp.hermann@jku.at; jozef.kiselak@upjs.sk; mlnstehlik@gmail.com

References

Hermann, P., Mrkvicka, T., Mattfeldt, T., Minarova, M., Helisova, K., Nicolis, O., Wartner, F., and Stehlik, M. (2015). Fractal and stochastic Geometry Inference for Breast Cancer: a Case Study with Random Fractal Models and Quermass-Interaction Process. Statistics in Medicine, 34(18), 2636-2661. doi: 10.1002/sim.6497.

Examples

1
2
simMatrix(p = 0.3, sierp = TRUE)
simMatrix(p = 0.8, sierp = FALSE)

Example output

     [,1] [,2] [,3]
[1,]    0    0    0
[2,]    0    0    0
[3,]    1    0    1
     [,1] [,2] [,3]
[1,]    0    1    1
[2,]    1    1    1
[3,]    0    1    0

FractalParameterEstimation documentation built on July 10, 2019, 5:05 p.m.