change.normal: Changepoint Model with Normal Distribution

Description Usage Arguments Value Examples

Description

Fit changepoint model on data to test if there is a significant change in mean and/or variance of data.

Usage

1
change.normal(v, pre = NA, type = "MeanVar", know.mean = FALSE, mu = NA)

Arguments

v

Vector that contains response variable of interest.

pre

A value represents preselected changepoint for any model, should the user wish to test a specific point in data; NA by default.

type

Choose between "Mean", "Var", and "MeanVar", regarding the parameter(s) for which you wish to test significant change in value; "MeanVar" by default.

know.mean

If type="Var", Boolean variable indicating whether or not you wish to set value for "true mean" of data; FALSE by default.

mu

If know.mean = TRUE, single value that represents "true mean" of data; NA by default.

Value

List of the following: Table that contains location of changepoint(s) (either preselected or determined rigorously) ranked by significance and its/their associated significance value(s); Single value representing the MBIC threshold by which to base significance of a changepoint (i.e., penalty values LARGER than MBIC threshold indicate significance)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
a = rnorm(100,0,25/100)
b = rep(0,100)
for (i in 1:100) {
  b[i] = rnorm(1,0,(i/2+25)/100)
}
c = rnorm(100,0,75/100)
d = rep(0,100)
for (i in 1:100)
  d[i] = rnorm(1,0,(75-i/2)/100)
e = rnorm(100,0,25/100)
v = c(a,b,c,d,e)

change.normal(v, type="Var", know.mean=TRUE, mu=0)
change.normal(v, type="Var", know.mean=TRUE, mu=0, pre=200)

tinyleap/LatentStage documentation built on May 12, 2019, 4:27 p.m.