# Variable declaration
x1=[-1,1,-1,1,-1,1,-1,1] # Solvent
x2=[-1,-1,1,1,-1,-1,1,1] # Time
x3=[-1,-1,-1,-1,1,1,1,1] # Temperature
Var = [2048,2813,800,1352,2113,1568,882,1013] # Variance
# Calculation
from scipy import *
from pylab import *
%matplotlib inline
Var = log(Var)
solvent = 0
for i in range(0,8):
solvent = solvent + x1[i]*Var[i]
solvent = round(solvent/4,3)
time=0
for i in range(0,8):
time = time + x2[i]*Var[i]
time = round(time/4,3)
temp=0
for i in range(0,8):
temp = temp + x3[i]*Var[i]
temp = round(temp/4,3)
st = 0
for i in range(0,8):
st = st + x1[i]*x2[i]*Var[i]
st =round(st/4,3)
stemp = 0
for i in range(0,8):
stemp = stemp + x1[i]*x3[i]*Var[i]
stemp =round(stemp/4,3)
tt = 0
for i in range(0,8):
tt = tt + x2[i]*x3[i]*Var[i]
tt =round(tt/4,3)
stt = 0
for i in range(0,8):
stt = stt + x1[i]*x2[i]*x3[i]*Var[i]
stt =round(stt/4,3)
x = [0.15,0.30,0.45,0.60,0.90,1.2,1.5]
y = [stt,st,stemp,solvent,(-1)*temp,(-1)*tt,(-1)*time]
# Result
print "solvent:",solvent," time:",time
print "temp:",temp," solvent*time:",tt
print "solvent*temp:",st," time*temp:",stemp
print "solvent*time*temp:",stt
scatter(x,y)
title("A Half Normal plot")