Created
January 7, 2013 00:44
-
-
Save anonymous/4471392 to your computer and use it in GitHub Desktop.
This is a simple model that simulates the tendency of state of grace for people with Judger and Perceiver personality types. Written by David Mascarenas, 2013-01-06 Keywords:
computational theology, judger, perceiver, temperament, personality, every voluntary act, fundamental option, Jung, salvation Fundamental option vs Every Voluntary act
http…
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
#!/usr/bin/python | |
''' | |
This is a simple model that simulates the tendency of state of grace for | |
people with Judger and Perceiver personality types. | |
Written by David Mascarenas, 2013-01-06 | |
Keywords: | |
computational theology, judger, perceiver, temperment, personality, every voluntary act, fundamental option, Jung, | |
Fundamental option vs Every Voluntary act | |
http://www.ewtn.com/library/DOCTRINE/VSDEFEAT.TXT | |
http://www.pathsoflove.com/blog/2010/05/fundamental-option-and-salvation/ | |
''' | |
import numpy | |
import pylab | |
if __name__ == '__main__': | |
print 'Lets look at J-P characteristics ' | |
N = 1024 | |
age_yr = 100 | |
step_yr = float(age_yr)/N | |
filter_len = 100 | |
t_yr = numpy.arange(0, age_yr, step_yr ) | |
#J_lpfilter = numpy.fliplr( numpy.exp( numpy.arange( filter_len ) ) ) | |
J_lpfilter = numpy.exp( -.001 * numpy.arange( filter_len*2 ) ) | |
P_hlpfilter = numpy.exp( -.01 * numpy.arange( filter_len ) ) * numpy.cos( 2*numpy.pi*numpy.arange( float(filter_len) )/50 ) | |
#P_hlpfilter = numpy.exp( -.1 * numpy.arange( filter_len ) ) | |
pylab.figure() | |
pylab.subplot('211') | |
pylab.plot(numpy.arange(len( J_lpfilter))*step_yr, J_lpfilter) | |
pylab.title('Proposed Judger Finite Impulse Response Filter\n(NOTE: No Complex exponential components to induce oscillation)') | |
pylab.subplot('212') | |
pylab.plot( numpy.arange(len(P_hlpfilter))*step_yr, P_hlpfilter) | |
pylab.xlabel('time (yrs)') | |
pylab.title('Proposed Perceiver Finite Impulse Response Filter\n(NOTE: Complex exponential components present that allow oscillation)') | |
############################################## | |
# Begin - check for grace by monte carlo | |
############################################## | |
NN = 10000 #Number of monte carlo runs | |
J_heaven_array = [] | |
J_hell_array = [] | |
J_grace_net_array = [] | |
P_heaven_array = [] | |
P_hell_array = [] | |
P_grace_net_array = [] | |
for nn in range( NN ): | |
J_heaven = 0 | |
J_hell = 0 | |
P_heaven = 0 | |
P_hell = 0 | |
stimulus_time_series = numpy.random.randn( N ) | |
#This is just here to check my impulse response functions work correctly | |
#stimulus_time_series = numpy.zeros( N ) | |
#stimulus_time_series[0] = 1 | |
P_time_series_filtered = numpy.convolve(stimulus_time_series, P_hlpfilter, mode='same') | |
J_time_series_filtered = numpy.convolve(stimulus_time_series, J_lpfilter, mode='same') | |
for ii in range(N): | |
if P_time_series_filtered[ii] > 0: | |
P_heaven = P_heaven + 1 | |
else: | |
P_hell = P_hell + 1 | |
if J_time_series_filtered[ii] > 0: | |
J_heaven = J_heaven + 1 | |
else: | |
J_hell = J_hell + 1 | |
J_grace_net_array.append( (J_heaven - J_hell) * step_yr ) | |
P_grace_net_array.append( (P_heaven - P_hell) * step_yr ) | |
J_heaven_array.append( J_heaven * step_yr ) | |
J_hell_array.append( J_hell * step_yr ) | |
P_heaven_array.append( P_heaven * step_yr ) | |
P_hell_array.append( P_hell * step_yr ) | |
''' | |
print "Time J_heaven = " + str( J_heaven * step_yr ) | |
print "Time J_hell = " + str( J_hell * step_yr ) | |
print "Time P_heaven = " + str( P_heaven * step_yr ) | |
print "Time P_hell = " + str( P_hell * step_yr ) | |
''' | |
############################################## | |
# End - check for grace by monte carlo | |
############################################## | |
print 'mean years J heaven = ' + str( numpy.mean(J_heaven_array) ) | |
print 'mean years J hell = ' + str( numpy.mean(J_hell_array) ) | |
print 'mean years P heaven = ' + str( numpy.mean(P_heaven_array) ) | |
print 'mean years P hell = ' + str( numpy.mean(P_hell_array) ) | |
pylab.figure() | |
#pylab.plot( t_yr, stimulus_time_series ) | |
pylab.subplot('211') | |
pylab.plot( t_yr, J_time_series_filtered ) | |
#pylab.plot( J_lpfilter ) | |
#pylab.plot( P_hlpfilter ) | |
pylab.title( 'Judger personality state of grace over lifespan' ) | |
pylab.ylabel('State of Grace ') | |
pylab.xlim([0,age_yr - 10]) | |
#pylab.axes( (0, (age_yr-10), numpy.min( J_time_series_filtered ), numpy.max( J_time_series_filtered ) ) ) | |
pylab.grid(True) | |
pylab.subplot('212') | |
pylab.plot( t_yr, P_time_series_filtered ) | |
pylab.title( 'Perceiver personality state of grace over lifespan' ) | |
pylab.ylabel('State of Grace') | |
pylab.xlim([0,age_yr - 10]) | |
pylab.xlabel('time (yrs)') | |
#pylab.axes( (0, (age_yr-10), numpy.min( P_time_series_filtered ), numpy.max( P_time_series_filtered ) ) ) | |
#pylab.xlabel('time (yrs)') | |
pylab.grid(True) | |
num_bins = 100 | |
pylab.figure() | |
pylab.subplot('221') | |
pylab.hist( numpy.array(J_heaven_array), num_bins ) | |
pylab.title( 'J heaven' ) | |
pylab.subplot('222') | |
pylab.hist( numpy.array(J_hell_array), num_bins ) | |
pylab.title( 'J hell' ) | |
pylab.subplot('223') | |
pylab.hist( numpy.array(P_heaven_array), num_bins ) | |
pylab.title( 'P heaven' ) | |
pylab.subplot('224') | |
pylab.hist( numpy.array(P_hell_array), num_bins ) | |
pylab.title( 'P hell' ) | |
bins = numpy.arange( -100, 100 ) | |
pylab.figure() | |
pylab.subplot('211') | |
pylab.hist( numpy.array( J_grace_net_array ), bins ) | |
pylab.title( 'J grace, Expected Value = ' + str(numpy.mean(J_grace_net_array)) + ', Number Simulations = ' + str(NN) ) | |
pylab.subplot('212') | |
pylab.hist( numpy.array( P_grace_net_array ), bins ) | |
pylab.title( 'P grace, Expected Value = ' + str(numpy.mean(P_grace_net_array)) + ', Number Simulations = ' + str(NN) ) | |
print J_heaven_array | |
pylab.show() | |
''' | |
Fundamental option vs Every Voluntary act | |
http://www.ewtn.com/library/DOCTRINE/VSDEFEAT.TXT | |
http://www.pathsoflove.com/blog/2010/05/fundamental-option-and-salvation/ | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment