change.normal: Changepoint Model with Normal Distribution

Description Usage Arguments Value Examples

Description

The changepoint model is used to test if there is a significant change in mean and/or variance of a variable (assumed to have normal distribution), over the course of some threshold, typically time or sequential order.

Usage

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

Arguments

v

A vector that contains response variable of interest.

pre

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

type

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

know.mean

(Valid only when type="Var") Boolean variable, i.e. TRUE or FALSE, indicating whether or not you wish to set a value for "true mean" of data; FALSE by default.

mu

(Valid only when type="Var" and know.mean=TRUE) Numerical value that represents the "true mean" of data; NA by default.

Value

List of the following:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

hollicam/DiscreteChoiceModels documentation built on May 3, 2019, 8:59 p.m.