---
title: "FSSA"
author: "Mehdi Maadooliat"
date: "May 26, 2019"
output: html_document
runtime: shiny
---

# Options and Parameters defined in the Side Bar Panel
Contains the inputs that will be used in different `sub-panels`. The following inputs will be used in sub-panels **Basis Functions** (to generate the basis functions), **Data Description** (for Smoothing, FPCA, SSA and FSSA), and **Forecasting**:

* [Degree](https://en.wikipedia.org/wiki/Degree_of_a_polynomial) of B-spline Basis  
* [Deg. of freedom](https://en.wikipedia.org/wiki/Degrees_of_freedom) of B-spline or Fourier Basis  
* [Groups](https://en.wikipedia.org/w/index.php?title=Singular_spectrum_analysis#Main_algorithm_of_SSA): 3rd step of the SSA(FSSA) algorithm:
    + Each group is specified via a vector (e.g. 'c(1,2,4)' or '1:3') and seperated from other groups via comma (',')
* **d** is the dimensions used in FPCA, SSA and FSSA (Scree, W.Correlation, Paired, Singular Vectors & Functions, and Periodogram Plots)
* **Functions**
    + Demean: Subtract the *mean* to obtain mean-zero functions
    + Dbl Range: extending the y-axis to cover all potential mirrord functions (e.g. sometime FPCs may get multiply by a '-' sign)
* [Win.L.](https://en.wikipedia.org/w/index.php?title=Singular_spectrum_analysis#Basic_SSA): Window length parameter used in *SSA* and *FSSA*
* **run (F)SSA** button is used to run SSA and FSSA using the specified parameters for the given dataset.
The top inputs (above red line) are mostly to describe the *basis functions*. The bottom inputs (below red line) are used to specify *SSA* and *FSSA* parameters.

For more details on the option and parameters we refer the readers to the References given in the end of the page.

# Options in the Main Panel
## 1. Input Data
One can either use the files posted in Server

* *Callcenter*: used in the *FSSA paper (package)*
* *NDVI* and *EVI*: Jambi Sattelite data used in the *FSSA paper (package)*

or simulate FTS (see *FSSA* paper for more details),

or upload any FTS to be analyzed.

## 2. Basis Functions
* Using a visualization technique, we illustrate the B-spline (or Fourier) basis that is used in the algorithm.

## 3. Data Analysis
**Summary** of the data:

* Functional Time Series: Provide a variety of visualizations to describe the data.
  + _Plot Choices_:
    + _All_: Cobmines all _FTS_
    + _Multiple_: Combine _FTS_ at different _Period(frequency)_ together and the combined _clusters_ can be tracked by the end user
    + _Single_: Track _FTS_ individually
  + _Plots_:
    + _Time Series (Raw Data)_: provides the observed _FTS_
    + _True Functions_: provides the TRUE _FTS_ (in the case of simulation)
    + _Functional SSA_: provides _FSSA_ results from the _Rfssa_ package
    + _Multivariate SSA_: provides _MSSA_ results from the _Rssa_ package
    + _Functional PCA_: provides _FPCA_ results from the _fda_ package
    + _Basis Functions_: embeds the basis functions on top of _FTS_
    + _Smoothing_: provides the results of smoothing via basis functions
* How many basis? (GCV): provides the optimal number of basis based on _GCV_ criteria.

In this panel we can also select plots (outputs) under **SSA** and **FSSA**:

* _Scree_ plot: based on the _trajectory_ matrix
* _W.Correlation_ plot: w-correlation plot
* _Paired_ plots
* _Singular Vectors_ plots
* _Periodogram_ plots
* _Singular Functions_ (Heat or Regular plots)
* _Reconstruction_ of FTS using different _Type_ of plots (Heat, Regular, 3D(line) and 3D(surface))

## 4. Forecasting
This sub-panel would be accessible after user runs the **FSSA** procedure, and it includes the functionalities of _R-forecasting_ and _V-forecasting algorithms_.

## 5. Manual
The sub-panel that contains this _instruction manual_.

# References
- Haghbin, H., Najibi, S. M., Mahmoudvand, R., Trinka, J., Maadooliat, M. (2021). Functional singular spectrum analysis. Stat, 10(1), e330.
- Trinka J. (2021) Functional Singular Spectrum Analysis: Nonparametric Decomposition and Forecasting Approaches for Functional Time Series [Doctoral dissertation, Marquette University]. ProQuest Dissertations Publishing.
- Trinka, J., Haghbin, H.,  Maadooliat, M. (2022). Multivariate Functional Singular Spectrum Analysis: A Nonparametric Approach for Analyzing Multivariate Functional Time Series. In Innovations in Multivariate Statistical Modeling: Navigating Theoretical and Multidisciplinary Domains (pp. 187-221). Cham: Springer International Publishing.
- Trinka, J., Haghbin, H., Shang, H., Maadooliat, M. (2023). Functional Time Series Forecasting: Functional Singular Spectrum Analysis Approaches. Stat, e621.

