simulateGaps: Simulate Gappy Data

View source: R/simulateGaps.R

simulateGapsR Documentation

Simulate Gappy Data

Description

Function to simulate the MCAR gappy data for a list of complete original time series according to various combinations of gap structure parameters *p* and *g*. and store in a list.

Usage

simulateGaps(OriginalData, p, g, K)

Arguments

OriginalData

list; List object containing the complete original time series vectors (as separate elements)

p

numeric; Vector of unique proportions representing the different 'proportion-of-data missing' (*p*) scenarios to simulate

g

integer; Vector of unique integer values representing the different 'gap length' scenarios (*g*) to simulate

K

integer; Number of gappy series to simulate for each (*p,g*) gap specification

Examples

 

# Subroutine removes p*n points where the number of consecutive missing
# observations (gaps) is a multiple of gap_width. For example, in a time
# series of length n = 100:

 p = 0.30, g = 2

# will generate 30 missing points, with <15 holes.

# Usage in simulateGaps():

p = c(0.05,0.10,0.15,0.20)
g = c(1,5,10)
K = 10 # number of gappy series to simulate under each p,g specification

GappyData <- simulateGaps(OriginalData = OriginalData, p = p, g = g, K = K)

# dimension (d, p, g, k) 


castels/interpTools documentation built on June 7, 2024, 4:20 p.m.