Last updated: 2021-10-03
Checks: 6 1
Knit directory: false.alarm/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish
to commit the R Markdown file and build the HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20201020)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 1b46eb7. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Renviron
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: .httr-oauth
Ignored: R/RcppExports.R
Ignored: _targets/
Ignored: dev/
Ignored: inst/extdata/
Ignored: output/Fluss_a103l_II.svg
Ignored: output/Fluss_a103l_V.svg
Ignored: output/Fluss_a104s_II.svg
Ignored: output/Fluss_a104s_V.svg
Ignored: output/Fluss_a105l_II.svg
Ignored: output/Fluss_a105l_V.svg
Ignored: output/Fluss_a109l_II.svg
Ignored: output/Fluss_a109l_aVF.svg
Ignored: output/Fluss_a123l_II.svg
Ignored: output/Fluss_a123l_V.svg
Ignored: output/Fluss_a134s_II.svg
Ignored: output/Fluss_a134s_V.svg
Ignored: output/Fluss_a142s_II.svg
Ignored: output/Fluss_a142s_V.svg
Ignored: output/Fluss_a145l_II.svg
Ignored: output/Fluss_a145l_V.svg
Ignored: output/Fluss_a152s_II.svg
Ignored: output/Fluss_a152s_V.svg
Ignored: output/Fluss_a161l_II.svg
Ignored: output/Fluss_a161l_V.svg
Ignored: output/Fluss_a163l_II.svg
Ignored: output/Fluss_a163l_V.svg
Ignored: output/Fluss_a165l_II.svg
Ignored: output/Fluss_a165l_V.svg
Ignored: papers/_draft/
Ignored: papers/aime2021/aime2021.md
Ignored: pdfs/
Ignored: protocol/0-Reuniao_Entrevista.pdf
Ignored: protocol/20210715-Progress Report.pdf
Ignored: protocol/A-Relatorio de Progresso.pdf
Ignored: protocol/B-Plano de Tese.pdf
Ignored: protocol/C-Declaração_PPR.pdf
Ignored: protocol/D-Feedback Coorientador.pdf
Ignored: protocol/E-CV2021.pdf
Ignored: protocol/Z-Relatorio de Progresso.pdf
Ignored: protocol/figure/filtered_ecg.svg
Ignored: protocol/figure/regime_false.svg
Ignored: protocol/figure/regime_filter.svg
Ignored: protocol/figure/regime_true.svg
Ignored: protocol/figure/roadmap_original.svg
Ignored: protocol/figure/roadmap_updated.svg
Ignored: renv/library/
Ignored: renv/staging/
Ignored: src/RcppExports.cpp
Ignored: src/RcppExports.o
Ignored: src/false.alarm.dll
Ignored: src/fft.o
Ignored: src/mass.o
Ignored: src/math.o
Ignored: src/mpx.o
Ignored: src/scrimp.o
Ignored: src/stamp.o
Ignored: src/stomp.o
Ignored: src/windowfunc.o
Ignored: tmp/
Unstaged changes:
Modified: .Rprofile
Modified: _targets.R
Modified: analysis/blog.Rmd
Modified: man/mp_algos.Rd
Modified: papers/references.bib
Modified: renv.lock
Modified: scripts/find_all_files.R
Modified: scripts/plot_regimes.R
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/blog.Rmd
) and HTML (docs/blog.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
html | 1bcac45 | Francisco Bischoff | 2021-08-17 | site |
Rmd | c88cbd5 | Francisco Bischoff | 2021-08-17 | targets workflowr |
This blog is a continuation of the thesis Report link. The reader must follow this page from top to bottom.
The first workflow presented in July has changed. Its purpose was to define a “big picture” of the process.
The main changes introduced were:
Initially, the data had been carried along the workflow, being copied at each new step. That obviously is not the way to handle it. Thus, the raw data is stored only on the “dataset” object and reused where needed.
Now, any modification to the raw data will create a new object, for example, “ds_filtered” where the SQI filter is applied over the data.
The goal of this work is to operate with streaming data. Thus, the Matrix Profile computation algorithm has been rewritten to handle as receiving data in chunks. The algorithm can simulate one observation at a time or a batch of observations (for efficiency). The result will always be as if one observation had been received individually by the model.
To avoid unnecessary recomputations for this analysis phase, the companion statistics needed by the model are pre-computed and fed alongside the data the algorithm needs to process. The pre-computation also allows experimenting with parameters during this process.
While implementing the streaming-like pipeline, some declarations must be made. In 2017, the FLUSS (Fast Low-cost Unipotent Semantic Segmentation) and the FLOSS (Fast Low-cost Online Semantic Segmentation) algorithm was introduced by Gharghabi et al..1 In 2018, the same group published their findings using multi-dimensional time series2 using the same algorithms.
Claims about the algorithm:
Briefly describing the regime detection algorithm, which can be explored in the original paper,2 it is based on the assumption that between two regimes, the most similar shape (its nearest neighbor) is located on “the same side.” And this information is obtained from the Matrix Profile computation. More precisely, using only the Profile Index.
Before talking about the Matrix Profile computation, some findings deserve to be mentioned:
In the original paper, in chapter 3.5, the authors of FLOSS wisely introduce the temporal constraint. But some details are not mentioned. 1) As this algorithm only needs the Profile Index, should we use the already computed Indexes or recompute the Matrix Profile using this constraint (i.e., the constraint is on the Profile Index or in the FLOSS algorithm?). That is not an issue about the algorithm but a choice we need to be aware of beforehand. If we apply the constraint on the Profile Index, we need to have this parameter set from the start. If not, the FLOSS algorithm can not take into account the indexes that are larger than the constraint. 2) The correction curve typically used on FLUSS and FLOSS is declared by the authors as “simply a uniform distribution,” but this is not “simply” that. Empirically, there is a helpful pattern to know about the distribution when using temporal constraints (at least from the start, in the Matrix Profile stage). At first glance, we see that the distribution resembles the skewed distribution used in FLOSS but is shorter, while the \(constraint \ge MatrixProfileSize/2\). For lower constraints, the maximum value of this distribution is equal to \(MatrixProfileSize/2\) between the indexes \(constraint\) to the index \(MatrixProfileSize - (constraint \times 0.9)\). That is important to know, and it was not stated by the authors because the output of the FLOSS algorithm should be normalized and constrained between 0 and 1. That allows us to compare different trials using different parameters in the process. Finally, the last data points are not irrelevant, opposed to what was stated by the authors, since an Online algorithm needs to return an answer as soon as the application domain requires. That is very much relevant to this work’s field, as, for example, for asystole detection, we have a window of 4 seconds to fire the alarm. If the time constraint is 10 seconds, this would mean (by the original article) that the last 10 seconds of the incoming data would not be sufficient to detect the regime change.
About the first point mentioned above, it seems more appropriate to set the temporal constraint in the Matrix Profile algorithm bla bla
Concerning the second point mentioned above, the solution for evaluating the effect of using time constraints in this work’s setting was to generate the ideal distribution using the constrained parameters beforehand. That gives us enough data to evaluate a regime change accurately utilizing a minimum of \(2 \times WindowSize\) datapoints. The best index is still to be determined, and current tests are using 3 seconds limit.
TODO: explain with images
Since the first Matrix Profile computation algorithm, the STAMP,
.. talk about the evaluation metric
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=C
[3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Portugal.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] here_1.0.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 whisker_0.4 knitr_1.33 magrittr_2.0.1
[5] workflowr_1.6.2 debugme_1.1.0 R6_2.5.1 rlang_0.4.11
[9] fansi_0.5.0 stringr_1.4.0 tools_4.1.1 xfun_0.24
[13] utf8_1.2.2 git2r_0.28.0.9000 jquerylib_0.1.4 htmltools_0.5.1.1
[17] ellipsis_0.3.2 rprojroot_2.0.2 yaml_2.2.1 digest_0.6.27
[21] tibble_3.1.4 lifecycle_1.0.0 crayon_1.4.1 later_1.3.0
[25] sass_0.4.0 vctrs_0.3.8 promises_1.2.0.1 fs_1.5.0
[29] glue_1.4.2 evaluate_0.14 rmarkdown_2.11 stringi_1.7.3
[33] bslib_0.2.5.1 compiler_4.1.1 pillar_1.6.2 jsonlite_1.7.2
[37] httpuv_1.6.3 pkgconfig_2.0.3