plrs.sim {plrs} | R Documentation |
Simulation of a piecewise relationship.
The function has been only implemented for convenience of simulations and R examples.
plrs.sim(n = 80, states = 4, sigma = 01, x = NULL)
n |
Number of simulated data points |
states |
Number of states for the model |
sigma |
Noise |
x |
Segmented values. |
To be written...
Gwenael G.R. Leday g.g.r.leday@vu.nl
# 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)