-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.py
49 lines (38 loc) · 917 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import numpy as np
from CGMoms import *
print("Example test case.")
print("")
MU = [3, 4]
#MU = [0,0]
SIGMA = [[5,6],[6,7]]
#SIGMA = [[5,0],[0,5]]
alpha = [1,2]
alpha_vals = [[0,0],
[1,0],
[0,1],
[2,0],
[1,1],
[0,2],
[3,0],
[2,1],
[1,2],
[0,3]]
print("alpha:")
print(alpha)
print("MU:")
print(MU)
print("SIGMA:")
print(SIGMA)
print("")
print("Moment of order alpha:")
print(CGMoms_Kan(alpha, MU, SIGMA))
print("")
print("alpha_vals:")
print(alpha_vals)
moms=CGMoms(alpha_vals, MU, SIGMA)
alpha_vals = np.array(alpha_vals) # ensure alpha_vals is a np.array
MU = np.array(MU) # ensure MU is a np.array
MU = np.reshape(MU, MU.size) # ensure MU is a vector
SIGMA = np.array(SIGMA)
print("Moments of order alpha_vals:")
print(np.hstack((alpha_vals,np.reshape(moms,(moms.size, 1)))))