Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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.

share|cite|improve this question
Looks like noise. Did you plot it? – draks ... Jan 17 '12 at 10:19
Can you make it more convenient to access the data? Not everyone has the ability/can be bothered to uncompress gzipped files. – Chris Taylor Jan 17 '12 at 10:20
I dont think it is noise. Though i might be wrong. I have not plotted it. I should have mentioned, i am not a mathematician. I really dont have any experience regarding this. So i ask the question: How can these values be plotted without doing it manually? Is there any online application for this? – Chaitanya Nettem Jan 17 '12 at 10:25
@ChrisTaylor Okay. give me 5 minutes. I will upload the file to some site. – Chaitanya Nettem Jan 17 '12 at 10:26
@ChrisTaylor I have added the file. Please see it. – Chaitanya Nettem Jan 17 '12 at 10:33

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.