takeErrorsIntoAccount: Take Errors Into Account for UPMASK analysis

Description Usage Arguments Value Author(s) References Examples

Description

Based on a data frame containing measurements and errors, the takeErrorsIntoAccount will produce another data frame where each measurement of the original data frame is replaced by another value taken from a random distribution. The implemented error model is gaussian, so each value of the output data frame will be a random sampling from a gaussian distribution where the mean is the value in the original data frame (indicated by the photometricDataIndexes column argument) and the standard deviation is the value from its corresponding error (indicated by the photometricErrorDataIndexes column argument). The newly constructed dataframe is returned by the function.

The user can adapt this function so it can take any error model into account during the UPMASK analysis.

Usage

1
takeErrorsIntoAccount(originalData, dataIndexes, errorIndexes)

Arguments

originalData

a data frame to use as the baseline

dataIndexes

an array of integers indicating the columns corresponding to the measurements

errorIndexes

an array of integers indicating the columns corresponding to the errors

Value

A data frame with the new values sampled from the error distributions.

Author(s)

Alberto Krone-Martins, Andre Moitinho

References

Krone-Martins, A. & Moitinho, A., A&A, v.561, p.A57, 2014

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Create a simple data set with the values and errors
toyDataDF <- data.frame(x=runif(10, 0, 10), dx=rep(0.2, 10), y=runif(10, 0, 10), 
                        dy=rep(0.1, 10))

# Apply the error models to create another data frame
newToyDataDF <- takeErrorsIntoAccount(toyDataDF, c(1,3), c(2,4))

# Plot the results
plot(toyDataDF$x, toyDataDF$y)
points(newToyDataDF$x, newToyDataDF$y, pch=19, cex=0.8, col="red")

# Clean the environment
rm(list=c("toyDataDF", "newToyDataDF"))
 

UPMASK documentation built on May 2, 2019, 2:39 p.m.