plot.postcp: Plot method for postCP.

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

Description

Plots results of postcp, plots observed data (if included in postcp output) and posterior probabilities.

Usage

1
2
3
4
5
## S3 method for class 'postcp'
plot(x, y=NULL, xlab = "index", ylab = "probability",
main = "Posterior Change Point Probability Distribution",
p.col = "blue", pch = 16, p.cex = NA, m.col = "brown",
m.lty = 2, m.lwd = 1, l.col = NA, l.lty = NA, l.lwd = NA, ...)

Arguments

x

Results of postCP, use as input for plot.postcp.

y

y coordinates for the default plot function. Defaults to NULL

xlab

Label for x-axis (see par).

ylab

Label for y-axis (see par).

main

Main title of plot (see par).

p.col

Colour of scatterplot of data (see par).

pch

Type of character of scatterplot (see par).

p.cex

cex parameter of scatterplot (see par).

m.col

Graphical option for colour of mean line (see par).

m.lty

Graphical option for type of mean line (see par).

m.lwd

Graphical option for width of mean line (see par).

l.col

Graphical option for colours of posterior probability lines, of length 1 for same colour for all lines or 1 for each line (see par).

l.lty

Graphical option for types of posterior probability lines, of length 1 for same colour for all lines or 1 for each line (see par).

l.lwd

Graphical option for widths of posterior probability lines, of length 1 for same colour for all lines or 1 for each line (see par).

...

Additional arguments.

Details

Package: postCP
Type: Package
Version: 1.8.0
Date: 2016-09-07
License: GPL (>= 2)
LazyLoad: yes

Value

out

List with limits of x and y-axis. May be useful for labelling.

Author(s)

Gregory Nuel, The Minh Luong and Malith Jayaweera

Maintainer: Who to complain to malithgsoc2016@gmail.com

References

Luong, T.M., Rozenholc, Y. & Nuel, G. (2012). Fast estimation of posterior probabilities in change-point models through a constrained hidden Markov model. http://arxiv.org/pdf/1203.4394

See Also

postcp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
require(postCP)
#prepare data
sigma=1.3
#Change point estimates
bp=c(7,10)
#Obtain data from longley dataset
data = longley
#Apply postcp function
res = postcp(Employed ~ GNP + Armed.Forces,family=gaussian(),data=data,bp=c(7,10),sigma)

#Plot the results
plot.postcp(res,main="Posterior Change Point Probability Distribution")

malithj/postCP documentation built on May 21, 2019, 11:22 a.m.