data_generator: Data Generator

Description Usage Arguments Value Examples

View source: R/data_generator.R

Description

Created by Vincent Runge. Generating data with a given model = changepoint relative positions + parameters + type of cost

Usage

1
data_generator(n, chpts = NULL, means = 0, sd = 1, type = "gauss")

Arguments

n

number of data points to generate

chpts

vector of position of the changepoints in (0,n] (last element is always n).

means

vector of means of the data

sd

a positive number = the standard deviation of the data

type

a string defining the cost model to use: "mean", "variance", "gauss", "poisson"

Value

a vector of size n generated by the chosen model

Examples

1
2
3
data_generator(100)
data_generator(20, chpts = c(10), means = c(0,10), type = "gauss")
data_generator(25, chpts = c(10,20), means = c(2,0,1), type = "gauss")

Qrtsaad/CHANGEPOINT documentation built on Dec. 18, 2021, 8:42 a.m.