Skip to main content
. 2024 Feb 25;12(3):177. doi: 10.3390/toxics12030177
Algorithm 1. The algorithm for the data series interpolation using STK has the following stages
  • 0.

    Input: Raw dataset

  • 1.
    Perform Exploratory Data Analysis (EDA) on raw dataset
    1. Visual inspections: Box plot, Histogram
    2. Performs the K-S and K-W tests
  • 2.

    Assess EDA Results: IF the dataset passes normality and homoscedasticity tests, THEN GOTO Step 3, ELSE, GOTO Step 6.

  • 3.

    Perform LOOCV for STK

  • 4.
    Back-transformation of Predicted Data:
    1. Predict the trend for each data point (if data was detrended in Steps 7 or 8)
    2. Apply the correction factor and reverse any log transformations
  • 5.

    Calculate Error Metrics: MAE, RMSE, and MAPE

    END Algorithm

  • 6.
    Data Transformation (IF needed after Step 2)
    1. Apply log10 transformation to the data
    2. GOTO Step 1 (Reapply EDA)
  • 7.
    Simple Linear Detrending (IF Step 6 fails to normalize data)
    1. Detrend data using a simple linear model with the ‘lm()’ function
    2. GOTO Step 1 (Reapply EDA)
  • 8.
    Complex Model Detrending (IF Step 7 fails to normalize data)
    1. Detrend data using complex models like GAMM and LME
    2. GOTO Step 1 (Reapply EDA)