I have two vectors of known values $x$ and $y$. And the relationship between them is
$y=\sin(\theta \cdot x)+\epsilon$, $\epsilon \sim N(0,1) $ .
The question is how do I estimate $\theta$ with bootstrap?
I tried to create an inverse function for $\theta$: $\theta=\arcsin(\epsilon-y)/x$.
But for some data, $\epsilon -y$ can be larger then 1, so $\arcsin$ gives NAN.
What should I do?
The bootstrap is not an estimation procedure, per se. It is a method for approximating sampling distributions. What you need is an estimation procedure. I would recommend Maximum Likelihood Estimation:
Given $\theta$ and $x$, we know that $y\sim \mathcal{N}(\sin{\theta x},1)$. What we want to do is maximize the likelihood of observing the $n$ values of $y_i$ given the associated $x_i$ by varying the value of $\theta$.
The log-likelihood of the above data is: $\mathcal{L}(\theta|(\mathbf{y},\mathbf{x})) = -\frac{n\ln{2\pi}}{2}-\frac{1}{2}\sum\limits_{i=1}^n (y_i-\sin{\theta x_i})^2$.
The score function is: $S(\theta|(\mathbf{y},\mathbf{x})) = -\sum\limits_{i=1}^n \{ x_iy_i\cos{\theta x_i}+x_i\theta \cos(2\theta x_i)\}$
You will need to solve for $S(\theta|(\mathbf{y},\mathbf{x})) =0$ Bootstrapping is more for gauging the accuracy of such an estimator. If you coded an optimzation routine to solve for $\theta$ as decribed above, you would be able to determine an approximate confidence interval via bootstrapping. However, you need an estimator first.