Input for ARfit ? (EEG analysis)

57 Ansichten (letzte 30 Tage)
Annaëlle
Annaëlle am 5 Nov. 2024 um 15:43
Kommentiert: William Rose am 12 Nov. 2024 um 14:26
Hello,
I am trying to use the ARfit toolbox on EEG data, more specifically the arfit function itself, but I can't figure out what format the input should be in.
It says on the toolbox page that "The input matrix v must contain the time series data, with columns of v representing variables and rows of v representing observations" but I don't understand what it means. What I have is a vector where the rows are the EEG channels, and the columns are the signal values for each data point. However, it clearly doesn't work (either returns an error "time series too short", or it runs but the output is wrong (siglev = 0 with the function arres)).
I'm hoping someone there know how to use the toolbox better than I do... Thanks in advance.

Antworten (2)

William Rose
William Rose am 5 Nov. 2024 um 16:06
Bearbeitet: William Rose am 5 Nov. 2024 um 16:08
[Edit: fix spelling.]
Have you run the script ardem.m, which is part of the ARfit toolbox? Does it produce reasonable output?
Assuming it does, I would modify ardem, so that it uses two columns of your data, instead of using the simulated data that it does use. To do this, change line
v = arsim(w, A, C, 200); % generate simulated data v (200x2 array)
to something like
myData=load('myData.txt'); % read data from file
v=myData(1:200,1:2); % v=rows 1-200 & columns 1 and 2 of data
The details of the new lines above will vary depending on which columns you want to use, etc. But you get the idea. See what happens.
You can also start a discussion on the FileExchange site for that toolbox.
Attach a sample data file here, if you want more assistance.
  2 Kommentare
Annaëlle
Annaëlle am 5 Nov. 2024 um 16:23
No issue running ardem.m.
However, it clearly doesn't work (either returns an error "time series too short", or if it runs but the output is wrong (siglev = 0 with the function arres)). -> This is what happens when I load my data into v, hence why I'm asking for help.
Would it be possible for you to clarrify what the rows and the columns in your data array correspond to?
William Rose
William Rose am 5 Nov. 2024 um 22:08

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 5 Nov. 2024 um 19:40
What I have is a vector where the rows are the EEG channels, and the columns are the signal values for each data point.
Your input is in the wrong form for the toolbox.
Each EEG channel should be considered independent. Going to the next row of the data does not correspond to going to the next time-point of the data.
Potentially if you were to flip the array it just might be the right order... provided that what is currently the colums that are signal values for each data point, happen to reflect different times.
You need
channel1_time1 channel2_time1 channel3_time1
channel1_time2 channel2_time2 channel3_time2
channel1_time3 channel2_time3 channel3_time3
channel1_time4 channel2_time4 channel3_time4
and so on.
  7 Kommentare
Annaëlle
Annaëlle am 12 Nov. 2024 um 9:13
Thank you so much for the detailed explanation, it really helped!
William Rose
William Rose am 12 Nov. 2024 um 14:26
@Annaëlle, you're welcome.
Good luck with your research.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by