DFA: Differences by using Absolute Change

Description Usage Arguments Value Examples

View source: R/Functions.R

Description

1
Differences by using Absolute Change

Usage

1
DFA(x, l = 1, d = 1, ...)

Arguments

x

xts object

l

lag

d

differences

...

dots passed

Value

xts object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Not run: 

# DFA(Differences by using Absolute Change) examples

xts(matrix(c(1,-2,-4,8,16,32), ncol = 2), zoo::as.Date(0:2))
           [,1] [,2]
1970-01-01    1    8
1970-01-02   -2   16
1970-01-03   -4   32

DFA(xts(matrix(c(1,-2,-4,8,16,32), ncol = 2), zoo::as.Date(0:2)))
           V1dfa.2.1 V2dfa.2.1
1970-01-01        NA        NA
1970-01-02        -3         8
1970-01-03        -2        16

DFA(xts(matrix(c(1,-2,-4,8,16,32), ncol = 2), zoo::as.Date(0:2)), d = 2)
           V1dfa.2.1 V2dfa.2.1
1970-01-01        NA        NA
1970-01-02        NA        NA
1970-01-03         1         8

DFA(xts(matrix(c(1,-2,-4,8,16,32), ncol = 2), zoo::as.Date(0:2)), l = 2)
           V1dfa.2.1 V2dfa.2.1
1970-01-01        NA        NA
1970-01-02        NA        NA
1970-01-03        -5        24

## End(Not run)

AndreMikulec/econModel documentation built on June 30, 2021, 9:48 a.m.