# simulate: A function for generating simulated multivariate data In anomaly: Detecting Anomalies in Data

## Description

Generates multivariate simulated data having n observations and p variates. The data have a standard Gaussian distribution except at a specified number of locations where there is a change in mean in a proportion of the variates. The function is useful for generating data to demonstrate and assess multivariate anomaly detection methods such as `capa.mv` and `pass`.

## Usage

 ```1 2 3 4 5 6 7 8``` ```simulate( n = 100, p = 10, mu = 1, locations = 40, durations = 20, proportions = 0.1 ) ```

## Arguments

 `n` The number of observations. The default is `n=100`. `p` The number of variates. The default is `p=10`. `mu` The change in mean. Default is `mu=1`. `locations` A vector of locations (or scalar for a single location) where the change in mean occurs. The default is `locations=20`. `durations` A scalar or vector (the same length as `locations`) of values indicating the duration for the change in mean. If the durations are all of the same length then a scalar value can be used. The default is `durations=20`. `proportions` A scalar or vector (the same length as `locations`) of values in the range (0,1] indicating the proportion of variates at each location that are affected by the change in mean. If the proportions are all same than a scalar value can be used. The default is `proportions=0.1`.

## Value

A matrix with n rows and p columns

## Examples

 ```1 2``` ```library(anomaly) sim.data<-simulate(500,200,2,c(100,200,300),6,c(0.04,0.06,0.08)) ```

anomaly documentation built on Oct. 21, 2021, 1:06 a.m.