simulateRJaCGH {RJaCGH} | R Documentation |
This function simulates observations from a hidden Markov model with normal distributed observations and non-homogeneous transition matrix.
simulateRJaCGH(n, x = NULL, mu, sigma.2, beta, start, q=-beta)
n |
Number of observations to simulate |
x |
Distance to the next observation. Must be a vector of size n-1. If NULL, a normal sample with 0 and 1 parameters is taken |
mu |
Vector of means for the hidden states |
sigma.2 |
Vector of variances for the hidden states |
beta |
beta parameter of the transition matrix. Must be a square
matrix with the same size as the number of hidden states. |
start |
Starting states of the sequence. Must be an integer from 1 to the number of hidden states. |
q |
q parameter of the transition matrix. Must be a square
matrix with the same size as the number of hidden states. By
default, is -beta |
Please note that in RJaCGH model, parameter q
is taken as -beta
A list with components
states |
Sequence of hidden states |
y |
Observations |
Oscar Rueda and Ramon Diaz-Uriarte
Oscar Rueda and ramon Diaz-Uriarte, in prep.
Q.NH, RJaCGH
beta <- matrix(c(0, 5, 1, 1, 0, 1, 3, 5, 0), 3) obs <- simulateRJaCGH(n=200, x=rexp(199), mu=c(-3, 0, 3), sigma.2=c(1,1,1), beta=beta, start=2) plot(obs$y, col=obs$states)