Home

Notes II: Economics, Medicine, (Geo)politics, Technology, Science

This is a place for me to take notes and write thoughts on economics, medicine, (geo)politics, and technology.

The process of learning about these items follows a depth-first search algorithm, often using Wikipedia as the root node and following the search across a multitude of websites.

Blockquotes (see below for example) are essentially direct quotes. For example, if the quote says "In our lives, we are constantly ...", I will shorten it to "We are constantly ...". No information is lost, but the note is shorter for reference and typing. Anything in [square brackets like this] is my personal note.

This is a blockquote example [and here is a personal note].

Notes Series

Notes I: Papers, posts, ideas, information

Notes II: Economics, medicine, (geo)politics, technology, science

Notes III: Books, podcasts

Notes IV: Electronics

Notes V: Miscellaneous


Contents


Economics

Bullwhip Effect

The bullwhip effect occurs when:

orders to suppliers tend to have a larger variability than sales to buyers, which results in an amplified demand variability upstream. In part, this results in increasing swings in inventory in response to shifts in consumer demand as one moves further up the supply chain

(Y/N)IMBY

YIMBY and NIMBY stand for "yes/no, (not) in my backyard", the former of which supports increasing housing supply within cities where costs have increased substantially. This is often done through rezoning to create denser housing and/or through repurposing of unnecessary buildings.

Additional housing supply has been shown to not increase nearby rents (proven in NYC, San Francisco, Helsinki, and others).

Strict land use regulations appear to stifle the economy.

This Reddit question-answer thread does a decent job of summarizing arguments:

The question:

As somebody who has never been to San Francisco, can somebody explain the NIMBY political issue to me? I've seen it mentioned here and there, Scott's mentioned it, always in a way that assumes the reader understands what is being talked about. It seems to have to do with development of new residential buildings and the price of housing. What exactly are the sides, though, what are their main talking points? Do the two sides neatly line up with sides of the broader culture war?

The answers:

  1. u/sohois:

    First, it's worth bearing in mind that NIMBYism as an issue extends to basically all developed countries and cities, there are almost no places that are building enough housing/infrastructure/new cities.

    NIMBY as an acronym stands for "not in my back yard", i.e. build those houses somewhere else, not in my back yard. In its early forms, NIMBYism didn't have too much to do with house prices, as house prices have only gone out of control in the past 20 years or so, and more reflected the intrinsic desire not to live near certain things. People understood that there needed to be a certain number of power plants, or homeless shelters, or landfills, or cemeteries, but they didn't want to live near them.

    But nowadays the dominant strain of NIMBYism is related to soaring house prices. Or at least, that's what opponents of NIMBYs say, NIMBYs themselves will often argue about things like "neighbourhood character" or lack of local infrastructure (that nimbys would also block attempts to build more infrastructure does not go unnoticed).

    The biggest issue with NIMBYism as a political force is that it is very organic, no persons or parties declare themselves to be "pro-NIMBY", but no one wants to take a hit on their house price, or be the guy to tell their constituents that they need to live next to a sewage works. NIMBY regulations were largely well-intentioned pieces that aimed to prevent things like crappy or ugly buildings. For example, in San Fran a major barrier to housing development is mandatory parking minimums, which require a certain amount of car parking to be provided for each new dwelling. This makes intuitive sense, as America is a car country and cars tend to be very necessary, but there are loads of places in San Fran that could get by without so many cars and parking spaces.

    As far as sides go, you tend to have homeowners, property developers and investors on the NIMBY side, while YIMBY attracts economists and renters. As homeowners are the majority in many countries, their voting power has entrenched NIMBY interests. I wouldn't say that NIMBy v YIMBY matches well to political positions, however. In practice, all the major parties in most countries are pro-nimby because the voting bloc is too strong.

  2. u/yrrosimyarin:

    Broadly, NIMBY folks are opposed to new development, especially new high density development. There are a few core reasons:

    1. They spent a lot of money on their house, and they do not want new development to reduce its value.
    2. They bought into a neighborhood with a certain character, and they do not want that character to change.
    3. Related to the above, new high density development that is affordable and/or oriented around public transportation is seen as increasing crime rates.
    4. Related to the above, new high density development that is not affordable is seen as only increasing crowding while catering to the rich.

    NIMBY that you hear about tends to lean mainstream progressive. But that’s mostly because of who lives in the areas affected by sky-high housing costs, and who have generally higher building regulations to begin with. There are plenty of signs out in rural areas saying “no prime farmland for solar” or something, but that isn’t as directly relevant to either bay area rationalists or mainstream journalists.

    The “conservative” solution to the problem tends to be “make regulations that support building wide” and Houston or Atlanta style sprawl for miles. The “progressive” solution is traditionally rent control. The former of these makes housing affordable but commutes miserable. The latter of these is actively counter productive and violated all economic principles.

    YIMBY as the “believe the economists but still love cities” tends to be more grey tribe adjacent culturally. It takes some faith in economic principles and generally preference for utilitarianism to buy into the idea that building a bunch of high density luxury apartments will (eventually) result in cheaper housing overall.

