-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.qmd
150 lines (117 loc) · 5.75 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
title: "Covariate-Adjusted Functional Data Analysis for SHM"
# Freeze computed outputs
freeze: true
# Enable banner style title blocks
title-block-banner: true
# Enable CC licence appendix
license: "CC BY"
# Default for table of contents
toc: true
toc-title: Table of contents
toc-location: left
# Default knitr options
execute:
echo: true
message: true
warning: true
cache: false
date: "10/07/2024"
format: gfm
editor: source
bibliography:
- literature.bib
link-citations: true
output: github_document
---
# Reproduction details and instructions
The folders contain the following files, which have been used to generate the
results and plots of the paper [@Wittenberg.etal_2024]. For each file an input
and output is stated, which describes the required input data and the generated
output files. The files are written in the R language and replications can be
achived by rendering the qarto ".qmd" files in the R environment.
To run all codes the following R-packages are required:
```{r, message=FALSE}
# Package names
packages <- c("benchmarkme", "dplyr", "forcats", "funData", "ggplot2", "gratia",
"lme4", "lubridate", "mgcv", "patchwork", "plotly", "purrr",
"refund", "R.matlab", "segmented", "spc", "tidyr", "tidyselect",
"xtable") # "reticulate" and "png" are not required.
# R package "reticulate" can be used to run Python code in
# R and save the 3 dimensional plots. The R package "png"
# can be used to to include png files.
# Install packages not yet installed
installed_packages <- packages %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) {
install.packages(packages[!installed_packages])
}
# Packages loading
invisible(lapply(packages, library, character.only = TRUE))
```
# Extract bridge data
The file *Extract_KW51_bridge_data_Maes.Lombaerts_2021.qmd* downloads and extracts the KW51 data set which is freely available from https://zenodo.org/records/3745914, cf. [@Maes.Lombaert_2020], and for information on the bridge compare [@Maes.Lombaert_2021].
* Output:
- data/Dataset_bridge_KW51.RDS (Compiled data set for the KW51 bridge)
# Case study 1 - computational results
The file *Case_study_1_computational_results_KW51_Mode06.qmd* replicates all computations of the KW51 case study in Section 3 of the main paper.
* Input: Dataset_bridge_KW51.RDS (Compiled data set KW51 bridge)
* Output:
- data/mode06_gam2_fpcaRes.RDS (Basic model eigenfunctions)
- data/mode06_gam2d.RDS (Basic model refitted)
- data/mode06_dtaiB2.RDS (Data including eigenfrequencies)
- data/mode06_gam4d.RDS (Reduced model refitted)
- data/mode06_dtaiB4.RDS (Data including eigenfrequencies)
- data/mode06_gam6d.RDS (Additive model refitted)
- data/mode06_dtaiB6.RDS (Data including eigenfrequencies)
- data/mode06_gam7_fpcaRes.RDS (Interactions model eigenfunctions)
- data/mode06_gam7d.RDS (Interactions model refitted)
- data/mode06_dtaiB7.RDS (Data including eigenfrequencies)
- Table 1 (R squared results of all four models)
# Case study 1 - plot results
The file *Case_study_1_plot_results_KW51_Mode06.qmd* replicates all KW51 case study related plots in Section 3 of the main paper.
* Input: All saved output results stored in data folder from file Case_study_1_computational_results_KW51_Mode06.qmd
* Output:
- Figure 4 (Eigenfunctions basic model)
- Figure 5 (Basic model effects)
- Figure 6 (Reduced model effects)
- Figure 7a (Additive model intercept effect)
- Figure 7b (Additive model covariate effects)
- Figure 8a (Interaction effect model intercept effect)
- Figure 8b (Interaction effect model covariate effect)
- Figure 9 (MEWMA control charts in different setups)
# Introduction and misc plots
The file *Introduction_and_misc_plots.qmd* replicates the introduction profiles and data generation process plots.
* Input: Dataset_bridge_KW51.RDS (Compiled data set KW51 bridge)
* Output:
- Figure 1 (KW51 data exemplary response, covariate and error profiles)
- Figure A1 (Artificial data exemplary response, covariate and error profiles)
# Simulation study: model training pipe line - computational results
The file *Simulation_study_model_training_pipe_line_computational_results.qmd*
computes 100 runs with J profiles and saves data to data/simulations folder.
* Input: -
* Output:
- generated data files (estimated basic model and eigenfunctions)
in a specified folder
# Simulation study: model training pipe line - plot results
The file *Simulation_study_model_training_pipe_line_plot_results.qmd*
plots initial functions, simulated data run profiles and their mean.
* Input:
- data/simulations/Simulation_study_N300_NAOBS0_SEED42_ML.RDS (Simulated profiles for J=300)
* Output:
- Figure A2 (Model training pipeline results on simulated profiles)
# Simulation study: monitoring scheme run length - computational results
The file *Simulations_study_monitoring_scheme_run_length_computational_results.R*
is an R-script prepared for parallel computing the run-lengths of the MEWMA control charts.
* Input:
- fpcaResSim_simulation_runlength.RDS (eigenfunctions for artificial data)
- gam2d_simulation_runlength.RDS (Basic model for artificial data)
- repeat the script for different lambda settings (0.1, 0.3, 1)
* Output:
- Run-length files for different MEWMA smoothing parameters
# Simulations monitoring scheme run length - plots
The file *Simulations_monitoring_scheme_run_length_plots.qmd* plots ARL profiles for different MEWMA smooting parameters.
* Input:
- data/simulations/ (Average Run Length profiles for lambda=0.1,0.3,1)
* Output:
- Figure A3 (MEWMA charts Average Run Length performance comparison)
# References