plrs.sim: Simulation of a plrs model

Description Usage Arguments Details Author(s) Examples

View source: R/plrs.sim.r

Description

Simulation of a piecewise relationship.

The function has been only implemented for convenience of simulations and R examples.

Usage

1
plrs.sim(n = 80, states = 4, sigma = 01, x = NULL)

Arguments

n

Number of simulated data points

states

Number of states for the model

sigma

Noise

x

Segmented values.

Details

To be written...

Author(s)

Gwenael G.R. Leday g.g.r.leday@vu.nl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Simulate 1-state model
sim <- plrs.sim(n=80, states=1, sigma=0.5)
model <- plrs(expr=sim$expr, cghseg=sim$seg, cghcall=sim$cal)
plot(model)

# Simulate 2-state model
sim <- plrs.sim(n=80, states=2, sigma=0.5)
model <- plrs(expr=sim$expr, cghseg=sim$seg, cghcall=sim$cal)
plot(model)

# Simulate 3-state model
sim <- plrs.sim(n=90, states=3, sigma=0.5)
model <- plrs(expr=sim$expr, cghseg=sim$seg, cghcall=sim$cal)
plot(model)

# Simulate 4-state model
sim <- plrs.sim(n=80, states=4, sigma=0.5)
model <- plrs(expr=sim$expr, cghseg=sim$seg, cghcall=sim$cal)
plot(model)

plrs documentation built on April 28, 2020, 6:09 p.m.