randomizeTau {MMLR} | R Documentation |
Transformation of the observed time vector tau. Data preparation stage for simulation
Description
Additional function to be used for simulation purposes (academical or research). Transforming of the observed time vector tau according to user preferences. Random disturbances are entered in the initial values of the vector tau. The expectation of new observed times coincides with initial values of vector tau.
Usage
randomizeTau(tau, p, k0 = 2, k1 = 1)
Arguments
tau |
Vector (n x 1), n - number of observations |
p |
Scalar (from 1 to +inf), random number for simulation. The default value is 1 |
k0 |
Scalar (from 1 to +inf). Multiplicative parameter for transforming the initial value The default is k0 = 2. |
k1 |
Scalar. The number of digits after the comma when rounded. The default is 1. |
Details
Initial values of observation times are multiplied by a random value ($tau_i$ x k x rnd(0, 1)). All times are independent and time of ith observation has uniform distribution on (0, k$tau_i$).
Value
Vector with new observation times, according to user preferences.
Examples
tGiven <- matrix (c(6,4.8,1,2.6,6.4,1.7,2.9,4.4,1.5,3.4), nrow = 10, ncol = 1)
randomizeTau(tGiven,1,2,2)