plotComT: Plot the common trend(s)

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plotComT.R

Description

Plot the common trends and compare them with the original series.

Usage

1
2
3
plotComT(ComT, i, x.axis = NA, 
         approx.ticks = 7, legend = c("Original Data", "Common Trend"), 
         main = "", ylab = "", xlab = "")

Arguments

ComT

A class of ComT

i

The ith orginal series and its common trends you want to plot. Must be equal or less than the dimention of cointegration system. See Details.

x.axis

The vector used as the x-axis. Its length must be equal to the length of original series.

approx.ticks

The number of ticks on the x-axis. If NULL, then 7 is used.

legend

A vector with two characters. The first one is the legend for original series; the second one is that for its common trends.

main

Character. The main title of the graph.

ylab

Character. The title of y-axis.

xlab

Character. The title of x-axis.

Details

This function will plot the ith original series and its estimated common trend in one graph. The estimated trend plotted here is based on ComT$common.trend[i,], wchih is the ComT$pure.trend multiplied its corresonding loading weight in ComT$loading.vector. To better fit the original series, we add the mean of its corresponding estimated stationary process onto the common trends.

Note that if more than one common trends (Pure trends without multiplying loading vector) are identified in the cointegration system, then this function will plot the weighted sum of those pure trends.

Value

A graph of ith original series and its estimated common trend.

Author(s)

Fan Yang

See Also

ComT-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(benchmark)
x=seq(1,6689,by=23) ## monthly data
global=data.frame(benchmark[x,2:4])
Date=benchmark[x,1]
 
G=GG.ComT (global,2,4)

## only the first two arguments in this function are compulsory.

plotComT(G,1) 

## The complete set of arguments
 
plotComT(G,1,x.axis=Date,approx.ticks=12,
         legend=c("S&P 500 Price index", "Common Trend"),
         main="Extract Common Trend(s) from Benchmark Markets according to GG",
         ylab="Price", xlab="Time"  )
 

Fan-Yang-Econ/CommonTrend documentation built on May 6, 2019, 4:09 p.m.