R: modjitter

modjitter {adlift} | R Documentation

## modjitter

### Description

This function jitters grid values by a proportion of the regular distance between consecutive gridpoints and then alters it to lie in [0,1].

### Usage

    modjitter(x, amount)

### Arguments

`x` | a vector to be jittered (e.g. a gridpoint vector).
`amount` | a value of how much to jitter the vector (expressed as a proportion of the regular gridpoint distance, d).

### Details

The function uses dojitter to jitter the gridpoint vector by (`amount*d`) . The endpoints are fixed to be zero and one, and the corresponding jx values to `x[2]` and `x[length(x)-1]` are randomised again in the intervals `[0,x[2]+amount*d]` and `[x[length(x)-1]-amount*d,1]` respectively.

### Value

`jx` | the jittered version of x

### Author(s)

Matt Nunes (nunesrpackages@gmail.com), Marina Knight

### See Also

`dojitter`, `make.signal2`

### Examples

    #create grid vector
    #
    xgrid<-seq(0,1,length=51)
    #
    xgrid
    #
    #a regularly-spaced grid on [0,1]
    #
    modjitter(xgrid,1)
    #
    #jitters xgrid with a maximum change of .02, keeping endpoints of zero and one

[Package adlift version 1.4-1 Index]