-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeoo.m
128 lines (96 loc) · 2.44 KB
/
makeoo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
%%%%%%%%%%%%%%%%%%%%%%%%%%%%normal-1
load orgn1
% set simulation metadata
V.dt = 1/40; % time step size
% initialize params
P.a = 1; % observation scale
P.b = 0; % observation bias
tau = 1.5;%2; %1.5; % decay time constant
P.gam = 1-V.dt/tau; % C(t) = gam*C(t-1)
P.lam = 0.1; % firing rate = lam*dt
P.sig = 0.1; % standard deviation of observation noise
% fast oopsi
V.T=size(org,1)
F=org(:,1);
[N P] = fast_oopsi(F,V,P);
ret=org;
N=size(org,2);
for j=1:N
F=org(:,j);
[Nhat Phat]= fast_oopsi(F,V,P);
ret(:,j)= Nhat;
disp(j)
end
csvwrite('diff2n1a40b15csv.csv',ret)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%normal-2
load orgn2
% set simulation metadata
V.dt = 1/40; % time step size
% initialize params
P.a = 1; % observation scale
P.b = 0; % observation bias
tau = 1.5;%2; %1.5; % decay time constant
P.gam = 1-V.dt/tau; % C(t) = gam*C(t-1)
P.lam = 0.1; % firing rate = lam*dt
P.sig = 0.1; % standard deviation of observation noise
% fast oopsi
V.T=size(org,1)
F=org(:,1);
[N P] = fast_oopsi(F,V,P);
ret=org;
N=size(org,2);
for j=1:N
F=org(:,j);
[Nhat Phat]= fast_oopsi(F,V,P);
ret(:,j)= Nhat;
disp(j)
end
csvwrite('diff2n2a40b15csv.csv',ret)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%valid
load orgvalid
% set simulation metadata
V.dt = 1/40; % time step size
% initialize params
P.a = 1; % observation scale
P.b = 0; % observation bias
tau = 1.5;%2; %1.5; % decay time constant
P.gam = 1-V.dt/tau; % C(t) = gam*C(t-1)
P.lam = 0.1; % firing rate = lam*dt
P.sig = 0.1; % standard deviation of observation noise
% fast oopsi
V.T=size(org,1)
F=org(:,1);
[N P] = fast_oopsi(F,V,P);
ret=org;
N=size(org,2);
for j=1:N
F=org(:,j);
[Nhat Phat]= fast_oopsi(F,V,P);
ret(:,j)= Nhat;
disp(j)
end
csvwrite('diff2valida40b15csv.csv',ret)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%test
load orgtest
% set simulation metadata
V.dt = 1/40; % time step size
% initialize params
P.a = 1; % observation scale
P.b = 0; % observation bias
tau = 1.5;%2; %1.5; % decay time constant
P.gam = 1-V.dt/tau; % C(t) = gam*C(t-1)
P.lam = 0.1; % firing rate = lam*dt
P.sig = 0.1; % standard deviation of observation noise
% fast oopsi
V.T=size(org,1)
F=org(:,1);
[N P] = fast_oopsi(F,V,P);
ret=org;
N=size(org,2);
for j=1:N
F=org(:,j);
[Nhat Phat]= fast_oopsi(F,V,P);
ret(:,j)= Nhat;
disp(j)
end
csvwrite('diff2testa40b15csv.csv',ret)