I am currently working on a project to determine how strongly the sample size determining one time series affects another (fixed) one.
rsquaredjpn[s_] := LinearModelFit[Partition[Flatten[Riffle[regressionlistjpn[s], jpngdp]], 2], x, x]["RSquared"]
plotjpn = ListLinePlot[Table[{s, rsquaredjpn[t]}, {s, 1, 100}], PlotRange -> All, AxesLabel -> {"K", "\!\(\*SuperscriptBox[\(R\), \(2\)]\)"}]
The list "jpngdp" as the dependent variables consists of 35 fixed values, while "regressionlistjpn[s]" delivers 35 values depending on s, the sample size. The end result is the plot "plotjpn", where K denotes the sample size on the x-axis and R^2 denotes the resulting R^2 values for every individual regression based on the sample size that generated regressionlistjpn[s] ranging from a size of 1 to 100.
Now, I would like to included lagged terms in the regression such that the specification states that jpngdp at t is not only dependent on the value of regressionlistjpn at t, but also at t-1 (and maybe t-2, ...). Here in the forum as well as in the Mathematica documentation, I could not find anything to help me with this.
So, my question would be how to specify above linear regression to also include lagged terms as the independent variables.
Help would be greatly appreciated!