Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. imf <- list()
  2. for (i in 2:ncol(emd$imf)) {
  3. tmp <- as.ts(emd[["imf"]][, i], start = 1, end = length(prices[, "GSPC.Close"]))
  4. imf <- append(imf, list(tmp))
  5. }
  6. residue <- as.ts(emd[["residue"]], start = 1, end = length(prices[, "GSPC.Close"]))
  7. transformed <- Reduce("+", imf) + residue
  8.  
  9. plot(transformed, ylab = "USD", xlim = c(480, 510), ylim = c(2800, 3050))
  10. lines(prices[, "GSPC.Close"], col = "red")
  11. legend(502, 3025, legend = c("Signal", "Transformed"), col = c("red", "black"), lty = c(1, 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement