ema_alpha_opt: Optimal alpha for SES This function finds the optimal smoothing parameter alpha for Simple Exponential Smoothing. It complements gretls native movavg()) function, which already performs SES but requires alpha as input. The optimal alpha is found by minimizing the sum of squared one-step forecast errors (excluding the first observation). Usage scalar alpha = ema_alpha_opt (y) series smooth = movavg (y,alpha) Returns the optimal alpha in (0,1) Note: Similar functionality for SES exists in the fcModels package (autoSES function), which prints the optimal alpha. This package differs by returning the optimal alpha as scalar for further use with movavg(). It also respects sub-sampled datasets