Shiftmap
Purpose
Calculates Shift Invariant Tri-linear factor matrix
Synopsis
- [z,r,a,xsit,p,a0,t] = shiftmap(x,options); % calibration step
- [z,r,a,xsit] = shiftmap(x,p); % prediction for SIT
- [z,r,a,xsit] = shiftmap(x,p,a0); % prediction for SIST
Description
SHIFTMAP Calculates Shift Invariant Tri-linear factor matrix Calculates Shift Invariant Tri-linear factor matrices (xsit) and (xsist) for the columns of MxN input (x). SHIFTMAP also returns z = fft(x), r = |fft(x)| and phase spectra (a). The FFTs are zero padded to Np = max(2^nextpow2(M),options.np).
For K = options.ncomp (number of PCs), the outputs (xsit) and (xsist) are defined as follows.
- xsit = Shift Invariant Trilinearity based on |FFT(x)|' = T*P' where T (NxK), P (NpxK), and q = sum((|FFT(x)|' - T*P').^2,2).
- xsist = Shift Invariant Soft Trilinearity based on iFFT(|FFT(x)|*diag(A))' = Tb*Pb' where Tb (NxK), Pb (NpxK), and qb = sum((|FFT(x)|' - T*P').^2,2). The matrix A = a(I) where [~,I] = min(qb).
(xsit) and (xsist) are truncated to MxN matrices prior to output.
During prediction, it is expected that size(x,1) = M of the calibration data. However, shiftmap outputs (xsit) as long as size(x,1)<=Np and size(xsit,1) will equal size(x,1). See:
- Schneide, P.-A., Bro, R., Gallagher, N., "Shift-invariant tri-linearity (SIT) - A new model for resolving untargeted GC-MS data," J Chemom (2023).
- Schneide, P.-A., Bro, R., Gallagher, N., "Soft shift-invariant tri-linearity: modelling shifts and shape changes in gas-chromatography coupled mass spectrometry," [in progress] (2023).
Inputs
- x = MxN matrix of columns (e.g., elution profiles)
- p = NpxK loadings matrix for SIT or SIST (see ALS_SIT output model field shiftmodel)
- a0 = NpxK standard phase spectrum for SIST (see ALS_SIT output model field shiftmodel)
Outputs
- z = fft(x)
- r = |fft(x)|
- a = phase spectra
- xsit = |FFT(x)|' = T*P' truncated to MxN, where K = options.ncomp (number of PCs), the outputs (xsit) and (xsist) are defined above.
- p = NpxK loadings for PCA model of |FFT(x)|'
- a0 = NpxK standard phase spectrum for SIST
- t = MpxK scores for for PCA model of |FFT(x)|'
Options
options = a structure array with the following fields:
- p = If (p) is not input or is empty, then shiftmap calibrates PCA NxK loadings: p = P for SIT and p = Pb for SITS.
- If input (p) corresponds to a loadings matrix it is used in prediction.
- np = nonnegative scalar length of padding for FFT, Np.
- If options.np is empty {default} then Np is set to Np = 2^nextpow2(M).
- If not empty, then Np is set to
Np = max(2.^nextpow2(M),2.^options.np).
- ncomp = 1 {default} %Number of PCs, K, for SIT and SIST.
- algorithm = [{'sit'} | 'sist'];