Type Constructor
instance Functor ((->) r) where
fmap f g = (\x -> f (g x))
instance Functor ((->) r) where
fmap f g = (\x -> f (g x))
Professor writes down the Model
Student solves optimization problem
Learning how to solve well-posed problems
Lecturer writes down question
Student writes down the model
Solver solves the optimization problem
Judgement
Calculus
Statistics
Newspapers/Podcasts
Psychology
Sociology
Finance
Core of Economics
Write down question
Write down the model
Solver solves the optimization problem
You
Model
On the Computer
If you think something is new, you missed a class
On Paper
xs = jnp.linsapce(0., 5.0, 7)
initial value
final value
Number of elements
Vector of linearly spaced values
def f(x, y):
return 2*x + jnp.sin(y)
A Function
Two inputs
Output
g = partial(f, 2)
A Function
Is a higher order function (takes a function as input and returns a function)
Pass f as input
evaluate at x=2
def f(x, y):
return 2*x + jnp.sin(y)
A Function
Two inputs
Output
h = partial(f, y=3)
A Function
Is a higher order function (takes a function as input and returns a function)
Pass f as input
evaluate at y=3
def f(x):
return 2*x
A Function
One Input
Pass in a function
z = jax.vmap(f)
Vectorized Function
Output
Please write down a model that provides some insight about which types of firms might increase their production in the US in response to the Pandemic