I have a time series of the number of sunspots from 1710 to 1980 base on a dataset from R.
I am trying to estimate the matrix of correlation of the "y" values. I tried to use the cor(.) function from the timeSeries package( https://cran.r-project.org/web/packages/timeSeries/timeSeries.pdf )(page 64). But it doesn't work.
Let "yp" be my vector of observations from 1710 to 1980(time series object). My code is:
CorrelationMatrice=cor(yp,y=NULL,use = "all.obs", method = c("pearson"))
Thank you for reading this post.
The error is of the following form:
Error in cor(yp, y = NULL, use = "all.obs", method = c("pearson")) :
give 'x' and 'y' or 'x' as a matrix
I would like that my correlation matrix gives the correlation between each pair of observations ci and cj from yp.
yp
is a matrix? – SabDeMdput
? – SabDeM