Reference
TASC Estimation
TASC.StateSpaceParams — Type
StateSpaceParams(A, H, Q, R, m0, P0)Parameters for the linear Gaussian state-space model
x_t = A * x_{t-1} + q_t, q_t ~ N(0, Q)
y_t = H * x_t + r_t, r_t ~ N(0, R)where rows of Y are units and columns are time periods.
TASC.TASCResult — Type
TASCResultFitted Time-Aware Synthetic Control model. The treated unit is assumed to be the first row of the input matrix.
TASC.fit_tasc — Function
fit_tasc(Y; d, T0, n_em=100, n_post=0, tol=1e-4, q_diag=true, r_diag=true)Fit Time-Aware Synthetic Control on the pre-intervention columns 1:T0. Y must be an N x T matrix. By default, row 1 is treated and rows 2:N are donors. Post-intervention treated entries are ignored during counterfactual prediction. Pass treated_rows to mask multiple treated units after T0.
TASC.predict_counterfactual — Function
predict_counterfactual(model, Y)Use a fitted TASCResult to estimate the treated unit's untreated counterfactual path. The filter uses all units before T0; after T0, it uses only donor rows, then an RTS smoother borrows information across time.
Returns a named tuple with target, donors, variance, effect, state_mean, and state_covariance.
TASC.predict_post_intervention — Function
predict_post_intervention(model, Y)Forecast the treated path after T0 by propagating the smoothed state at T0 forward with A, without using post-intervention donor observations.
TASC.TASCPlot — Type
TASCPlotLightweight plotting wrapper for RecipesBase/Plots.jl. Construct with tasc_plot(model, Y) and render with plot(...) after loading Plots.
Preprocessing
Core helpers:
panel_matrix(data, T0; target = 1, donors = nothing)transform(M; method = :standard)inverse_transform(M)hsvt(X; rank = 2, p = 1.0)denoise(M; num_sv, p = 1.0, filter_method = :HSVT, do_transform = false)get_energy(s)get_approx_rank(s; threshold = 0.95)
Synthetic Control Baselines
Core helpers:
fit_synthetic_control(pre_donor, pre_target; method = :ols, lambda = nothing, fit_intercept = true)predict(model, donor)score(model, donor, target)predict_and_mse(model, donor, target_true)
Simulation
TASC.simulate_tasc — Function
simulate_tasc(; N=20, T=80, d=3, seed=1)Generate synthetic panel data from the TASC state-space model. Returns (Y, params, signal), where Y and signal are N x T.
Additional generators:
gen_A,gen_H,gen_cov, andgen_dirichlet_paramsgenerate_model_dataandgenerate_multiple_layersgenerate_rank_1_matrixandgenerate_rank_k_matrixgenerate_sine_wave,generate_linear_dataset,generate_new_sine_dataset,generate_sine_dataset_A, andgenerate_sine_dataset_Bmake_approx_low_rank