-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCalpha.m
106 lines (100 loc) · 2.58 KB
/
CCalpha.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
function [f,g]=CCalpha(A,B)%(A,B) %(D,R0)
alpha=(0:.05:1);
a=(.1:.1:2);
p=(.2:.2:4);
other=p;%********
lother=length(other);
%{
[a,b]=size(D);
%n=a*b;
la=length(alpha);
A=zeros(la,lother);
B=A;
for i=1:la
aplhai=alpha(i);
parfor j=1:lother
otherj=other(j);
[gamma,NN,n,nbar,na,NNbar,NNrep,minNind,maxNind,maxN,Kbar,K1,Cbar,betaS,betaI,betaD,ages0]=prepFlu(D,1.8,0,aplhai,otherj);
[fs,x]=finalSizeMulti(gamma,n,nbar,na,NN,NNbar,NNrep,minNind,maxNind,maxN,Kbar,K1,Cbar,betaS,0,2,10^(-8));
[fi,x]=finalSizeMulti(gamma,n,nbar,na,NN,NNbar,NNrep,minNind,maxNind,maxN,Kbar,K1,Cbar,betaI,2,2,10^(-8));
fs1=trimbyk(fs,a,b);
fi1=trimbyk(fi,a,b);
nvec=trimbyk(NN,a,b); fs1(nvec==0)=[]; fi1(nvec==0)=[]; nvec(nvec==0)=[];
nvec=log10(nvec);
ccs=corrcoef(nvec,fs1); ccs=ccs(1,2);
cci=corrcoef(nvec,fi1); cci=cci(1,2);
A(i,j)=ccs;
B(i,j)=cci;
end
end
f=A;
g=B;
%}
%{
fs=18; ms=5;
lwx=1; lw=2;%1.5;
cmap=redblue(100);
figure
colormap(cmap)
imagesc(alpha,other,A')
hcb=colorbar;
caxis([0-1,1])
xlabel('Population power \alpha','FontSize',fs);
ylabel('Offset a')%Offset a Distance power p
set(gca,'FontSize',fs);
axis tight%([0,1,-1,1])
box on
figure
colormap(cmap)
imagesc(alpha,other,B')
hcb=colorbar;
caxis([0-1,1])
xlabel('Population power \alpha','FontSize',fs);
ylabel('Offset a')
set(gca,'FontSize',fs);
axis tight%([0,1,-1,1])
box on
%}
%{
[a,b]=size(D);
%n=a*b;
la=length(alpha);
A=zeros(la,1);
B=A;
for i=1:la
ai=alpha(i);
[gamma,NN,n,nbar,na,NNbar,NNrep,minNind,maxNind,maxN,Kbar,K1,Cbar,betaS,betaI,betaD,ages0]=prepFlu(D,1.8,0,ai);
[fs,x]=finalSizeMulti(gamma,n,nbar,na,NN,NNbar,NNrep,minNind,maxNind,maxN,Kbar,K1,Cbar,betaS,0,2,10^(-8));
[fi,x]=finalSizeMulti(gamma,n,nbar,na,NN,NNbar,NNrep,minNind,maxNind,maxN,Kbar,K1,Cbar,betaI,2,2,10^(-8));
fs1=trimbyk(fs,a,b);
fi1=trimbyk(fi,a,b);
nvec=trimbyk(NN,a,b); fs1(nvec==0)=[]; fi1(nvec==0)=[]; nvec(nvec==0)=[];
nvec=log10(nvec);
ccs=corrcoef(nvec,fs1); ccs=ccs(1,2);
cci=corrcoef(nvec,fi1); cci=cci(1,2);
A(i)=ccs;
B(i)=cci;
end
f=A;
g=B;
%}
%
figure
fs=18; ms=5;
lwx=1; lw=2;%1.5;
col1=[.165,.31,.431];
col2=[.447,.553,.647];
hold on
h1=plot(alpha,A,'--','color',col1,'LineWidth',lw);
h2=plot(alpha,B,'--','color',col2,'linewidth',lw);
plot([0,1],[0,0],'k-','linewidth',lwx);
xlabel('Population power \alpha','FontSize',fs);
ylabel('Corr. coef.')
set(gca,'FontSize',fs);
axis ([0,1,-1,1])
legend([h1,h2],'S-mob','I-mob','location','W')
grid on
grid minor
box on
hold off
%}