Published
Edited
Mar 6, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
alpha_jackpot = -beta_jackpot
Insert cell
Insert cell
Insert cell
draw((data) => {
const {x: t, y: ys} = data;
return [{
x: t,
y: ys.map( (y, i) => [getProfitRate(t[i], y[0], y[1])] ),
color: PROFIT_RATE_COLOR,
size: 1,
}];
}, { yRange: [0, 150]})
Insert cell
draw((data) => {
// q = a l
const q = (time, u, v) => (0.5 * Math.exp(alpha_jackpot*time))*(v*0.5 * Math.exp(beta_jackpot*time))
const {x: t, y: ys} = data;
const lines = [];
lines.push({
x: t,
y: ys.map( (y, i) => [q(t[i], y[0], y[1])] ),
color: '#000000',
size: 1,
label: 'gross output'
});
return lines;
}, { yRange: [0, 1], xRange: [0, 100]} )
Insert cell
Insert cell
policyCtrl = radio({
title: 'Policies',
description: 'Please select a policy to apply',
options: [
{ label: 'Steady State', value: 'steady-state' },
{ label: 'None', value: undefined },
],
value: undefined
});
Insert cell
viewof policy = policyCtrl
Insert cell
updatePolicy = () => {
console.log(policy)
switch (policy) {
case 'steady-state':
setSteadyState();
break;
default:
break;
}
return;
}
Insert cell
updatePolicy()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
draw2((data) => {
// q = a l
const q = (time, u, v) => (0.5 * Math.exp(alpha_jackpot2*time))*(v*0.5 * Math.exp(beta_jackpot2*time))
const {x: t, y: ys} = data;
const lines = [];
lines.push({
x: t,
y: ys.map( (y, i) => [q(t[i], y[0], y[1])] ),
color: '#000000',
size: 1,
label: 'gross output'
});
return lines;
}, { yRange: [0, 100], xRange: [0, 100]} )
Insert cell
md`## Source code`
Insert cell
shareProCapite = (t, u, _v) => u/workforceAt(t)
Insert cell
shareProCapite2 = (t, u, _v) => u/workforceAt2(t)
Insert cell
SHARE_PRO_CAPITE_COLOR = colors[3]
Insert cell
SHARE_PRO_CAPITE_COLOR2 = colors2[3]
Insert cell
workforceAt = (time) => 0.5 * Math.exp(beta_jackpot*time)
Insert cell
workforceAt2 = (time) => 0.5 * Math.exp(beta_jackpot2*time)
Insert cell
import {slider} from "@jashkenas/inputs"
Insert cell
import {
draw,
gq,
gl,
gw,
getProfitRate,
GQ_COLOR,
PROFIT_RATE_COLOR,
OUTPUT_SHARE_COLOR,
EMPLOYMENT_RATE_COLOR,
colors,
setSteadyState,
} with { beta_jackpot as beta, alpha_jackpot as alpha } from "@mstn/cyberpunk"
Insert cell
import {
draw as draw2,
gq as gq2,
gl as gl2,
gw as gw2,
getProfitRate as getProfitRate2,
GQ_COLOR as GQ_COLOR2,
PROFIT_RATE_COLOR as PROFIT_RATE_COLOR2,
OUTPUT_SHARE_COLOR as OUTPUT_SHARE_COLOR2,
EMPLOYMENT_RATE_COLOR as EMPLOYMENT_RATE_COLOR2,
colors as colors2,
setSteadyState as setSteadyState2,
} with { beta_jackpot2 as beta, alpha_jackpot2 as alpha } from "@mstn/cyberpunk"
Insert cell
import {radio} from "@jashkenas/inputs"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more