head	1.3;
access;
symbols;
locks
	jonh:1.3; strict;
comment	@// @;


1.3
date	2000.04.08.18.22.18;	author jonh;	state Exp;
branches;
next	1.2;

1.2
date	2000.04.06.14.45.18;	author jonh;	state Exp;
branches;
next	1.1;

1.1
date	2000.04.04.20.06.33;	author jonh;	state Exp;
branches;
next	;


desc
@@


1.3
log
@*** empty log message ***
@
text
@several_experiments                     
exp_num = 1;
%[p,sn] = plot_experiment(experiment(exp_num));
clf;
sn1 = multi_select_experiment(sn, experiment(exp_num).subex{1});
y = [sn1.times{:}];
y = y(:);
x = repmat([sn1.fileLengthNum],1,length(sn1.times{1}))';
x = x(:);
[p,s] = polyfit(x,y,1);

n = length(y);
xmean = mean(x);
errors = y - polyval(p,x);
% se = std(errors);
sse = sum(errors.^2);	% sum of squared errors
mse = sse/(n-2);
se = sqrt(mse);
se
std(errors)
sb0 = se*((											...
		( (1/n)										...
			+										...
		  (											...
		  	(xmean^2) / (sum(x.^2)-n*(xmean^2))		...
		  )											...
		)											...
	)^0.5);
sb1 = se/sqrt(sum(x.^2)-n*(xmean^2));
alpha = 0.15;
t = tinv(1-alpha/2,s.df);

[yv,delta] = polyconf(p,0,s,alpha);

confidence_interval = t*[sb1 sb0];
%confidence_interval(2) = delta;
loline = polyval(p+confidence_interval, x);
hiline = polyval(p-confidence_interval, x);
semilogx(x,loline,'g-',x,hiline,'g-',x,y,'b.',x,polyval(p,x),'r.-')

outliers = (y>loline) | (y<hiline);
disp(sprintf('I count %d outliers for alpha %0.2f', sum(outliers), alpha));
@


1.2
log
@*** empty log message ***
@
text
@d19 2
d39 1
a39 1
semilogx(x,loline,'g-',x,hiline,'g-',x,y,'b.',x,polyval(p,x),'r.')
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
exp_num = 2;
d4 1
d28 1
a28 1
alpha = 0.05;
d33 4
a36 2
loline = polyval(p+t*[sb1 sb0], x);
hiline = polyval(p-t*[sb1 sb0], x);
d38 3
@
