forked from lawrennd/gpsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpsimArtificialGenes.m
26 lines (22 loc) · 1.02 KB
/
gpsimArtificialGenes.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
function y = gpsimArtificialGenes(t, alpha, mu, sigma, B, S, D)
% GPSIMARTIFICIALGENES Give artifical genes from given parameters.
% SHEFFIELDML
y = zeros(length(t), length(B));
for i = 1:length(B)
y(:, i) = B(i)/D(i);
D2 = D(i)*D(i);
for j = 1:length(alpha)
sigma2 = sigma(j)*sigma(j);
% y(:, i) = y(:, i) + S(i)*sigma(j)*alpha(j)*sqrt(pi)...
% *exp(D2*sigma2/4 - D(i)*(t-mu(j))) ...
% .*(-cumGaussian(-2/sqrt(2)*(t - D(i)/2*sigma2 - mu(j))/sigma(j)) ...
% +cumGaussian(2/sqrt(2)*(D(i)/2*sigma2 + mu(j))/sigma(j)));
y(:, i) = y(:, i) + exp(log(S(i)*sigma(j)*alpha(j)*sqrt(pi))...
+(D2*sigma2/4 - D(i)*(t-mu(j))) ...
+lnDiffCumGaussian(repmat(2/sqrt(2)*(D(i)/2*sigma2 + ...
mu(j))/sigma(j), ...
size(t, 1), size(t, 2)),...
-2/sqrt(2)*(t - D(i)/2*sigma2 - ...
mu(j))/sigma(j)));
end
end