# first-data-lab/fdaimage architecture

> Architecture diagram of the GitHub repository first-data-lab/fdaimage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/first-data-lab/fdaimage
- Repository: https://github.com/first-data-lab/fdaimage

## Overview

FDAimage is an R package for fitting and using functional-image models. The apparent workflow is to fit a model, then inspect it or make predictions; the package also exposes cross-validation, SCC, and data-access functions. The tree identifies separate estimator and bootstrap modules, but no README or source excerpts were provided, so their exact call relationships and the meaning of SCC cannot be verified. Edges therefore show only the public-facing entry points, not inferred internal wiring.

Main entry points: [`R/fit.FDAimage.R`](https://github.com/first-data-lab/fdaimage/blob/master/R/fit.FDAimage.R) (Fit model), [`R/predict.FDAimage.R`](https://github.com/first-data-lab/fdaimage/blob/master/R/predict.FDAimage.R) (Prediction), [`R/plot.FDAimage.R`](https://github.com/first-data-lab/fdaimage/blob/master/R/plot.FDAimage.R) (Plot model), [`R/cv.FDAimage.R`](https://github.com/first-data-lab/fdaimage/blob/master/R/cv.FDAimage.R) (Cross-validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Model fitting"]
  node_fit["Fit model<br/>[fit.FDAimage.R]"]
  node_est_ho["HO estimator<br/>[FDAimage.est.ho.R]"]
  node_est_pc["PC estimator<br/>[FDAimage.est.pc.R]"]
  node_cc_ho["HO correction<br/>[FDAimage.CC.ho.R]"]
  node_cc_pc["PC correction<br/>[FDAimage.CC.pc.R]"]
end

subgraph group_use["Model use"]
  node_predict["Prediction<br/>[predict.FDAimage.R]"]
  node_plot["Plot model<br/>[plot.FDAimage.R]"]
end

subgraph group_support["Supporting methods"]
  node_cv["Cross-validation<br/>[cv.FDAimage.R]"]
  node_scc["SCC method<br/>[scc.FDAimage.R]"]
  node_bootstrap["Bootstrap<br/>[CoverBoot.R]"]
  node_data_api["Data access<br/>[data.FDAimage.R]"]
  node_datasets["Bundled datasets"]
end

node_user(("R user"))

node_user -->|"fits model"| node_fit
node_user -->|"requests prediction"| node_predict
node_user -->|"plots model"| node_plot
node_user -->|"runs validation"| node_cv
node_user -->|"uses method"| node_scc
node_user -->|"requests data"| node_data_api

click node_fit "https://github.com/first-data-lab/fdaimage/blob/master/R/fit.FDAimage.R"
click node_est_ho "https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.est.ho.R"
click node_est_pc "https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.est.pc.R"
click node_cc_ho "https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.CC.ho.R"
click node_cc_pc "https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.CC.pc.R"
click node_predict "https://github.com/first-data-lab/fdaimage/blob/master/R/predict.FDAimage.R"
click node_plot "https://github.com/first-data-lab/fdaimage/blob/master/R/plot.FDAimage.R"
click node_cv "https://github.com/first-data-lab/fdaimage/blob/master/R/cv.FDAimage.R"
click node_scc "https://github.com/first-data-lab/fdaimage/blob/master/R/scc.FDAimage.R"
click node_bootstrap "https://github.com/first-data-lab/fdaimage/blob/master/R/CoverBoot.R"
click node_data_api "https://github.com/first-data-lab/fdaimage/blob/master/R/data.FDAimage.R"
click node_datasets "https://github.com/first-data-lab/fdaimage/tree/master/data"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fit,node_est_ho,node_est_pc,node_cc_ho,node_cc_pc,node_user toneBlue
class node_predict,node_plot toneAmber
class node_cv,node_scc,node_bootstrap,node_data_api,node_datasets toneMint
```

## Components

### Model fitting

- [Fit model](https://github.com/first-data-lab/fdaimage/blob/master/R/fit.FDAimage.R): `R/fit.FDAimage.R`
- [HO estimator](https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.est.ho.R): `R/FDAimage.est.ho.R`
- [PC estimator](https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.est.pc.R): `R/FDAimage.est.pc.R`
- [HO correction](https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.CC.ho.R): `R/FDAimage.CC.ho.R`
- [PC correction](https://github.com/first-data-lab/fdaimage/blob/master/R/FDAimage.CC.pc.R): `R/FDAimage.CC.pc.R`

### Model use

- [Prediction](https://github.com/first-data-lab/fdaimage/blob/master/R/predict.FDAimage.R): `R/predict.FDAimage.R`
- [Plot model](https://github.com/first-data-lab/fdaimage/blob/master/R/plot.FDAimage.R): `R/plot.FDAimage.R`

### Supporting methods

- [Cross-validation](https://github.com/first-data-lab/fdaimage/blob/master/R/cv.FDAimage.R): `R/cv.FDAimage.R`
- [SCC method](https://github.com/first-data-lab/fdaimage/blob/master/R/scc.FDAimage.R): `R/scc.FDAimage.R`
- [Bootstrap](https://github.com/first-data-lab/fdaimage/blob/master/R/CoverBoot.R): `R/CoverBoot.R`
- [Data access](https://github.com/first-data-lab/fdaimage/blob/master/R/data.FDAimage.R): `R/data.FDAimage.R`
- [Bundled datasets](https://github.com/first-data-lab/fdaimage/tree/master/data): `data`

### Other components

- **R user**

## Connections

- R user → Fit model: fits model
- R user → Prediction: requests prediction
- R user → Plot model: plots model
- R user → Cross-validation: runs validation
- R user → SCC method: uses method
- R user → Data access: requests data
