0
$\begingroup$

I have a sequence of numbers which have been used in an open source R Package. I am trying to understand how the package is accomplishing its objectives. So i need to know the function to whose set of outputs these belong:

    -3.075163e-07,       2.186369e-07,       2.960645e-07,      -2.101838e-07,      -2.844124e-07,       2.015925e-07,       2.725605e-07,      -1.928639e-07,      -2.605095e-07,       1.839984e-07,       2.482599e-07,      -1.749968e-07,      -2.358125e-07,       1.658597e-07,       2.231680e-07,      -1.565879e-07,      -2.103273e-07,       1.471821e-07,  

There are a lot more of these in the actual source but in the interest o keeping the question short i have only given these few numbers. If you want to see all of them: R Package

Download the source. Extract it. There will be a folder called R in the extracted files. In that folder there will be a Source file called identify_quantify.R

In line 27 the numbers start and go on till line 13109.

EDIT: If you want to see the file with only the values then it can be found at: link

I think these are the outputs of some trigonometric function. I am not sure though. I dont know what tag to give to this question so i am tagging it as trignometry. Please correct if it is wrong.

  • 0
    @ChrisTaylor I have added the file. Please see it.2012-01-17

1 Answers 1

3

Your data is actually four separate series, which will become obvious if you plot it. You can use the following R code to extract the individual series:

x <- read.csv('identify_quantify.r') x <- x[[1]]  idx1 <- seq(1,13082,by=4) idx2 <- seq(2,13082,by=4) idx3 <- seq(3,13082,by=4) idx4 <- seq(4,13082,by=4)  x1 <- x[idx1] x2 <- x[idx2] x3 <- x[idx3] x4 <- x[idx4] 

It looks to me like the functions are trigonometric, inside an exponential envelope, for example:

$f(x) = A\cos(x) \exp(-bx^2)$

for suitable values of $A$ and $b$. You can plot a function like this in R with the code:

> x <- seq(-6*pi, 6*pi, length=1000) > A <- 1 > b <- 0.02 > f <- A * cos(x) * exp(-b*x^2) > plot(x,f) 

and see if you can make it fit.