powered by
Function to simulate multivariate evolutionary sequence data that evolve according to an Unbiased Random Walk
sim.multi.URW( ns = 30, anc = c(0, 0), R = matrix(c(0.5, 0, 0, 0.5), nrow = 2, byrow = TRUE), vp = 0.1, nn = rep(30, ns), tt = 0:(ns - 1) )
A multivariate evolutionary sequence (time-series) data set.
number of samples in time-series
the ancestral trait values
the drift matrix
within-population trait variance
vector of the number of individuals in each sample (identical sample sizes for all time-series is assumed)
vector of sample ages, increases from oldest to youngest
Kjetil Lysne Voje
## Create a multivariate dataset data_set<-sim.multi.URW(40, R = matrix(c(0.2,0.1,0.1,0.3), nrow=2, byrow = TRUE)) ## plot the data plotevoTS.multivariate(data_set)
Run the code above in your browser using DataLab