File: xmpDWChapter044.R

package info (click to toggle)
fmultivar 240.10068-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,492 kB
  • ctags: 272
  • sloc: fortran: 1,128; ansic: 764; sh: 22; makefile: 1
file content (55 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# Examples from the forthcoming Monograph:
#   Rmetrics - Financial Engineering and Computational Finance
#   written by Diethelm Wuertz
#   ISBN to be published
#
# Details:
#   Chapter 4.4
#   Vector ARMA Models and Cointegration
#
# List of Examples, Exercises and Code Snippets:
#    
#   Example: Phillips-Ouliaris Test, Non-Cointegrated Case
#   Example: Phillips-Ouliaris Test: Cointegrated Case
#
#   *** This list is not yet complete ***
#
# Author:
#   (C) 2002-2005, Diethelm Wuertz, GPL
#     www.rmetrics.org
#     www.itp.phys.ethz.ch
#     www.finance.ch
#


################################################################################
    

### Example: Phillips-Ouliaris Test,  Non-Cointegrated Case

    # Create Series:
    x = ts(diffinv(matrix(rnorm(2000), 1000, 2)))
    
    # Test:
    tspoTest(x)
    ###
    

# ------------------------------------------------------------------------------
    
    
### Example: Phillips-Ouliaris Test: Cointegrated Case

    # Create Series:
    x = diffinv(rnorm(1000))
    y = 2.0 - 3.0*x + rnorm(x, sd = 5)
    z = ts(cbind(x, y))
    
    # Test:
    tspoTest(z)
    ###
    
    
################################################################################