Removing noise from signal? (correlated noise and any function)

57 Views Asked by At

I am trying to find any type of function that will allow me to discern between the function and correlated noise.

I can only think of examples that don't work, like:

ug=matrix(nrow=N,c(0.5,0.4,0.4,0.5))
d=matrix(nrow = 500,ncol = 2)
noise=mvrnorm(n=500,rep(0,N),ug)
d[,1]=noise[,1]
d[,2]=sin(d[m,1])+noise[,2]
plot(d[,1],d[,2])
points(d[,1],sin(d[,1]),col="red")

The above gives me this:

enter image description here

So, whenever I try to apply any regression, I end up getting independent results because the regression captures both the noise and the sin() ending up with something like: enter image description here

Is there any function I could use where I can discern using a regression between the function and the correlated noise? (I guess it should be some sort of regression that captures the signal and not the errors?)