HAVOK Analysis for Chaotic Time Series: A MATLAB Implementation
function simulated_time_series = HAVOK_analysis(x, r, L, S) % HAVOK analysis for chaotic time series % Inputs: % x: The 1-dimensional chaotic time series % r: Number of components (eigen time series) to consider % L: Segment length for forming Hankel matrix % S: Step size for forming Hankel matrix % Outputs: % simulated_time_series: The simulated time series using HAVOK \ \N = length(x); \ % Step 1: Create Hankel Matrix H \numSegments = floor((N - L) / S) + 1; \H = zeros(L, numSegments); \for i = 1:numSegments \ H(:, i) = x(i:i+L-1); \end \ % Step 2: Perform SVD on H [U, ~, ~] = svd(H, 'econ'); \ % Step 3: Choose the first 'r-1' components \v = U(:, 1:r-1); \ % Step 4: Form Delay Coordinates and Linear Regression \V_shifted = v(2:end, :); \V_fit = [ones(size(V_shifted, 1), 1), v(1:end-1, :)]; \coeffs = V_fit \ V_shifted; \ % Step 5: Stochastic Input for the Last Coordinate \vr = randn(numSegments-1, 1); % Assuming a Gaussian white noise input \ % Step 6: Simulate the Model \simulated_time_series = zeros(N, 1); \simulated_time_series(1:r-1) = x(1:r-1); % Initial conditions \for i = r:N \ simulated_time_series(i) = [1, simulated_time_series(i-r+1:i-1)'] * coeffs + vr(i-r+1); \end \end \ \This function is an implementation of Hankel matrix singular value decomposition (HAVOK) analysis for chaotic time series, based on the HO-Kalman method. HAVOK is a method for analyzing chaotic time series that uses delayed coordinate reconstruction and linear regression to simulate the time series. \ \The steps involved are: \1. Create Hankel matrix H: The input chaotic time series x is divided into segments of length L, with a step size of S, to form the Hankel matrix H. \2. Perform SVD on H: The left singular vector matrix U is obtained by performing singular value decomposition (SVD) on H. \3. Choose the first r-1 singular vectors: The first r-1 columns of U are selected as the principal components of the model. \4. Delayed coordinates and linear regression: The principal component vectors are shifted backward by one step to form V_shifted. The principal component vectors and a constant term are combined to form V_fit. Linear regression is performed to estimate the linear relationship between V_fit and V_shifted, obtaining the linear regression coefficients coeffs. \5. Add stochastic input for the last coordinate: A Gaussian white noise input vr is assumed. \6. Simulate the model: The simulated time series simulated_time_series is generated step-by-step, based on the linear relationship of the model and the stochastic input. \ \This method borrows the idea of delayed coordinate reconstruction and linear regression from the HO-Kalman method, but the implementation may differ.
原文地址: https://www.cveoy.top/t/topic/p1Yu 著作权归作者所有。请勿转载和采集!