Created
March 31, 2017 15:25
-
-
Save suryadutta/d7360dea040a9a5809c761c26a44487d to your computer and use it in GitHub Desktop.
RunJising Binning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for k=1:kmax | |
% Run simulation | |
[Msamp, Esamp, spin] = jisingAnnealing(N, T(k), num_steps, num_burnin,... | |
flip_prop, J, B); | |
binSize = 100; | |
totalUsed= floor(length(Esamp(num_burnin:end)) / binSize); | |
cv_binning = zeros(1,totalUsed); %initialize CV | |
chi_binning = zeros(1,totalUsed); %initialize chi | |
for i = 0:(totalUsed-1) | |
startNum = num_burnin + (binSize*i)+1; | |
endNum = num_burnin + binSize*(i+1); | |
cv_binning(i+1) = ((mean(Esamp(startNum:endNum).^2) - (mean(Esamp(startNum:endNum)))^2)); | |
end | |
% Ignore all the burnin steps | |
mt(k) = mean(Msamp(num_burnin:end)); | |
smt(k) = std(Msamp(num_burnin:end)); | |
et(k) = mean(Esamp(num_burnin:end)); | |
set(k) = std(Esamp(num_burnin:end)); | |
cv(k) = mean(cv_binning); | |
cv_std(k) = std(cv_binning); | |
cvN(k) = (mean(Esamp(num_burnin:end).^2)... | |
- (mean(Esamp(num_burnin:end)))^2)/(T(k)^2); | |
chi(k) = mean(chi_binning); | |
chi_std(k) = std(chi_binning); | |
chiN(k) = (mean(Msamp(num_burnin:end).^2)... | |
- (mean(Msamp(num_burnin:end)))^2)/T(k); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment