-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenIndAvgAtDSeq.m
More file actions
22 lines (20 loc) · 1.12 KB
/
GenIndAvgAtDSeq.m
File metadata and controls
22 lines (20 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function [ PtsErrSIM, AvgSIM, PtsErrSeqESIM,PtsErrSeqLSIM ] = GenIndAvgAtDSeq(AtDParam,N, numSamples, PtsErr, PtsE, PtsL, PtsA )
% This function takes AtD parameters, a set size (N), and a number of
% trials (numSamples) and siumulates data from the AtD_Sequetial model. It also
% uses subject responses (PtsErr and AvgErr) to ensure that the mean error
% (bias) is identical to subject data). Used in figures 8 analysis
%
delays=[0,1,6];
PtsErrSIM={};
AvgSIM={};
PtsErrSeqESIM={};
PtsErrSeqLSIM={};
for delay=1:3
PtsErrSIM{delay,1,1}=mean(PtsErr{delay,1})+(AtDParam(2)+delays(delay)*AtDParam(1))^.5*randn(numSamples,1);
if delay>1
PtsErrSeqESIM{delay-1,1,1}=mean(PtsE{delay-1,1})+(AtDParam(4)+delays(delay)/2*AtDParam(1)*(N-1)^AtDParam(5)+delays(delay)/2*AtDParam(1)*N^AtDParam(5))^.5*randn((N-1)*numSamples/N,1);
PtsErrSeqLSIM{delay-1,1,1}=mean(PtsL{delay-1,1})+(AtDParam(6)+delays(delay)/2*AtDParam(1)*(N)^AtDParam(5))^.5*randn(numSamples/N,1);
AvgSIM{delay-1,2,2}=mean(PtsA{delay-1,1})+(AtDParam(3)+((N-1)/N)^2*delays(delay)/2*AtDParam(1)+ delays(delay)/2*AtDParam(1))^.5*randn(numSamples,1);
end
end
end