And a good reply to the second comment (u/yrrosimyarin) quoting the penultimate paragraph ("The 'conservative' solution..."):

The former one also only works when the geography allows it, and only works for so long. Eventually you build out all the land in drivable distance of the city center at single family densities, and just have a bidding war for the houses. Los Angeles is the classic example of sprawl just hitting the physical limits of how far it can go and then you see an upward cost spiral.

San Francisco has it worse both because of the tech industry just being a huge income driver, and the geography being really shitty for sprawl.

See also:

Taxes

Taxes affect the economy in both the short- and long-term (from Tax Policy Center's briefing book). First, the short-term.

[In the short term:] primarily through their impact on demand. Tax cuts boost demand by increasing disposable income and by encouraging businesses to hire and invest more. Tax increases do the reverse. These demand effects can be substantial when the economy is weak but smaller when it is operating near capacity.

This can be quantified using the so-called "output multiplier":

How much tax cuts boost demand (or tax hikes restrain it) depends on the sensitivity of household and business behavior—for example, how households divide increased after-tax income between consumption and saving, and whether businesses choose to hire and invest more. Economists summarize these effects in a simple measure, the output multiplier, expressing how many dollars of increased economic activity result from a dollar reduction in taxes or a dollar increase in government spending.

In general, tax cuts do not help as much as spending increases do:

CBO’s estimates suggest that, dollar for dollar, tax cuts are often a less effective means of stimulus than are spending increases. If the federal government purchases goods and services itself (or helps state and local governments do so), most or all of the spending will boost demand. If the government cuts personal taxes, however, a substantial amount of the added spending power leaks into saving.

Now, the long-term:

[In the short term:] Primarily through the supply side. High marginal tax rates can discourage work, saving, investment, and innovation, while specific tax preferences can affect the allocation of economic resources. But tax cuts can also slow long-run economic growth by increasing deficits. The long-run effects of tax policies thus depend not only on their incentive effects but also their deficit effects.

Benefits:

taxes can affect both supply and demand factors. Reducing marginal tax rates on wages and salaries, for example, can induce people to work more. Expanding the earned income tax credit can bring more low-skilled workers into the labor force. Lower marginal tax rates on the returns to assets (such as interest, dividends, and capital gains) can encourage saving. Reducing marginal tax rates on business income can cause some companies to invest domestically rather than abroad. Tax breaks for research can encourage the creation of new ideas that spill over to help the broader economy.

(The marginal tax rate is the tax rate paid on additional dollar of income, or the tax rate paid at each of the tax brackets. Effective tax rates are calculated by summing total marginal tax values and dividing by total taxable income (individual) or earnings before taxes (corporation). An example can be found on the marginal tax rate page linked at the beginning of this paragraph.)

Pigouvian Tax

a tax on any market activity that generates negative externalities (i.e., external costs incurred by the producer that are not included in the market price). The tax is normally set by the government to correct an undesirable or inefficient market outcome (a market failure) and does so by being set equal to the external marginal cost of the negative externalities.
Pigouvian subsidy to help consumers pay for socially beneficial products and encourage increased production
... argued that Pigouvian taxes alone would not create an efficient outcome in the long run, because the taxes controlled only the scale of the individual firms, not the number of firms in the particular industry. ... if the firms each produced a fraction of what they produced before, but the number of firms increased exponentially, the amount of pollution would still increase. ... recommend a policy ... to regulate the number of firms in an industry: lump-sum taxes or lump-sum subsidies. ... The best option is to add an entry tax for potential firms and a subsidy for current firms to restrict a movement in the number of firms.

Examples:

Environmental taxes; Carbon taxes; Fuel taxes; Severance taxes; Land value taxes (LVT) on the unimproved value of land; Taxes on congestion; Noise taxes; Plastic taxes (e.g on plastic bags); Fat taxes; Meat taxes; Sugar taxes; Tobacco taxes, mainly due to passive smoking; Cannabis taxes, mainly due to passive smoking; Alcohol taxes; Sin taxes in general; Luxury taxes; Tobin tax against speculation in the financial markets; Chewing gum tax with the proceeds going towards street sweeping and other measures to rectify the pollution from the general thoughtlessness of chewing gum littering.

Criticisms:

the measurement of social cost is almost impossible ... if a measurement of the psychological effect of some externality did exist, it would be impossible to collect that data for all individuals affected and then find the optimum output level ... best solution is to set a minimum standard of acceptability for negative externalities and create tax systems to achieve those minimum standards
the tax placed on an industry creating a negative externality should not be changed after it is implemented ... each time the tax increases, the population increases and the marginal cost of the status quo increases again

Harberger Tax

Owners periodically self-assess their property and pay tax on its value; Others are able to purchase the property from the owner at the taxed price at any time, forcing a sale.

Medicine

Non-Steroidal Anti-Inflammatory Drugs (NSAIDs)

Arthritis Foundation's NSAID guide:

NSAIDs work by preventing an enzyme called cyclooxygenase (COX) from making hormone-like chemicals called prostaglandins. Prostaglandins are one of the body’s biggest contributors to inflammation.

Your body makes two different kinds of cyclooxygenase: COX-1 helps protect your stomach lining and COX-2 plays a role in inflammation. Most NSAIDs are nonspecific, meaning they interfere with both COX-1 and COX-2. While this helps relieve pain and inflammation, it also leaves your stomach vulnerable to ulcers and bleeding. A specific type of NSAID, called a selective COX-2 inhibitor, blocks the COX-2 enzyme more than the COX-1 enzyme. The only selective COX-2 NSAID currently available in the United States is the prescription drug celecoxib (Celebrex).

There is mixed evidence regarding taking NSAIDs with food, but generally seems to point to two conclusions:

  1. Taking NSAIDs without food is healthy if NSAIDs are taken INfrequently
  2. Taking NSAIDS without food if NOT healthy if NSAIDs are taken frequently

Systemic NSAID effects rather than “topical” effects appear to be the major cause of serious GI adverse effects associated with NSAID use. Prostaglandins are important mediators in the maintenance of the protective mucous lining the GI tract. By inhibiting prostaglandins NSAIDs reduce this protection and leave the mucosa more susceptible to the damaging effects of gastric acid and digestive enzymes. NSAID-induced platelet inhibition and reduction in mucosal blood flow may also be factors.

Serious GI symptoms are more likely to occur with higher doses and longer duration of NSAID therapy

Side effects include gastrointestinal problems (including bleeding, ulcers, and indigestion), kidney disease, adverse cardiovascular events (heart attack, stroke).

Aspirin is an NSAID, but with the added effect of suppressing platelet function (i.e., thins bloods).


Politics


Technology

O-Rings

O-rings are used to seal connections between two moving or non-moving parts that may contain fluids, gases, and high or low pressures.

Common O-Ring Characteristics

hardness compression set ratings temperature range resistances

PID Controllers

PID controllers attempt to match the actual value of a parameter to its desired setpoint by calculating an error value and correcting it based on three terms:

Putting all three together, the control function is:

\[u(t) = K_{p}e(t) + K_{i} \int_{0}^{t}e(\tau)d\tau + K_{d} \frac{de(t)}{dt}\]

Tuning

An overview of PID tuning methods can be found here.

Manual tuning involves the following procedure (taken from an uncited Wikipedia paragraph):

  1. Set \(K_{i}\) and \(K_{d}\) to zero
  2. Increase \(K_{p}\) until the output begins to oscillate
  3. Increase \(K_{i}\) to correct any offsets
  4. Increase \(K_{d}\) to improve the the time in which the output reaches the setpoint

Cascade Control

Cascade control uses two PID controllers: one controlling an outer loop and one controlling an inner loop. An example is given:

For example, a temperature-controlled circulating bath has two PID controllers in cascade, each with its own thermocouple temperature sensor. The outer controller controls the temperature of the water using a thermocouple located far from the heater, where it accurately reads the temperature of the bulk of the water. The error term of this PID controller is the difference between the desired bath temperature and measured temperature. Instead of controlling the heater directly, the outer PID controller sets a heater temperature goal for the inner PID controller. The inner PID controller controls the temperature of the heater using a thermocouple attached to the heater. The inner controller's error term is the difference between this heater temperature setpoint and the measured temperature of the heater. Its output controls the actual heater to stay near this setpoint.

From Cascade Control:

The simplest cascade control scheme involves two control loops that use two measurement signals to control one primary variable. In such a control system, the output of the primary controller determines the set point for the secondary controller. The output of the secondary controller is used to adjust the control variable. Generally, the secondary controller changes quickly while the primary controller changes slowly. Once cascade control is implemented, disturbances from rapid changes of the secondary controller will not affect the primary controller.

Check Valves

Check valves allow liquid or gas to flow through it in one direction. The cracking pressure is the minimum differential pressure between inlet and outlet that allows the gas to flow. Sufficient pressure opens the valve enough for the gas to flow by. For example, a ball check valve has a ball attached to a spring that opens when inlet pressure is greater than outlet. Other types include spring loaded in-line, diaphragm,

Being practically one-way, check valves prevent backflow and thus any contamination that results from backflow. This requires a leak-tight seal (which can wear over time, depending on the application) and fast closing (helped by gravity and/or a fast spring).

Follow-up question: is there a range of cracking pressures that correspond to a range of flows (i.e., it's not a binary open or closed)? If yes, this means a check valve can operate as a flow controller based on pressure.

Mass Flow Controllers

Mass flow controllers (MFC) are used to flow a gas or liquid (gas is used throughout this section) at a specific rate. In contrast, mass flow meters do not allow for control of the gas, only measurement. Most industrial-grade MFCs are thermal MFCs.

The most reliable method of MFC calibration is to calibrate it to a single gas and use it for a single gas. If needed, gas correction factors (GCFs) can be used to flow a different type of gas. Generally, a N2-based MFC is used. A list of common GCFs can be found here.

MFCs have ranges in the SCCM (standard cubic centimeters per minute) or SLM (standard liters per minute range) range. Flowing the upper values of these scales is not always completely achievable, e.g., flowing 49 SLM through a 50 SLM MFC may not happen (this is based on personal experience). Often times the bottom and top 10% ranges aren't used. MFCs come with a zeroing function—normally in the form of a button for digital devices and a potentiometer for analog devices—that allow the user to tell it when there is zero gas flowing through it. Brooks Instruments offers the following zeroing advice:

Wikipedia describes the MFC's inlet pressure requirement well:

Mass flow controllers require the supply gas or liquid to be within a specific pressure range. Low pressure will starve the MFC of fluid and cause it to fail to achieve its setpoint. High pressure may cause erratic flow rates.

Thermal MFC operation is explained by MKS:

The sensor is mounted on a side stream that takes a known ratio of the gas flow passing through the MFM. In a three-wire sensor configuration, the MFM uses high temperature coefficient of resistance wires as sensors to measure the temperature differential (\(\Delta T = T_{2} - T_{1}\)), across a heater mounted on the side stream as shown in Figure 4. This temperature differential is directly proportional to the mass flow rate:

\[\text{mass flow rate} = \frac{\alpha \cdot P_{W}}{\Delta T \cdot C_{p}}\]

where \(P_{W}\) is the heater power setting, \(C_{p}\) is the heat capacity of the gas, and \(\alpha\) is a proportionality constant.

Thermal MFCs are both accurate and repeatable, precisely controlling gas flows between 2 and 100% of their Full Scale reading with a resolution of 0.1%

Proportional solenoid valves are generally used as the controlling element in an MFC. Pneumatic- or servo-driven motors may also be used, but solenoid-driven valves are generally more reliable and accurate.

MFCs are set as normally open (NO) or normally closed (NC). (NO) MFCs should be used when it's fine for the gas to be flowing the entire time, e.g., an MFC that allows N2 to purge a loading area or non-processing chamber. If something interrupts the MFC's operation, it simply goes back to being completely open. (NC) MFCs should be used for hazardous gases or when it being fully open after an issue can present problems with the process it's being used for.


Science

Design of Experiments (DOE)

Unfinished as of 10 July 2022, but publishing for now. May return in the future as needed.

Overview

The following notes are taken from NIST's Process Improvement chapter of their Engineering Statistics Handbook.

DOE is used to maximize the amount of information given per individual experiment (as part of a set of experiments). This advantageous in terms of time, effort, and cost. More information per unit time is obviously good; experiments don't have to spend as much effort collecting data; and experiments can be costly—minimizing number of experiments to get the same information is beneficial for funders and experimenters.

Inefficient design can lead to little information but high effort and cost. A little thinking can go a long way!

Two models are used to fit curves to data. Linear and quadratic (respectively shown below):

\[Y = \beta_{0} + \beta_{1}X_{1} + \beta_{2}X_{2} + \beta{12}X_{1}X_{2} + \text{experimental error}\] \[Y = \beta_{11}X_{1}^{2} + \beta_{22}X_{2}^{2} + \beta_{33}X_{3}^{2}\]

In these models, \(X_{1}\) and \(X_{2}\) are the main effects (or controlled inputs, or factors) and the \(\beta\) terms are coefficients. The \(X_{1}X_{2}\) term is used to check for interactions between the two. For the linear model (and quadratic, but the following is often not included), many more factors can be included, but the model becomes quite complicated with \(2^{n}\) terms.

Applications

Considerations

Notes on residuals:

Residuals are the differences between the observed and predicted responses
Residuals can be thought of as elements of variation unexplained by the fitted model. Since this is a form of error, the same general assumptions apply to the group of residuals that we typically use for errors in general: one expects them to be (roughly) normal and (approximately) independently distributed with a mean of 0 and some constant variance.

Histograms, normal probability plots, and dot plots can be used to check the behavior of residuals. What happens if the three figures do not show a normally-distributed residual set? S-shaped NPPs imply bimodal distributions, where a very rough L-shaped (or flipped-along-its-vertical-axis L) graph implies a unimodal distribution at one extreme.

Residuals can also be tested over the course of multiple experiments to check for time dependency.


See Also