mirror of
https://github.com/Polarolouis/anova-phylogenetique-projet-msv.git
synced 2026-06-17 18:25:25 +02:00
Fix typo
This commit is contained in:
parent
9efcc969f9
commit
c53cbe3c49
1 changed files with 11 additions and 7 deletions
|
|
@ -4,9 +4,9 @@ library(ggplot2)
|
|||
N <- 1000
|
||||
time_delta <- 0.5
|
||||
|
||||
generate_brownian_movement_traj <- function(N, time_delta) {
|
||||
generate_brownian_motion_traj <- function(N, time_delta, variance = 1) {
|
||||
# BM indep vector
|
||||
bm_indep <- rnorm(N, mean = 0, time_delta)
|
||||
bm_indep <- rnorm(N, mean = 0, sqrt(time_delta * variance))
|
||||
|
||||
# The trajectory
|
||||
bm_traj <- cumsum(bm_indep)
|
||||
|
|
@ -15,9 +15,13 @@ generate_brownian_movement_traj <- function(N, time_delta) {
|
|||
return(data.frame(time_serie = time_serie, bm_traj = bm_traj))
|
||||
}
|
||||
|
||||
bm_traj_and_time <- generate_brownian_movement_traj(N, time_delta)
|
||||
bm_traj_and_time <- generate_brownian_motion_traj(N, time_delta)
|
||||
|
||||
# Plotting
|
||||
ggplot(bm_traj_and_time) +
|
||||
aes(x = time_serie, y = bm_traj) +
|
||||
geom_line()
|
||||
# Generate multiple BM
|
||||
|
||||
|
||||
# For phylogenic tree
|
||||
|
||||
generate_phylo_tree <- function(n_tips, max_time) {
|
||||
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue