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 |
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
D = csvread('data.dat',5,0); | |
tempSteps = D(:,1); | |
tempFactor = 2./tempSteps; | |
fout = fopen(['energyout.csv'], 'w'); | |
fprintf(fout, ['Temperature, k, K(k), Energy\n']); | |
k = 2.*(sinh(tempFactor))./((cosh(tempFactor)).^2); |
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
anonymous { | |
id: 2, | |
title: 'BLUE_EXPONENTIALFUNCTIONS.', | |
title_blue: 'Exponential\t\n', | |
title_yellow: 'Functions\n', | |
background_location: '/images/moduleBackgrounds/Connecticut_Module.png', | |
background_name: 'Connecticut Hall\n', | |
background_desc: '<p>Completed in 1752, Connecticut Hall is Yale’s oldest standing building. A student dormitory for over 200 years, it was designated a National Historic Landmark in 1965.</p>\n', | |
overview: '<p class="text_margin"><p>Grow, Grow Grow, Go, Go, Go! Exponential functions are great for describing things that grow rapidly. We\'re going to examine how Ben Franklin\'s gift to the cities of Philadelphia and Boston grew over time to get an understanding of exponential functions. We conclude by looking at Malthus\' theories of population growth. Questions we will interact with:</p>\n<ul>\n<li>What\'s an exponential function? (Ok, this seems kind of basic. But it\'s necessary)</li>\n<li>How can we distinguish between an exponential function and a linear function?< |
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
#include "MOptimumFilter.hh" | |
#include "QEvent.hh" | |
#include "QEventList.hh" | |
#include "QRawEvent.hh" | |
#include "QBaseModule.hh" | |
#include "QSampleInfo.hh" | |
#include "QRunDataHandle.hh" | |
#include "QBaseType.hh" | |
#include "QBaselineData.hh" | |
#include "QAveragePulseHandle.hh" |
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
#include "QOptimumFilter.hh" | |
#include "QError.hh" | |
#include "QMatrix.hh" | |
#include "QRealComplexFFT.hh" | |
#include "QFir.hh" | |
#include <sstream> | |
// EXTRA_JITTERS: | |
// 1: minimum number needed for interpolation | |
// 2: more point to see if we have a minimum at the boundary (enable nice parabola) |
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
#include "OptimumFilter.hh" | |
#include "QRealComplexFFT.hh" | |
#include <iostream> | |
#include "QMatrix.hh" | |
using namespace std; | |
using namespace Cuore; | |
OptimumFilter::OptimumFilter(): nSigPulses(0),nNoisePS(0){ | |
//par0=par1=par2=1; |
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
#include "OptimumFilter.hh" | |
#include "QRealComplexFFT.hh" | |
#include <iostream> | |
#include "QMatrix.hh" | |
using namespace std; | |
using namespace Cuore; | |
OptimumFilter::OptimumFilter(): nSigPulses(0),nNoisePS(0){ | |
//par0=par1=par2=1; |
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
import csv | |
#get hci output with bash command: hcidump -r hci.log -t > hci.txt | |
logs = open('hci.txt','r').read().replace('\n',' ').replace('586524','\n2017') | |
logs_output = open("hcidata.txt", "w") | |
logs_output.write(logs) | |
logs_output.close() | |
data = open('hcidata.txt','r') #replace with hci output | |
csv_data = [] | |
skip_header = True | |
for line in data: |
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
#install.packages('tm') | |
library(tm) | |
#install.packages('slam') | |
library("slam") | |
#import data | |
alldata <- read.csv('stackexchange/20161215StatsPostsMerged.csv', header = TRUE, stringsAsFactors = FALSE) | |
#make corpus |
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
reduceDTM <- function(dtm){ | |
term_tfidf <- | |
tapply(dtm$v/row_sums(dtm)[dtm$i], dtm$j, mean) * | |
log2(nDocs(dtm)/col_sums(dtm > 0)) | |
dtm <- dtm[,term_tfidf >= median(term_tfidf)] | |
dtm <- dtm[row_sums(dtm) > 0,] | |
return(dtm) | |
} |
OlderNewer