Time-varying parameter regression

TVP_REGRESSION(LIST(Y,X1,...,X8)[,focusIndex=1]) fits a joint Bayesian regression with random-walk coefficients. One response, 1 to 8 predictors. Focus 1 refers to X1. Compares varying vs constant focus slope by conditional log Bayes factor over four prior scales; the intercept and other slopes may vary under both hypotheses. Discrete variance-ratio priors are summed directly. X is standardized on the initial max(20,3*(predictors+1)) training rows. Require at least 10 additional rows and at most 4000 total. Align via getSameDateRange; require matching increasing dates and finite values. One transition per observation, including across calendar gaps. Default slideshow. EXTRACT beta returns all original-unit smoothed coefficient series. beta:J, chart:J, lower:J, upper:J select a coefficient (0=intercept, 1=X1,...). Other keys: evidence, summary, actual_vs_fitted, fitted, residuals, data, slideshow. Pointwise 90% credible limits condition on the varying model at prior mean 0.01. Smoothed fits use future observations.

Data=SERIES_BETWEEN(LIST(LOGDIFF(INDPRO),LOGDIFF(PAYEMS),UNRATE),20000101,20241231)
Fit=TVP_REGRESSION(Data,2)
Evidence=EXTRACT(Fit,"evidence")

For the unemployment slope use EXTRACT(Fit,"chart:2"). For a one-predictor baseline compare EXTRACT(TVP_REGRESSION(LIST(Y,X)),"beta:1") with ROLL_BETA(X,Y,40). In a multiple regression the slopes control for the other predictors.

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.