rdf: Regression in domain frequency

Description Usage Arguments Details Value References Examples

Description

Make a Band Spectrum Regression using the comun frequencies in cross-spectrum .

Usage

1
rdf(y,x)

Arguments

y

a Vector of the dependent variable

x

a Vector of the independent variable

Details

Transforms the time series in amplitude-frequency domain, order the fourier coefficient by the comun frequencies in cross-spectrum, make a band spectrum regresion (Parra, F. ,2013) of the serie y_t and x_t for every set of fourier coefficients, and select the model to pass the Durbin test in the significance chosen.

If not find significance for Band Spectrum Regression, make a OLS.

The generalized cross validation (gcv), is caluculated by: gcv=n*sse/((n-k)^2)

where "sse" is the residual sums of squares, "n" the observation, and k the coefficients used in the band spectrum regression.

Slow computer in time series higher 1000 data.

The output is a data.frame object.

Value

datos$Y

The Y time-serie

datos$X

The X time-serie

datos$F

The time - serie fitted

datos$reg

The error time-serie

Fregresores

The matrix of regressors choosen in frequency domain

Tregresores

The matrix of regressors choosen in time domain

Nregresores

The coefficient number of fourier chosen

sse

Residual sums of squares

gcv

Generalized Cross Validation

References

DURBIN, J., "Tests for Serial Correlation in Regression Analysis based on the Periodogram ofLeast-Squares Residuals," Biometrika, 56, (No. 1, 1969), 1-15.

Engle, Robert F. (1974), Band Spectrum Regression,International Economic Review 15,1-11.

Harvey, A.C. (1978), Linear Regression in the Frequency Domain, International Economic Review, 19, 507-512.

Parra, F. (2014), Amplitude time-frequency regression, (http://econometria.wordpress.com/2013/08/21/estimation-of-time-varying-regression-coefficients/)

Examples

1
2
3

Example output

Loading required package: taRifx
$datos
       Y         X        F        res
1  12458  65.72689 12438.74   19.26350
2  12822  67.48491 12909.66  -87.65586
3  13345  69.97484 13576.63 -231.63133
4  14288  72.98793 14383.75  -95.74524
5  15309  76.26133 15260.59   48.41183
6  16207  80.29488 16341.05 -134.05185
7  17290  83.50754 17201.62   88.37559
8  17805  85.91239 17845.81  -40.80958
9  19037  88.65090 18579.37  457.62803
10 19915  91.45826 19331.38  583.62284
11 20867  94.86328 20243.48  623.52297
12 21543  98.82299 21304.16  238.83875
13 21935 102.54758 22301.86 -366.86407
14 22253 103.69194 22608.40 -355.40283
15 21757  99.98619 21615.75  141.25334
16 22409 100.00000 21619.45  789.55406
17 20636  99.38237 21454.00 -818.00190
18 20663  97.30654 20897.95 -234.95105
19 19952  96.10971 20577.36 -625.35719

$Fregresores
    1           2
X1  1 88.15634053
X2  0 -5.68444051
X3  0 -9.44842574
X4  0 -2.21612456
X5  0 -2.62417102
X6  0 -0.79654010
X7  0 -2.39713050
X8  0 -1.53918705
X9  0 -1.43696347
X10 0 -1.18967332
X11 0 -0.69982435
X12 0 -0.92147295
X13 0 -0.82056751
X14 0 -1.14883279
X15 0 -0.66396550
X16 0 -1.26963280
X17 0 -0.21300734
X18 0 -1.09411248
X19 0 -0.01302282

$Tregresores
              1        2
 [1,] 0.2294157 15.07878
 [2,] 0.2294157 15.48210
 [3,] 0.2294157 16.05333
 [4,] 0.2294157 16.74458
 [5,] 0.2294157 17.49555
 [6,] 0.2294157 18.42091
 [7,] 0.2294157 19.15794
 [8,] 0.2294157 19.70965
 [9,] 0.2294157 20.33791
[10,] 0.2294157 20.98196
[11,] 0.2294157 21.76313
[12,] 0.2294157 22.67155
[13,] 0.2294157 23.52603
[14,] 0.2294157 23.78856
[15,] 0.2294157 22.93841
[16,] 0.2294157 22.94157
[17,] 0.2294157 22.79988
[18,] 0.2294157 22.32365
[19,] 0.2294157 22.04908

$Nregresores
[1] 2

descomponer documentation built on Aug. 12, 2021, 5:12 p.m.