Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions GynCycle_Original code/CreateFollicles.m
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
function [FSHVec, StartVec] = CreateFollicles(para,paraPoi,tb,te)

%create normal distributed fsh sensitivities for each foll
fileID2 = fopen('FSH.txt','w+');
fprintf(fileID2,'Number FSH\n');
FSHdistri = makedist('Normal','mu',para(7),'sigma',para(8));
for i=1:1000
fsh = random(FSHdistri);
fprintf(fileID2,'%f %f\n',i,fsh);
end
fclose(fileID2);
function [FSHVec, StartVec] = CreateFollicles(para,paraPoi,tb,te)

%create deterministic fsh sensitivities for each foll
fileID2 = fopen('FSH.txt','w+');
fprintf(fileID2,'Number FSH\n');
FSHVec = repmat(para(7),1000,1);
for i=1:1000
fprintf(fileID2,'%f %f\n',i,FSHVec(i));
end
fclose(fileID2);


%create poisson distributed starting times for each foll
fileID = fopen('StartTimesPoiss.txt','w+');
fprintf(fileID,'Start time\n');
TotIntervall = te-tb;
timevec=poissonproc(paraPoi(1),[tb,te]);
arraysize=size(timevec);
for i=1:arraysize
fprintf(fileID,'%f \n',timevec(i));
end
%create deterministic starting times for each foll
fileID = fopen('StartTimesPoiss.txt','w+');
fprintf(fileID,'Start time\n');
TotIntervall = te-tb;
timevec = poissonproc(paraPoi(1),[tb,te]);
arraysize = numel(timevec);
for i=1:arraysize
fprintf(fileID,'%f \n',timevec(i));
end
fclose(fileID);


Expand Down
23 changes: 12 additions & 11 deletions GynCycle_Original code/poissonproc.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
function S =poissonproc(lambda,tspan)

tb=tspan(1); %start time
te=tspan(2); %end time

%alternative method:
N=poissrnd(lambda*(te-tb));
U=rand([N,1]);
Usort=sort(U);
S=tb+(te-tb)*Usort;
%length(S)
function S = poissonproc(lambda, tspan)

tb = tspan(1); %start time
te = tspan(2); %end time

N = floor(lambda * (te - tb));
if N <= 0
S = [];
else
dt = (te - tb) / N;
S = tb + dt * (1:N)';
end

end