geneARMAsim {geneARMA} | R Documentation |
A function which generates data to test the geneARMAfit results.
geneARMAsim(n = 100, J = 2, K = 2, sigsq = 0.01, ars = numeric(0), mas = numeric(0), length.out = 21, fourier.coefs, tau)
n |
simulated sample size. |
J |
number of clusters. |
K |
number of Fourier terms. |
sigsq |
innovation variance. |
ars |
a vector of AR coefficients, where the time series is parameterized as X[t] = ars[1] * X[t-1] + ars[2]*X[t-2] + ... + e[t]+ mas[1]*e[t-1] + ... |
mas |
a vector of MA coefficients, where the time series is parameterized as X[t] = ars[1] * X[t-1] + ars[2]*X[t-2] + ... + e[t]+ mas[1]*e[t-1] + ... |
length.out |
number of equally spaced time points at which each gene is obsered. |
fourier.coefs |
A J by 2K+1 matrix with fourier coefficients. The rows are clusters, and the columns are constant term, cosine term, sine term, cosine term, sine term,... where lower frequency terms come first. |
tau |
A vector of length J specifying the frequencies for the different clusters. |
Returns a list with two components
Y |
The simulated data |
tm |
The corresponding time points |
Timothy McMurry and Arthur Berg
Ning Li, et al. Functional clustering of periodic transcriptional profiles through ARMA(p,q)
set.seed(100) Data <- geneARMAsim(400, ars=c(.5, .1)) f1 <- geneARMAfit(Data$Y, Data$tm, 2, 2, 2, 0, eps.conv = .001, max.iter = 15, tau.init=c(.25, .45)) plot(f1, y=NULL, "all.means") plot(f1, y=NULL, "single.cluster", j=2)