Skip to contents

Overview

This package contains functions for adding noise to and filtering out noise from positional data, that is data that contains measurements of x- and y-coordinates. This package implements code that allows for the addition of realistic noise to simulated data and for the user to employ a realistic filtering pipeline to simulated and empirical data, therefore allowing for realistic recovery studies for pedestrian modelers. Answers this specific need for the Minds for Mobile Agents pedestrian model implemented in the predped package, but can be more broadly applied.

The implementation of this package and the defaults provided to the arguments of its functions is heavily based on results of a study conducted by Dr. Niels Vanhasbroeck and Prof. Dr. Andrew Heathcote, the repository of which you can find here.

Getting started

Installation

You can install the package from Github through the command:

remotes::install_github("ndpvh/denoiser")

Once installed, you can load the package through the library function.

library(denoiser)

Usage

The primary functionality of this package is provided through two functions, namely noiser and denoiser. Imagine having data that contains circular movement, such as in the following case:

# Create x- and y-coordinates for a person walking in a full circle
angles <- seq(0, 2 * pi, length.out = 50)
data <- data.frame(
    time = 1:50,
    x = 10 * cos(angles),
    y = 10 * sin(angles)
)

Then one can add “realistic” noise to these data by using the noiser function. Specifically, you call:

# Noise up the data
noised_up <- noiser(
    data,
    # Arguments defining the noising
)

To decrease the noise again, we call the denoiser function:

# Denoise the data
denoised <- denoiser(
    noised_up,
    # Arguments defining the denoising
)

For more details on how to use these functions, I refer the reader to the Documentation.

Getting help

You can find detailed documentation of the functions in this package as well as examples on the Documentation site. If you encounter a bug, please file an issue with a minimal working example on Github.