You can start with nice tools and build up an empire.
What if after the empire was being built and at final moment you realized that the whole land did not belong to you?
For the permanent peace, you must watch the empire falling down.
Coding Horrors are the description as told by the eye witness of such falling empire.
It is amazing to see that the whole scenario become a nice memorable event.
If you did not learn from the failure, you are not an intelligent animal!
Sunday, June 29, 2008
Friday, June 27, 2008
Show me the space!
x = (0.01:.01:1);
y = (0.01:.01:1);
size = length(x);
for i = 1:size
for j = 1:size
...
:)
C:\academy\me2008\TRY11
Model=[Model1, Model2, Model3, Model4, Model5, Model6, Model7, Model8];
QQ=0;
for k = 1:N
QQ=QQ+(Di(k)-Model(k)).^2;
end
z(i,j) = -(QQ)./(2*sigma.^2);
end
end
% logL=(-N/2)*log(QQ);
[X,Y] = meshgrid(x,y);
Z = griddata(x,y,z,X,Y,'cubic');
meshc(X,Y,Z) %
colormap hsv
surfc(X,Y,Z)
y = (0.01:.01:1);
size = length(x);
for i = 1:size
for j = 1:size
...
:)
C:\academy\me2008\TRY11
Model=[Model1, Model2, Model3, Model4, Model5, Model6, Model7, Model8];
QQ=0;
for k = 1:N
QQ=QQ+(Di(k)-Model(k)).^2;
end
z(i,j) = -(QQ)./(2*sigma.^2);
end
end
% logL=(-N/2)*log(QQ);
[X,Y] = meshgrid(x,y);
Z = griddata(x,y,z,X,Y,'cubic');
meshc(X,Y,Z) %
colormap hsv
surfc(X,Y,Z)
Thursday, June 26, 2008
Multiple Codes and similar codes
Hmm.. this one is sneaky!
Time after time, I have managed to make 20 different files of the codes during the test run.
Everyone of them runs.
Now the problem is which one is the best one.
...
Which one was the best one that worked nicely?
I am asking to myself...
Why did I have to run immediately after getting the program run?
I should have noted the program.
Now I will need to go through the lines and check!
:(
Time after time, I have managed to make 20 different files of the codes during the test run.
Everyone of them runs.
Now the problem is which one is the best one.
...
Which one was the best one that worked nicely?
I am asking to myself...
Why did I have to run immediately after getting the program run?
I should have noted the program.
Now I will need to go through the lines and check!
:(
Tuesday, June 24, 2008
Stopping Criteria
try = ooo;
test = ooo;
break =20;
%%%after MCMC
if i == break
a =isequal(test,ooo);
if a == 0
break
else
break = break+5
end
end
test = ooo;
break =20;
%%%after MCMC
if i == break
a =isequal(test,ooo);
if a == 0
break
else
break = break+5
end
end
Monday, June 23, 2008
What if it explores in-correctly?
Whenever you are looking into the probability space, give me some reasoning to verify or to convince me that you are looking into the space which is beautiful.
By beautiful space, I mean the space which is useful to explore.
In this perspective, my algorithm was looking into the space which was contracted in some random way.
In order to fix it, i needed to change by explore strategy:
notOK = 1;
while (notOK)
Try(i).A = Obj.A + step*(2*rand-1);
% Try(i).A = Obj.A + step*randn; % not quite gaussian :)
if Try(i).A > 0
notOK = 0;
end
end
notOK = 1;
while (notOK)
Try(i).B = Obj.B + step*(2*rand-1);
if Try(i).B > 0
notOK = 0;
end
end
notOK = 1;
while (notOK)
Try(i).C = Obj.C + step*(2*rand-1);
if Try(i).C > 0
notOK = 0;
end
end
By beautiful space, I mean the space which is useful to explore.
In this perspective, my algorithm was looking into the space which was contracted in some random way.
In order to fix it, i needed to change by explore strategy:
notOK = 1;
while (notOK)
Try(i).A = Obj.A + step*(2*rand-1);
% Try(i).A = Obj.A + step*randn; % not quite gaussian :)
if Try(i).A > 0
notOK = 0;
end
end
notOK = 1;
while (notOK)
Try(i).B = Obj.B + step*(2*rand-1);
if Try(i).B > 0
notOK = 0;
end
end
notOK = 1;
while (notOK)
Try(i).C = Obj.C + step*(2*rand-1);
if Try(i).C > 0
notOK = 0;
end
end
Friday, June 20, 2008
"Horrible Habits"
Donot call main function like I do!
run('C:\academy\... ... ... \try7\2runs.*')
Instead, Modify the main file.
What I can do is I can add loop inside the main and have it running ; instead of calling from another file which has loop.
Save the version1, version2 and so on.
%%%%%%%%%%%%%%%%%
The problem was identified since the loop was running by pressing the ctrl+enter key but was not working whenever was called in the command window.
run('C:\academy\... ... ... \try7\2runs.*')
Instead, Modify the main file.
What I can do is I can add loop inside the main and have it running ; instead of calling from another file which has loop.
Save the version1, version2 and so on.
%%%%%%%%%%%%%%%%%
The problem was identified since the loop was running by pressing the ctrl+enter key but was not working whenever was called in the command window.
Stopping Criteria
Follow up from yesterday's NS code.
Check at the 3500th iteration if it is above the desired/actual/computed/pleasant number.
if yes,
break
no?
go to hell!!!
(I mean to 10000th iteration)
ha ha!
%%%%%%%%%%%%%%%%%%%
if nest = = 3500
[x,y,z] = Results(Samples, nest, logZ);
if x>0.1
break
end
end
Check at the 3500th iteration if it is above the desired/actual/computed/pleasant number.
if yes,
break
no?
go to hell!!!
(I mean to 10000th iteration)
ha ha!
%%%%%%%%%%%%%%%%%%%
if nest = = 3500
[x,y,z] = Results(Samples, nest, logZ);
if x>0.1
break
end
end
Thursday, June 19, 2008
Hurray!
I will be online, coding.
So, lets dump some ideas here.
Everything will be personal. And I will not leave a single hint on who am I.
So, lets dump some ideas here.
Everything will be personal. And I will not leave a single hint on who am I.
Wednesday, June 18, 2008
Imaginary standard deviation: Discussion with Deniz: Because even after the convergence has been achieved, the program keeps adding small logZ (whic
Imaginary standard deviation:
Discussion with Deniz:
Because even after the convergence has been achieved, the program keeps adding small logZ (which should not be the case).
That means:
[w_array] = Results1(Samples, nest, logZ);
mean(x) = 0.33611 stdev(x) = 0+1.6919e-006i
mean(y) = 0.34601 stdev(y) = 0+1.7417e-006i
mean(z) = 0.33582 stdev(z) = 0+1.6904e-006i
>> sum(w_array)
ans =
1.0000
>> format long
>> ans
ans =
1.000000000025338
Which is the problem, as this can result into imaginary stdev!!!
One of the approach to solve this problem would be to have a stopping criterion in the algorithm. This can be something like this:
If logZ(i+1)-logZ(i) < = eps
STOP!!!
Lets see!
Discussion with Deniz:
Because even after the convergence has been achieved, the program keeps adding small logZ (which should not be the case).
That means:
[w_array] = Results1(Samples, nest, logZ);
mean(x) = 0.33611 stdev(x) = 0+1.6919e-006i
mean(y) = 0.34601 stdev(y) = 0+1.7417e-006i
mean(z) = 0.33582 stdev(z) = 0+1.6904e-006i
>> sum(w_array)
ans =
1.0000
>> format long
>> ans
ans =
1.000000000025338
Which is the problem, as this can result into imaginary stdev!!!
One of the approach to solve this problem would be to have a stopping criterion in the algorithm. This can be something like this:
If logZ(i+1)-logZ(i) < = eps
STOP!!!
Lets see!
Subscribe to:
Posts (Atom)