MCPcopy Create free account
hub / github.com/apache/madlib / diff_coef

Function diff_coef

src/modules/tsa/arima.cpp:117–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115// ----------------------------------------------------------------------
116
117static int * diff_coef (int d)
118{
119 int * coef = new int[d + 1];
120 coef[0] = 1, coef[1] = -1;
121 for(int i = 2; i <= d; i++)
122 coef[i] = 0;
123
124 for (int i = 1; i < d; i++) {
125 coef[1 + i] = - coef[i];
126 for(int j = i; j >= 1; j--)
127 coef[j] = coef[j] - coef[j - 1];
128 }
129
130 return coef;
131}
132
133// ----------------------------------------------------------------------
134

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected