RainbowStats™ · Optimization commands

LP_ADD_PERIOD_EQUATION

Add period-specific constraints to an LP regression.

Syntax

LP_ADD_PERIOD_EQUATION(regressionOrList,"equation",startDate,endDate)
LP_ADD_PERIOD_EQUATION(regressionOrList,"equation","policyType")

Example

R=LP_ADD_PERIOD_EQUATION(LIST(Y,X),"Intercept>=0",20200101,20201231)
EXTRACT(R,"model")

Details

An existing LPRegression is reused, or a DataList is wrapped as a new LPRegression. Four arguments use numeric YYYYMMDD endpoints. Three arguments obtain adjacent event windows from AnnotationHelper.getPolicyChanges(policyType), for example taxes or tariffs. Returns the regression. The legacy handler ignores the text status from addPeriodEquation; inspect the regression output to confirm a valid constraint. Windows follow the existing inclusive-date implementation.

Available extracts

Save the command result in a variable, then use EXTRACT(result, "key"). Availability can depend on the input form and fitted model.

In indexed patterns such as beta:n, replace n with the required index.