Truncated SVD estimation#

class EarlyStopping.TruncatedSVD(design, response, true_signal=None, true_noise_level=None, diagonal=False)#

[Source] A class to perform estimation using truncated SVD estimation.

Parameters

design: array. Design matrix of the linear model. ( \(A \in \mathbb{R}^{D \times p}\) ).

response: array. n-dim vector of the observed data in the linear model. ( \(Y \in \mathbb{R}^{n}\) ).

true_signal: array, default = None. p-dim vector of the true signal. For simulation purposes only. For simulated data, the true signal can be included to compute theoretical quantities such as the bias and the MSE alongside the iterative procedure. ( \(f \in \mathbb{R}^{p}\) ).

true_noise_level: float, default = None For simulation purposes only. Corresponds to the standard deviation of normally distributed noise contributing to the response variable. Allows the analytic computation of the strong and weak variance. ( \(\delta \geq 0\) ).

diagonal: bool, default = False The user may set this to true if the design matrix is diagonal with strictly positive singular values to avoid unnecessary computation in the diagonal sequence space model. # 2024-10-14, Bernhard: Checked docu of the parameters.

Attributes

iteration: int. Current iteration of the algorithm ( \(m \in \mathbb{N}\) )

sample_size: int. Sample size of the linear model ( \(D \in \mathbb{N}\) )

parameter_size: int. Parameter size of the linear model ( \(p \in \mathbb{N}\) )

residuals: array. Lists the sequence of the squared residuals between the observed data and the estimator.

weak_bias2: array. Only exists if true_signal was given. Lists the values of the weak squared bias up to the current iteration.

weak_variance: array. Only exists if true_signal was given. Lists the values of the weak variance up to the current iteration.

# TODO: Strong quantities

Methods

iterate(number_of_iterations=1)

Performs a specified number of iterations of the Landweber algorithm.

get_estimate(iteration)

Returns the truncated SVD estimator at iteration.

get_discrepancy_stop(critical_value, max_iteration)

Returns the early stopping index according to the discrepancy principle.

get_aic(max_iteration, K=2)

Returns the iteration chosen by the Akaike information criterion.

get_weak_balanced_oracle(max_iteration)

Returns the weak balanced oracle if found up to max_iteration.

get_strong_balanced_oracle(max_iteration)

Returns the strong balanced oracle if found up to max_iteration.

TruncatedSVD.iterate(number_of_iterations)#

Performs number_of_iterations iterations of the algorithm

Parameters

number_of_iterations: int. The number of iterations to perform.

TruncatedSVD.get_estimate(iteration)#

Returns the truncated SVD estimate at iteration.

Parameters

iteration: int. The iteration at which the estimate is requested.

Returns

truncated_svd_estimate: ndarray. The truncated svd estimate at iteration.

TruncatedSVD.get_discrepancy_stop(critical_value, max_iteration)#

Returns early stopping index based on discrepancy principle up to max_iteration.

Parameters

critical_value: float. The critical value for the discrepancy principle. The algorithm stops when :math: Vert Y - A hat{f}^{(m)} Vert^{2} leq kappa^{2}, where :math: kappa is the critical value.

max_iteration: int. The maximum number of total iterations to be considered.

Returns

early_stopping_index: int. The first iteration at which the discrepancy principle is satisfied. (None is returned if the stopping index is not found.)

TruncatedSVD.get_aic(max_iteration, K=2)#

Returns the iteration chosen by the Akaike information criterion computed up max_iteration.

Parameters

K: float. Constant in the definition of the AIC.

max_iteration: int. The maximum number of total iterations to be considered.

Returns

aic_index: int. Minimiser of the AIC criterion.

TruncatedSVD.get_weak_balanced_oracle(max_iteration)#

Returns weak balanced oracle if found up to max_iteration.

Parameters

max_iteration: int. The maximum number of total iterations to be considered.

Returns

weak_balanced_oracle: int. The first iteration at which the weak bias is smaller than the weak variance.

TruncatedSVD.get_strong_balanced_oracle(max_iteration)#

Returns strong balanced oracle if found up to max_iteration.

Parameters

max_iteration: int. The maximum number of total iterations to be considered.

Returns

strong_balanced_oracle: int. The first iteration at which the strong bias is smaller than the strong variance.