Skip to content

Commit dcaa8fc

Browse files
authored
np.ones * alpha -->> np.full(, alpah) in py files (#92)
1 parent 8739004 commit dcaa8fc

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

lectures/_static/lecture_specific/amss2/crra_utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def __init__(self,
77
β=0.9,
88
σ=2,
99
γ=2,
10-
π=0.5*np.ones((2, 2)),
10+
π=np.full((2, 2), 0.5),
1111
G=np.array([0.1, 0.2]),
1212
Θ=np.ones(2),
1313
transfers=False):

lectures/_static/lecture_specific/amss2/log_utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class LogUtility:
55
def __init__(self,
66
β=0.9,
77
ψ=0.69,
8-
π=0.5*np.ones((2, 2)),
8+
π=np.full((2, 2), 0.5),
99
G=np.array([0.1, 0.2]),
1010
Θ=np.ones(2),
1111
transfers=False):

lectures/_static/lecture_specific/amss2/recursive_allocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def res(z):
184184
n = z[S:]
185185
return np.hstack([Θ * Uc(c, n) + Un(c, n), Θ * n - c - G])
186186

187-
res = root(res, 0.5 * np.ones(2 * S))
187+
res = root(res, np.full(2 * S, 0.5))
188188
if not res.success:
189189
raise Exception('Could not find first best')
190190

lectures/_static/lecture_specific/amss2/sequential_allocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def res(z):
3535
n = z[S:]
3636
return np.hstack([Θ * Uc(c, n) + Un(c, n), Θ * n - c - G])
3737

38-
res = root(res, 0.5 * np.ones(2 * S))
38+
res = root(res, np.full(2 * S, 0.5))
3939

4040
if not res.success:
4141
raise Exception('Could not find first best')

lectures/_static/lecture_specific/opt_tax_recur/recursive_allocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class RecursiveLS:
88
def __init__(self,
99
pref,
1010
x_grid,
11-
π=0.5*np.ones((2, 2)),
11+
π=np.full((2, 2), 0.5),
1212
g=np.array([0.1, 0.2])):
1313

1414
self.π, self.g, self.S = π, g, len(π)

lectures/_static/lecture_specific/opt_tax_recur/sequential_allocation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SequentialLS:
1010

1111
def __init__(self,
1212
pref,
13-
π=0.5*np.ones((2, 2)),
13+
π=np.full((2, 2), 0.5),
1414
g=np.array([0.1, 0.2])):
1515

1616
# Initialize from pref object attributes
@@ -42,7 +42,7 @@ def find_first_best(self):
4242
'''
4343
S, g = self.S, self.g
4444

45-
res = root(self.FOC_first_best, 0.5 * np.ones(S), args=(g,))
45+
res = root(self.FOC_first_best, np.full(S, 0.5), args=(g,))
4646

4747
if (res.fun > 1e-10).any():
4848
raise Exception('Could not find first best')

0 commit comments

Comments
 (0)