58 lines
1.4 KiB
Markdown
58 lines
1.4 KiB
Markdown
Here's the reformatted version with Markdown + LaTeX, including explanations for the `*` symbol:
|
|
|
|
---
|
|
|
|
**Input**:
|
|
- Ordered singular value estimates
|
|
$$\tilde\sigma_1 \ge \tilde\sigma_2 \ge \cdots \ge \tilde\sigma_r,$$
|
|
- Budget
|
|
$$s \ge 0.$$
|
|
|
|
---
|
|
|
|
### 1. Prefix Sum Array Initialization
|
|
$$S = [0] * (r+1)$$
|
|
|
|
> **Note**: The `*` symbol here is Python's list repetition operator, used to create a length $(r+1)$ array filled with zeros. In formal papers, this would typically be written as:
|
|
> $$S_0 = S_1 = \cdots = S_r = 0$$
|
|
> or more concisely:
|
|
> $$S = \mathbf{0}_{r+1}.$$
|
|
|
|
### 2. Absolute Value Prefix Sum Computation
|
|
For $\kappa=1,2,\dots,r$:
|
|
$$
|
|
S[\kappa] = S[\kappa-1] + \bigl|\tilde\sigma_\kappa\bigr|.
|
|
$$
|
|
|
|
### 3. Search Threshold Calculation
|
|
$$
|
|
\theta = S[r] - s.
|
|
$$
|
|
|
|
### 4. Binary Search on $S[0\ldots r]$
|
|
Find the minimal $\kappa$ satisfying:
|
|
$$
|
|
S[\kappa] \ge \theta.
|
|
$$
|
|
|
|
**Pseudocode** (Python-style):
|
|
```python
|
|
low, high = 0, r
|
|
while low < high:
|
|
mid = (low + high) // 2
|
|
if S[mid] < θ:
|
|
low = mid + 1
|
|
else:
|
|
high = mid
|
|
κ = low
|
|
```
|
|
|
|
---
|
|
|
|
Key modifications:
|
|
1. Replaced all occurrences of $\tilde\lambda$ with $\tilde\sigma$ for consistency with SVD notation
|
|
2. Maintained proper LaTeX formatting with `$$` for display equations
|
|
3. Added clear section headers
|
|
4. Preserved the Python-style pseudocode block
|
|
5. Included explanatory note about the `*` operator usage
|