0

Dear stackoverflowers,

I have derived a modified version of an entropy measure of ME (Market efficiency) where I windowed/rolled CMSE (Composite Multiscale Entropy) over length 500 window for the SP500. I then ran 5000 replications of length(500) Gaussian iid RV. I made any windowed CMSE[i,j] with higher value then the lower bound of the 5000 replications CMSE boot equal to 1. The data set in front of you is the result.

How do I insert the data?

The question is how one would create a heat map when there are 8007 columns (time variable) and each time there are 28 scales (time-scales variable) using anything like ggplot2

I can get it to come up very ugly like this

  heatmap.2(adjrollingME_CMSE,col=redgreen(75),dendrogram='none', Rowv=FALSE,   
  Colv=FALSE,trace='none')


  library(ggplot2)   
  date<- index(DSP500F)[1:8007]
  y<- 0:28   
  gg <- ggplot(data =data.frame(adjrollingME_CMSE), aes(x = date, y =y, fill = value)),
  geom_tile()
  gg

Don't know how to automatically pick scale for object of type function. Defaulting to continuous Error: Aesthetics must either be length one, or the same length as the dataProblems:hm

user3647872
  • 85
  • 1
  • 9

1 Answers1

0

I can not see your data set, but it sounds like you are using a matrix rather than storing your data in a data frame. With R, you should always store time series data in the data frame format. This is a really strange idea at first, but it is sort of like taking your matrix and normalizing it.

Here is some info on data frames. And here is another question about converting a matrix to a data frame.

Good luck!

Community
  • 1
  • 1
cranberry
  • 294
  • 5
  • 17
  • Thank you for your comment. I dont know how to post data on here. It's a 28 X 8007 matrix. My problem is that I have never used a heatmap function before. – user3647872 Sep 07 '14 at 22:56
  • 1
    I know this will be frustrating to hear, but try googling `r heatmap tutorial`. There are lots of great resources. That's how I learn to do most things the first time. Tutorials usually use the data sets that are built into R. That way you can be sure that the data is prepared properly. It should only take you and hour, maybe two if you hit another issue. Then you'll be on your way. This issue seems pretty general, but let me know if you have a specific issue I can help with. – cranberry Sep 07 '14 at 23:17