plot_transition: Plot the transition function of the estimated PSTR model.

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

Description

This function plots the transition function of the estimated PSTR model.

Usage

1
2
plot_transition(obj, size = 1.5, color = "blue", xlim = NULL,
  ylim = NULL, fill = NULL, alpha = NULL)

Arguments

obj

an object of the class PSTR returned from some functions in the package. Note that the corresponding PSTR model must be estimated first.

size

the size of the circle.

color

the color of the circle.

xlim

a numeric vector of dimension 2 specifying the limits of x-axis.

ylim

a numeric vector of dimension 2 specifying the limits of y-axis.

fill

the color used to fill the area on the transition curve with observations, NULL for not fill, see ggplot2.

alpha

a number controlling the transparency of the points and filled area, NULL for default, see ggplot2.

Details

The funciton uses some functions in the ggplot2 package and aims to give a quick plot of the transtion function. The user can customize the title, subtitle, caption, x and y labels, for details, read the help file for the labs function in ggplot2.

Value

A ggplot object. The user can plot it simply by print the object.

Author(s)

Yukai Yang, yukai.yang@statistik.uu.se

See Also

Functions which return an object of the class PSTR and can be input into this function

EstPSTR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
pstr = NewPSTR(Hansen99, dep='inva', indep=4:20, indep_k=c('vala','debta','cfa','sales'),
    tvars=c('vala'), iT=14) # create a new PSTR object

# estimate the PSTR model
pstr = EstPSTR(use=pstr, im=1, iq=1, useDelta=TRUE, par=c(.63,0), method='CG')

# plot the transition function

ret = plot_transition(pstr)
# plot by running
ret

ret = plot_transition(pstr, fill='blue', xlim=c(-2,20), color = "dodgerblue4", size = 2, alpha=.3)
ret

PSTR documentation built on June 4, 2019, 1:03 a.m.