## Experimentaldesign .pdf

Nom original: Experimentaldesign.pdf
Auteur: Victor Collange

Ce document au format PDF 1.5 a été généré par Microsoft® Word 2016, et a été envoyé sur fichier-pdf.fr le 11/01/2017 à 14:19, depuis l'adresse IP 130.237.x.x. La présente page de téléchargement du fichier a été vue 268 fois.
Taille du document: 174 Ko (3 pages).
Confidentialité: fichier public

### Aperçu du document

import numpy as np
from numpy.linalg import inv
import matplotlib.pyplot as plt
import sys
from operator import mul

ans=True
while ans:
print(&quot;&quot;&quot;
1.Facto full
&quot;&quot;&quot;)
ans=input(&quot;What would you like to do? &quot;)
return ans
if ans==1:
print(&quot;\nPre enter matrix&quot;)
break
elif ans==2:
print(&quot;\nMy matrix&quot;)
break
elif ans==3:
print(&quot;\nFacto full&quot;)
break
else:
print(&quot;\n Not Valid Choice&quot;)
def create_matrix():
lignes = input(&quot;How many lines in your matrix ? &quot;)
matrix = []
for i in range(0,lignes):
Value = raw_input(&quot;Enter row no &quot;+str(i)+&quot; values : &quot;)
Value = map(int, Value.split())
matrix.append([Value])
Size = len(matrix)
Matrix = matrix [0]
for i in range (1,Size):
return Matrix, lignes
Y = []
expirementation.&quot;)
for i in range(0,i):
v = raw_input(&quot;Result &quot;+str(i)+&quot; : &quot;)
Y.append([v])
Y = np.array(Y,dtype=float)

return Y
def interactions(a,lignes,colonnes):
Moyenne = np.mean(a[:,colonnes-1])
print (&quot;b0 = %s&quot; % Moyenne)
Intera = True
while Intera:
b = np.ones(lignes)
Intera = raw_input(&quot;Which parameters you want study ?
Separate numbers by an espace : &quot;)
if Intera == &quot;&quot;:
break
Inter = map(int, Intera.split())
Inter = reduce(mul,[a[:,x-1] for x in Inter])
b = np.mean(Inter*a[:,colonnes-1])
print b
if ans == 1:
a, lignes = create_matrix()
print a
a = np.column_stack((a,Y))
lignes, colonnes = a.shape
interactions(a,lignes,colonnes)
sys.exit(1)
elif ans==2:
a, i = create_matrix()
else:
x = input (&quot;Numbers of parameters (maximum 7)? : &quot;)
if x &lt; 4:
i=4
elif x &gt;= 4 and x &lt; 8:
i=8
else:
print (&quot;Too much parameters for this program&quot;)
x = i-x
while x &gt; 0:
a = np.delete(a,0,1)
x = x-1
print (&quot;Here it is the matrix we will use, please make your experiences
following this order.&quot;)
print a
x = input (&quot;How many variables do you study ? : &quot;)
for k in range(0,x):

B = np.dot (np.linalg.inv(np.dot(a.T,a)),np.dot(a.T,Y))
k = k+1
raw_input(&quot;Name of the study variable : &quot;)
print (&quot;Weight of each parameters : &quot;)
moy = np.mean(Y)
print B,moy
#plt.plot(B,&quot;rs&quot;)
#plt.axhline(y=0)
#plt.xlabel(&quot;Parameters&quot;)
#plt.ylabel(&quot;weight&quot;)
#plt.show()