Input for ARfit ? (EEG analysis)

57 次查看(过去 30 天)
Annaëlle
Annaëlle 2024-11-5,15:43
评论: William Rose 2024-11-12,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.

回答(2 个)

William Rose
William Rose 2024-11-5,16:06
编辑:William Rose 2024-11-5,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 个评论
Annaëlle
Annaëlle 2024-11-5,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?

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2024-11-5,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 个评论
Annaëlle
Annaëlle 2024-11-12,9:13
Thank you so much for the detailed explanation, it really helped!
William Rose
William Rose 2024-11-12,14:26
@Annaëlle, you're welcome.
Good luck with your research.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by