simcurve {ihclust} | R Documentation |
simcurve
Description
This function generates two kinds of datasets. 1. Randomly generates curves with change/no change. 2. Generates true curves assumed from fixed coeffecients with some random noise.
Usage
simcurve(numareas = c(300, 300, 300), p = 0.05, type, normerr = 0.1)
Arguments
numareas |
number of areas to generate |
p |
proportion of the areas that have significant change |
type |
type of curves generated |
normerr |
standard deviation of the Normal distribution (with mean zero) of which the coefficients are generated |
Details
If type = "random", the function generates curves with change/no change. If type = "fixed", the function generates true curves assumed from fixed coefficients with some random noise. If numareas is not specified, it is assumed as a vector of c(300,300,300). If normerr is not specified, it is assumed as a value of 0.01. It is ignored when type= "random".
Value
Output from the function is a list of two items:
data - simulated data
parameters - parameters used to generate the data
Examples
mydata_ran <- simcurve(numareas = c(300, 300, 300), p=0.01, type="random")
mydata_fixed <- simcurve(numareas = c(300, 300, 300), p=0.01, type="fixed", normerr = 0.1)