Hi all, I am new to this forum. I have a problem when I try to use twinsurr function as included in the current version of the CRP toolbox. According to the help of this function, Y=twinsurr(X) creates twin surrogates Y based on the vector X
using recurrences. The matrix Y contains 100 columns of 100 twin surrogates. If X is a PxQ matrix, the resulting surrogate matrix is Px100xQ.
But it turns out that whenever I input multivariate data (i.e., say 5 EEG channels with 1000 samples each, X= 5x1000 matrix), I always get the same error, namely: Error using crp (line 300)
First column of the first vector must be monotonically nondecreasing.
I have tried to input X' (the transpose of X) instead, with the same result. Of course I could always make a loop and input the rows of X one by one, but it would be nice if it could be done with one call to the function, as suggested. Any help?
Thanks in advance and thanks a lot also for making the toolbox freely available!
Using twinsurr in CRP toolbox with multivariate data
 Norbert
 Expert
 Posts: 194
 Joined: Wed Jan 4, 2006 11:03
 Affiliation (Univ., Inst., Dept.): Potsdam Institute for Climate Impact Research, Germany
 Location: Potsdam, Germany
 Location: Potsdam Institute for Climate Impact Research, Germany
Re: Using twinsurr in CRP toolbox with multivariate data
Hello,
the current version of twinsurr does not allow the use of multicolumn vectors. It can only be used with singlecolumn vectors which can be embedded in higher dimensions by using the parameters of this function. Moreover, I have to e,phasise that twinsurr is not identical with the published algorithm for twin surrogates and could produce results which are not completely correct. There is of course the plan to replace this very old prototype by a working version, but I do not know when I will be able to do it. Then I could also change the code in such a way that multicolumn vectors can be used (meanwhile you could replace the crp command in this function by the crp2 command – just have a look in the code and the help of crp and crp2).
I'm sorry that I cannot be more positive.
Best regards
Norbert
the current version of twinsurr does not allow the use of multicolumn vectors. It can only be used with singlecolumn vectors which can be embedded in higher dimensions by using the parameters of this function. Moreover, I have to e,phasise that twinsurr is not identical with the published algorithm for twin surrogates and could produce results which are not completely correct. There is of course the plan to replace this very old prototype by a working version, but I do not know when I will be able to do it. Then I could also change the code in such a way that multicolumn vectors can be used (meanwhile you could replace the crp command in this function by the crp2 command – just have a look in the code and the help of crp and crp2).
I'm sorry that I cannot be more positive.
Best regards
Norbert

 Junior
 Posts: 2
 Joined: Thu Feb 14, 2013 12:51
 Affiliation (Univ., Inst., Dept.): Univ. La Laguna, Dept. of Basic Physics,
 Location: Tenerife, SPAIN
 Research field: Multivariate EEG and MEG analysis
Re: Using twinsurr in CRP toolbox with multivariate data
THanks for the quick and helpful reply. I will look at crp2 as suggested. I have only one further question. As you mentioned that the results produced by the script may be sometimes not entirely accurate, could you ellaborate a little bit more on that? How bad is it? Is the script still useful for research purposes (as I am planning to use it for it)?
Thanks a lot
Thanks a lot