[go: up one dir, main page]

File: Rcode-8-11.R

package info (click to toggle)
urca 1.3-3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,432 kB
  • sloc: fortran: 501; ansic: 15; makefile: 2
file content (29 lines) | stat: -rwxr-xr-x 907 bytes parent folder | download | duplicates (7)
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
Canada <- Canada[, c("prod", "e", "U", "rw")]
p1ct <- VAR(Canada, p = 1, type = "both")
p2ct <- VAR(Canada, p = 2, type = "both")
p3ct <- VAR(Canada, p = 3, type = "both")
## Serial
serial.test(p3ct, lags.pt = 16,
            type = "PT.asymptotic")
serial.test(p2ct, lags.pt = 16,
            type = "PT.asymptotic")
serial.test(p1ct, lags.pt = 16,
            type = "PT.asymptotic")
serial.test(p3ct, lags.pt = 16,
            type = "PT.adjusted")
serial.test(p2ct, lags.pt = 16,
            type = "PT.adjusted")
serial.test(p1ct, lags.pt = 16,
            type = "PT.adjusted")
## JB
normality.test(p3ct)
normality.test(p2ct)
normality.test(p1ct)
## ARCH
arch.test(p3ct, lags.multi = 5)
arch.test(p2ct, lags.multi = 5)
arch.test(p1ct, lags.multi = 5)
## Stability (Recursive CUSUM)
plot(stability(p3ct), nc = 2)
plot(stability(p2ct), nc = 2)
plot(stability(p1ct), nc = 2)