public void Deseasonality(ref double[] values, int period, ref double[] results) { bool success = _stl.Decomposition(values, period); if (success) { for (int i = 0; i < _stl.Residual.Count; ++i) { results[i] = _stl.Residual[i]; } } // invoke the back up deseasonality method if stl decompose fails. else { _backupFunc.Deseasonality(ref values, period, ref results); } }
public void Deseasonality(ref double[] values, int period, ref double[] results) { bool success = _stl.Decomposition(values, period); if (success) { for (int i = 0; i < _stl.Residual.Count; ++i) { results[i] = _stl.Residual[i]; } } else { for (int i = 0; i < values.Length; ++i) { results[i] = values[i]; } } }