spread_likelihood: Spread a likelihood vector across time with a chosen temporal pattern
Description
Expands a sectoral likelihood \(L\) (length \(K\)) into a \(T \times K\)
matrix by applying a temporal weight profile and then row-normalizing to the
simplex.
Numeric matrix \(T \times K\); each row sums to 1.
Arguments
L
Numeric vector (length \(K\)); sectoral likelihood. It is normalized
internally to sum to 1 before spreading.
T_periods
Integer; number of time periods \(T\).
pattern
Temporal pattern for the weights across time; one of
"constant", "recent", "linear", "bell".
Details
Given \(L\) and a non-negative time-weight vector \(w_t\), the function
replicates \(L\) across rows and applies \(w\) elementwise, then
row-normalizes using row_norm1():
$$LT_{t,k} \propto w_t \cdot L_k, \qquad \sum_k LT_{t,k} = 1 \ \forall t.$$
Patterns:
"constant": \(w_t = 1\).
"recent": linearly increasing in \(t\) (more weight to later periods).
"linear": affine ramp from first to last period.
"bell": symmetric bell-shaped profile centered at \(T/2\).