# How to decide dimension (using correlationDimension function)?

12 views (last 30 days)
JaeSung Choi on 15 Nov 2018
Edited: Bora Eryilmaz on 8 Feb 2019
I have some data y and I want to derive correlation dimension of this data.
So, I followed the example of correlation function as followings.
xdata = y(:); Np = 100; dim = ??
[~,lag] = phaseSpaceReconstruction(xdata,[],dim)
tmp = correlataionDimension(xdata,'Dimenstion',dim,'Lag',lag,'NumPoints',Np)
And, here is the problem. I exactly know the dimension of original system of xdata =100, but correlation dimension of xdata is less than 10.
Then, can I use dim = 10 for given code?? Or still I need to use dim = 100?

Bora Eryilmaz on 8 Feb 2019
Edited: Bora Eryilmaz on 8 Feb 2019
Hi JaeSung,
You can estimate the embedding dimension of your data using the phaseSpaceReconstruction command and use that value for the dimension argument of the correlationDimension command. You can code something like this:
[~, lag, dim] = phaseSpaceReconstruction(xdata);
cd = correlationDimension(xdata, lag, dim)
You can also experiment with the phaseSpaceReconstruction command by providing your own dimension (and lag, if you want) and look at the resulting plot to make sure that the dimension you provided makes sense. For example, you can try:
phaseSpaceReconstruction(xdata, lag, dim);
Once you are satisfied with the lag and dim values, then use them in the correlationDimension command.
Note that the length of your data vector, xdata, is NOT the dimension in question here. It is typically the dimension of the state-space of the system that generated the data. Think of it this way: you can have data of length Np from solving a second-order differential equation. Then, the dimension in question here is more like "2" rather than Np.
Hope this helps,
Bora