I wonder how to reproduce sinusoid with autogressive discrete model :
y = sin(t)
with or without additive noise is my target, t
here is continuous variable. sin(t)
could be expanded with Taylor expension, but I'm looking for autogressive formulation : y[t] = a1*y[t-1] + a2*y[t-2]+...
,
I could create artificial data, choose number of lags then fit model on these data, but how to control over number of realisation of this process in one cycle ? For example, below, there are 8 realisations per cycle of sinusoid which period is 0.1 sec
$\begingroup$
$\endgroup$
3
-
2$\begingroup$ just a question... why? $\endgroup$– carloCommented Mar 19, 2017 at 12:27
-
$\begingroup$ @carlo I would like to model if two time series diverse from each other by following sinusoidal pattern, I don't know if making linear regression and then ARMA on its residuals will be the correct procedure (unbiased, with low variance) so I try to understand modeling sinusoid from the scratch its also useful for generation additional realizations of observed signal $\endgroup$– QbikCommented Mar 19, 2017 at 16:25
-
$\begingroup$ You can fit an autoregressive model with exogenous regressors to your data; then, compare the series by checking the roots and associated cycles of the AR model. $\endgroup$– javlacalleCommented Mar 19, 2017 at 20:17
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
You can prove that the coefficients of a AR(2) model without added noise can reproduce a sine wave.
You can write your AR model as:
x(n+1) = a1*x(n) + a2*x(n-1)
Setting x(n+1)
as the predicted sine wave, you get:
sin(2pi*f*(n+1)) = a1*sin(2pi*f*n) + a2*sin(2pi*f*(n-1))
Knowing that sin(a+b) + sin(a-b) = 2cos(b)sin(a)
you can rearrange your equation: (with a = 2pi*f*n, b = 2pi*f
)
sin(2pi*f*n + 2pi*f)) - a2*sin(2pi*f*n - 2pi*f) = a1*sin(2pi*f*n)
You find out that:
a1 = 2cos(2pi*f)
a2 = -1