#NEWLINE# def makeGaussianProcess( self ) : #NEWLINE# #INDENT# tempNuggs = nm . reshape ( nm . array ( self . allNuggets ) , len ( self . allNuggets ) ) #NEWLINE# if self . corrFixed : #NEWLINE# #INDENT# self . gaussProcess = slgp . GaussianProcess ( nugget = tempNuggs , theta0 = self . bestTheta ) #NEWLINE# self . gaussProcess . fit ( self . allParams , self . allCosts ) #NEWLINE# self . gaussProcessParticles = [ ] #NEWLINE# self . gaussProcessParticles . append ( self . gaussProcess ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# tempThetaParticles = self . logThetaParticles #NEWLINE# self . logThetaParticles = [ ] #NEWLINE# self . logWeights = [ ] #NEWLINE# self . gaussProcessParticles = [ ] #NEWLINE# for ttp in tempThetaParticles : #NEWLINE# #INDENT# testTheta = nm . exp ( ttp ) #NEWLINE# self . gaussProcess = slgp . GaussianProcess ( nugget = tempNuggs , theta0 = testTheta , thetaL = self . minTheta , thetaU = self . maxTheta ) #NEWLINE# self . gaussProcess . fit ( self . allParams , self . allCosts ) #NEWLINE# self . saveParticles ( ) #NEWLINE# #UNINDENT# for _ in range ( self . thetaSearchNumber ) : #NEWLINE# #INDENT# testTheta = nm . power ( 10 , ( self . minLogTheta + ( nr . rand ( self . numParams ) * ( self . maxLogTheta - self . minLogTheta ) ) ) ) #NEWLINE# self . gaussProcess = slgp . GaussianProcess ( nugget = tempNuggs , theta0 = testTheta , thetaL = self . minTheta , thetaU = self . maxTheta ) #NEWLINE# self . gaussProcess . fit ( self . allParams , self . allCosts ) #NEWLINE# self . saveParticles ( ) #NEWLINE# #UNINDENT# self . dropSmallParticles ( ) #NEWLINE# self . normWeights = nm . exp ( nm . array ( self . logWeights ) ) #NEWLINE# self . normWeights = ( self . normWeights / nm . sum ( self . normWeights ) ) #NEWLINE# self . numParticles = len ( self . normWeights ) #NEWLINE# maxLogWeight = max ( self . logWeights ) #NEWLINE# thetaRef = self . logWeights . index ( maxLogWeight ) #NEWLINE# self . bestTheta = ( 10.0 ** self . logThetaParticles [ thetaRef ] ) #NEWLINE# self . weightEntropy = ( - float ( nm . sum ( ( self . normWeights * nm . log ( self . normWeights ) ) ) ) ) #NEWLINE# self . histBestTheta . append ( nm . ravel ( self . bestTheta ) ) #NEWLINE# self . histBestRLFV . append ( maxLogWeight ) #NEWLINE# self . histNumParticles . append ( self . numParticles ) #NEWLINE# self . histWeightEntropy . append ( self . weightEntropy )