-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathreverse_correlation_demo.m
More file actions
24 lines (16 loc) · 1.03 KB
/
reverse_correlation_demo.m
File metadata and controls
24 lines (16 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% This script demos how to do reverse correlation to fit LN models after behavioral analysis
relevant_track_fields = {'BehavioralTransition','Frames','LEDPower','LEDVoltage2Power'};
load('reference_embedding.mat')
number_of_behaviors = max(L(:))-1;
%select folders
folders = getfoldersGUI();
%load tracks
[allTracks, folder_indecies, track_indecies] = loadtracks(folders,relevant_track_fields);
%% fit LN models for each behavior
[LNPStats_nondirectional, meanLEDPower_nondirectional, stdLEDPower_nondirectional] = FitLNP(allTracks,folder_indecies,folders);
% display fitted models
PlotBehavioralMappingExperimentGroup(LNPStats_nondirectional, meanLEDPower_nondirectional, stdLEDPower_nondirectional, L, density, xx)
%% fit context dependent LN models
[LNPStats_directional, meanLEDPower_directional, stdLEDPower_directional] = directional_FitLNP(allTracks,folder_indecies,folders);
% display fitted models
PlotDirectionalBehavioralMappingExperimentGroup(LNPStats_directional, meanLEDPower_directional, stdLEDPower_directional, L, density, xx)