sidLTVdiscTune¶
Python equivalent:
sid.ltv_disc_tune
Lambda tuning for sidLTVdisc (validation or frequency-based).
VALIDATION METHOD (requires held-out state data):
[bestResult, bestLambda, allLosses] = sidLTVdiscTune(X_train, U_train, ... X_val, U_val, 'Method', 'validation', ...)
FREQUENCY METHOD (no validation data needed):
[bestResult, bestLambda, info] = sidLTVdiscTune(X, U, ... 'Method', 'frequency', ...)
The frequency method compares the COSMIC frozen transfer function against a non-parametric sidFreqMap estimate using Mahalanobis-like consistency scoring. It selects the largest lambda where the two estimates agree statistically at most (omega, t) grid points.
Inputs¶
| Name | Description |
|---|---|
| Validation method: | |
X_train |
Training state data, (N+1 x p x L_train) |
U_train |
Training input data, (N x q x L_train) |
X_val |
Validation state data, (N+1 x p x L_val) |
U_val |
Validation input data, (N x q x L_val) Frequency method: |
X |
State data, (N+1 x p x L) or cell array |
U |
Input data, (N x q x L) or cell array NAME-VALUE OPTIONS (both methods): |
'Method' |
'validation' (default) or 'frequency'. |
'LambdaGrid' |
Vector of candidate lambda values. Default: logspace(0, 10, 25) (frequency), logspace(-3, 15, 50) (validation). |
'Precondition' |
Passed through to sidLTVdisc. Default: false. |
'Algorithm' |
Passed through to sidLTVdisc. Default: 'cosmic'. |
Frequency method options¶
| Name | Description |
|---|---|
'SegmentLength' |
Outer segment length for sidFreqMap. Default: min(floor(N/4), 256). |
'ConsistencyThreshold' |
Fraction of grid points required to be consistent. Default: 0.90. |
'CoherenceThreshold' |
Minimum coherence for a grid point to be included. Default: 0.3. |
Outputs¶
| Name | Description |
|---|---|
bestResult |
sidLTVdisc result struct at optimal lambda. |
bestLambda |
Optimal scalar lambda value. |
thirdOut |
For 'validation': (nGrid x 1) trajectory RMSE per lambda. For 'frequency': info struct with fields: .lambdaGrid, .fractions, .bestFraction, .freqMapResult |
Examples¶
% Frequency-based (no validation data)
[best, lam, info] = sidLTVdiscTune(X, U, 'Method', 'frequency');
References¶
Carvalho et al., "COSMIC", arXiv:2112.04355, 2022. Ljung, L. "System Identification", 2nd ed., Prentice Hall, 1999.
Specification¶
SPEC.md §8.4 — Lambda Selection SPEC.md §8.11 — Lambda Tuning via Frequency Response
See also¶
sidLTVdisc, sidLTVdiscFrozen, sidFreqMap
Changelog¶
- 2026-03-29: First version by Pedro Lourenço.