2
$\begingroup$

Suppose we have two time series generated by \begin{align} x_t &= \sigma_t\,e_t \\ y_t &= c\,\sigma_t\, f_t \end{align} where $e_t$ and $f_t$ are IIDs with mean zero and unit variance. We don't know much about $\sigma_t$ (although perhaps we can assume it's slowly changing). Given a series of observations of $x$ and $y$ I would like to estimate $c$.

For example, if both $e$ and $f$ are normal, and we make no assumptions about $\sigma$ one can compute the angle corresponding to the point $(x_t,y_t/a)$. If $a=c$ then this angle should be uniformly distributed on $(-\pi,\pi]$. One can then use Kolmogorov-Smirnov to judge how good an estimate $a$ is. Here is an R implementation of this idea:

set.seed(123)
n <- 150
vols <- runif(n, 1, 2)
x <- rnorm(n, sd = vols)
y <- rnorm(n, sd = 2*vols)
cc <- seq(1, 3, length.out = 200)
ks <- sapply(cc, function(c) {
  thetas <- atan2(y/c, x)
  ks.test(thetas, 'punif', -pi, pi)$p.value
})
plot(cc, ks, type = 'l')

In the normal case is the above approach optimal? What approaches exist if $e$ and $f$ are not normal? Finally, it seems that if $\sigma_t$ is slowly-varying there may be additional attacks on this (e.g., sampling consecutive $x$s and $y$s and estimating variances).

$\endgroup$

1 Answer 1

0
$\begingroup$

One approach which works even if $e$ and $f$ are not normal is to observe that that the distributions of $x$ and $y/c$ are identical. This idea can than be easily incorporated into the above code. For example the code below compares the efficiency of this estimator with the one in my question (which assumes normality). Interestingly, the more general estimator seems to be more efficient even in the normal case! (It's not clear to me why it wins in the normal case.)

set.seed(123)
n <- 100
num.trials <- 500
c.true <- 2
c.hats <- numeric(num.trials)
c.hats2 <- numeric(num.trials)
pb <- txtProgressBar(1, num.trials)

r <- switch (1,
  function(n) rnorm(n),
  function(n) runif(n, -1, 1),
  function(n) rt(n, 3)
)
for (i in 1:num.trials) {
  setTxtProgressBar(pb, i)
  vols <- runif(n, 1, 2)
  x <- r(n)*vols
  y <- r(n)*vols*c.true
  cc <- seq(0.5, 4, length.out = 200)
  ks <- sapply(cc, function(c) {
    thetas <- atan2(y/c, x)
    ks.test(thetas, 'punif', -pi, pi)$p.value
  })
  c.hats[i] <- mean(cc[ks == max(ks)])

  ks2 <- sapply(cc, function(c)
    ks.test(atan2(y/c, x), atan2(x, y/c), -pi, pi)$p.value
  )
  c.hats2[i] <- mean(cc[ks2 == max(ks2)])
}
close(pb)
hist(c.hats, 30)
hist(c.hats2, 30)
print(r)
cat(sprintf('c = %g +/- %g\n', mean(c.hats), sd(c.hats)))
cat(sprintf('c2= %g +/- %g\n', mean(c.hats2), sd(c.hats2)))
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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