APC: Absolute Proportional Change

Description Usage Arguments Value Examples

View source: R/Functions.R

Description

1
2
3
4
5
6
7
This is most useful for calculating velocity
and acceleration, (and jerk).
To get acceleration and jerk use this with
diffXts with differences 2 (and 3) respectively.

Ninety-nine (99
SHOULD HAVE BEEN using this one.

Usage

1
APC(x, b = 0, l = 1, ...)

Arguments

x

xts object

b

choose -1 (or less) to look into the future

l

observations backwards

...

dots passed

Value

xts object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

# APC(Absolute Proportional Change) example

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

APC(xts(matrix(c(1,-2,-4,8,16,32), ncol = 2), zoo::as.Date(0:2)))
           V1apc.0.1 V2apc.0.1
1970-01-01        NA        NA
1970-01-02        -3         1
1970-01-03        -1         1

## End(Not run)

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