Skip to content

Commit

Permalink
expanded description
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasHohmann committed May 22, 2024
1 parent 662e13a commit 00b286d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Examine paleoTS model selection performance with time series length

## Introduction

Hohmann et al 2023 ([DOI: 10.1101/2023.12.18.572098](https://doi.org/10.1101/2023.12.18.572098)), supplementary code ([DOI: 10.5281/zenodo.10390267](https://doi.org/10.5281/zenodo.10390267)) found unexpected behavior in the model selection performance of the paleoTS package, version 0.5.3 ([CRAN.R-project.org/package=paleoTS](https://CRAN.R-project.org/package=paleoTS)). Here, this behavior is examined using the simulation tools implemented in the paleoTS package.
Hohmann et al 2023 ([DOI: 10.1101/2023.12.18.572098](https://doi.org/10.1101/2023.12.18.572098)), supplementary code ([DOI: 10.5281/zenodo.10390267](https://doi.org/10.5281/zenodo.10390267)) found unexpected behavior in the model selection performance of the paleoTS package, version 0.5.3 ([CRAN.R-project.org/package=paleoTS](https://CRAN.R-project.org/package=paleoTS)) when including Ornstein-Uhlenbeck processes in the set of modes of evolution tested for. Here, this behavior is examined using the simulation tools implemented in the paleoTS package.

The code simulates stasis and undirected random walks, and examines how AICc weights for different modes of evolution (stasis, (un)directed random walk) change with time series length.

## Authors

Expand Down Expand Up @@ -52,8 +54,10 @@ Results of the analysis are already stored in the repository under _figs/_. You
* code : folder for code
* test.paleots.R : R script examining paleoTS model selection with time series length
* figs : folder for figures
* test_stasis.jpeg : AICc weights under stasis model with increasing time series length
* test_urw.jpeg : AICc weights under undirected random walk (URW) model with increasing time series length
* test_stasis_with_ou.jpeg : AICc weights under stasis model with increasing time series length, including OU in the tested modes
* test_stasis_without_ou.jpeg : AICc weights under stasis model with increasing time series length, not including OU in the tested modes
* test_urw_with_ou.jpeg : AICc weights under undirected random walk (URW) model with increasing time series length, including OU in the tested modes
* test_urw_without_ou.jpeg : AICc weights under undirected random walk (URW) model with increasing time series length, not including OU in the tested modes
* renv : folder for `renv` package
* .Rprofile : R session info
* .gitignore : untracked files
Expand Down
20 changes: 10 additions & 10 deletions code/test.paleots.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ set.seed(1) # set seed for reproducibility

#### stasis with test for OU ####

cat("Running stasis simulations \n")
cat("Running stasis simulations 1/2 \n")
for (j in 1:9){
print(j)
cat(paste0("time series length ", ns[j],"\n"))
for (i in 1:100){

test<-paleoTS::sim.Stasis(ns=ns[j],
Expand Down Expand Up @@ -61,9 +61,9 @@ mtext('green = stasis, yellow = OU, blue = URW, red = GRW',side=3)
dev.off()

#### URW with test for OU ####
cat("Running URW simulations \n")
cat("Running URW simulations 1/2 \n")
for (j in 1:9){
print(j)
cat(paste0("time series length ", ns[j],"\n"))
for (i in 1:100){

test = paleoTS::sim.GRW(ns = ns[j], # time series length
Expand Down Expand Up @@ -105,9 +105,9 @@ compile<-array(dim = c(3,100,9))

#### Stasis without test for OU ####

cat("Running stasis simulations \n")
cat("Running stasis simulations 2/2 \n")
for (j in 1:9){
print(j)
cat(paste0("time series length ", ns[j],"\n"))
for (i in 1:100){

test<-paleoTS::sim.Stasis(ns=ns[j],
Expand All @@ -131,7 +131,7 @@ compile.group<-data.frame(
stringsAsFactors = FALSE
)
compile.group$y<-ordered(compile.group$y,levels=c('Stasis','URW','GRW'))
jpeg("figs/test_stasis.jpeg")
jpeg("figs/test_stasis_without_ou.jpeg")
boxplot(x~y+z,data = compile.group,
col=c('lightgreen','dodgerblue3','firebrick3'),
xaxt = 'n',
Expand All @@ -148,9 +148,9 @@ dev.off()

#### URW without test for OU ####

cat("Running URW simulations \n")
cat("Running URW simulations 2/2 \n")
for (j in 1:9){
print(j)
cat(paste0("time series length ", ns[j],"\n"))
for (i in 1:100){

test = paleoTS::sim.GRW(ns = ns[j], # time series length
Expand All @@ -174,7 +174,7 @@ compile.group<-data.frame(
)
compile.group$y<-ordered(compile.group$y,levels=c('Stasis','URW','GRW'))

jpeg("figs/test_urw.jpeg")
jpeg("figs/test_urw_without_ou.jpeg")
boxplot(x~y+z,data = compile.group,
col=c('lightgreen','dodgerblue3','firebrick3'),
xaxt = 'n',
Expand Down

0 comments on commit 00b286d

Please sign in to comment.