Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
act65 committed Oct 8, 2024
1 parent dfe95be commit 45b3665
Show file tree
Hide file tree
Showing 16 changed files with 228 additions and 93 deletions.
3 changes: 1 addition & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ ideas
- how many different types of memory are there?
- are markets really efficient? What are the alternatives?
- the importance of good audio design?! A set of 3d scenarios. With the player turning their head / moving.
With poor / good audio design
-
- what's the best way to shuffle? mixing?
4 changes: 4 additions & 0 deletions _bibliography/pits.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---
References
==========
File renamed without changes.
77 changes: 77 additions & 0 deletions _drafts/inbetween-posts/2018-11-05-my-insurance-company-ipo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: "IPO: An 'ethical' insurance company!"
layout: post
subtitle: Preventive healthcare and an attempt to align the incentives of the insurer and the insured.
categories:
- "economic"
---


Hello potential customer, welcome. Here is the pitch:

Purchase health insurance from us for $5,000 per year.
You can reduce that cost by giving us information and following our advice.

Our business model is simple.

We make money by reducing the costs of your health care.
We set your insurance cost to be the average cost of health care.
We bet that the advice we give, the regular check ups we schedule, the nudges we provide, will make you healthier.
Thus, we make money and you live longer!


We do this by providing preventive care and by nudging you to take care of yourself.

- If we can catch the cancer early (through regular screening), we make money.
- If we prevent a heart attack (through your diet and exercise reigime), we make money.
- If we catch a calcium defficiency early (through regular blood tests) and thus avoid a potential broken bone, we make money.

Gambits / nudges:

<!-- behaviourial econ? -->

- If you agree to have your genome sequenced, we will reduce the cost by $500 per year (we pay for the sequencing).
- If you wear a fitness tracker and hit predetermined goals we will reduce the cost by $250 per year.
- If you show up to your 3 month check up we will reduce the cost by $50.

## Preventative healthcare

![]({{site.baseurl}}/assets/my-insurance-company-ipo/care.png)

It is well known that our current system is lazy. We wait utill you are sick, or have noticable symptoms, before we act.
Often this is too late, the health outcomes are poor and the costs are high.

For example, aetherosclerosis (the build up of plaque in your arteries) is a slow process that can start in your 20s. It can lead to a heart attack in your 50s. Depending on how early we catch it, the cost of treatment can vary from $0 (if we change your diet and exercise) to $30,000 for an angioplasty to $100,000 (if we catch it late).

Preventative healthcare is the idea that we can reduce the costs of health care by preventing diseases before they occur. This is done by regular check ups, screenings, and by nudging you to take care of yourself. While most agree that this is a good idea, the current system does not incentivise this behaviour.

## Aligning incentives

The incentives of current insurers and insured are not well aligned.
Your insurer makes money as long as you are alive to pay your premiums.
Though, if you bound to a hospital bed, they simply increase your premiums.

<!-- Make money vs live a long healthy life. -->

<!-- how does helth insueance work. does it increase in cost over time? -->


Now, I claim, we, the insurance providers, have a large incentive to accurately forecast your future health, and to gather information that is predictive of future complications and to act to minimise your health care costs.

Imagine (or maybe you don't have to...). Your genome reveals that you have the HER2 gene. We schedule and pay for regular screenings starting from when you turn 40. The logic being that the earlier we catch the cancer, the less damage it does and thus we have a smaller bill to insure! A win-win!


## Nudges

<!-- review the concept here? -->

## Problems

There are some problems I can see with this idea:

__Privacy__. To make accurate predictions, we need to know a lot about you. This may concern some. There may be ways to mitigate this concern through clever use of encryption and other technologies.

__Gaming our system__. It's easy to imagine people trying to game our system. For example, they could wear a fitness tracker on their dog and claim the steps as their own. Care will have to be taken in designing our nudges and rewards to avoid this.

__Fairness__. We need to make sure that our system is fair.
We don't want to charge people more for insurance due to factors out of their control (e.g. their genome).
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "The future of Model based RL?"
date: "2020-01-10"
coverImage: "reinforcement_learning_diagram.png"
permalink: /models-for-hire/
layout: post
---

Expand Down
14 changes: 13 additions & 1 deletion _drafts/technical-posts/2023-05-10-mean.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,16 @@ Consider a bi-modal distribution.
With (sharp) modes at -x and x. The mean is 0. But, we would never see a sample at 0.

Stranger than this example is a high dimensional Gaussian distribution, with mean $\mu$ and covariance $\sigma I$. As n increases, the samples concentrate on a thin shell around the surface of a hypersphere. This hypersphere has radius $\sqrt{n} \sigma$.
Thus the samples are a factor of $\sqrt{n}$ away from the mean.
Thus the samples are a factor of $\sqrt{n}$ away from the mean.


***

<!--
let's say i am taking n samples from a distribution, and i want to minimise (a property of the samples)
is it better to minimise the expected value.
or to mitigate the impact of the worst case?
-->
48 changes: 48 additions & 0 deletions _drafts/technical-posts/pits/2024-08-10-pits-main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "Projection into the typical set: PITS"
subtitle: "A new approach to solving inverse problems"
layout: post
permalink: /pits
categories:
- "research"
scholar:
bibliography: "pits.bib"
---

Inverse problems are a class of problems where we want to find the input to a function given the output. For example,

We consider the setting where we have access to a prior $p(x)$ and likelihood function $p(y \mid x)$. We observe $y$ and want to recover $x$.

Using Bayes rule, we can write the posterior as;

$$
\begin{align*}
p(x | y) &= \frac{p(y | x) p(x)}{p(y)} \tag{Bayes rule} \\
x^* &= \arg \max_x p(x | y) \tag{the MAP solution}
\end{align*}
$$

> MAP will return the most likely value of $x$, given $y$.
However, is the most likely value of $x$ the 'best' guess of $x$?

We offer an alternative approach, suggesting that our guess of $x$ should be typical. This frames the inverse problem as a problem of projection into the typical set (PITS).

$$
\begin{align*}
x^* &= \arg \max_{x \in \mathcal T(p(x))_\epsilon} p(y | x) \tag{PITS}
\end{align*}
$$

where $\mathcal T(p(x))_\epsilon$ is the $\epsilon$-typical set of $p(x)$.

We provide a few posts to help you understand PITS;

1. Background on typicality [link]({{ site.baseurl }}/pits/typicality)
2. MAP produces solutions that are not typical. [link]({{ site.baseurl }}/pits/map)
3. A method to apply PITS arbitrary distributions using neural flows. [link]({{ site.baseurl }}/pits/flow)
4. A demonstration of the PITS approach to inverse problems applied to neural flows. [link]({{ site.baseurl }}/pits/mnist-demo)

The advantages of this approach are;

- we have a way to control the quality (/typicality) of the solution. (missing from posterior sampling formulations)
- we can provide guarantees on ...?
83 changes: 83 additions & 0 deletions _drafts/technical-posts/pits/2024-08-10-pits-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: "The MAP solution is not the best solution?"
subtitle: "MAP produces solutions that are not typical"
layout: post
permalink: /pits/map
scholar:
bibliography: "pits.bib"
---

Here we pick the prior and likelihood to be Gaussian distributions.

$$
\begin{align*}
p(x) &= \mathcal{N}(0, \sigma_x^2) \\
p(y|x) &= \mathcal{N}(x, \sigma_y^2)
\end{align*}
$$

## MAP solution

For Guassian prior and likelihood, can derive the MAP solution in closed form as follows;

$$
\begin{align*}
x^*&= \arg \max_x \frac{p(y|x)p(x)}{p(y)} \\
&= \arg \max_x p(y|x)p(x) \\
&= \arg \max_x \log p(y|x) + \log p(x) \\
&= \arg \max_x -\frac{1}{2\sigma_y^2}||y - x||^2 - \frac{1}{2\sigma_x^2}||x||^2 \\
\end{align*}
$$

$$
\begin{align*}
\nabla_x \left( -\frac{1}{2\sigma_y^2}||y - x||^2 - \frac{1}{2\sigma_x^2}||x||^2 \right) &= \nabla_x \left( -\frac{1}{2\sigma_y^2}||y - x||^2 \right) + \nabla_x \left( -\frac{1}{2\sigma_x^2}||x||^2 \right) \\
&= \frac{1}{\sigma_y^2}(y - x) - \frac{1}{\sigma_x^2}x \\
&= 0 \\
x &= \frac{\sigma_x^2}{\sigma_x^2 + \sigma_y^2}y \\
p(x|y) &= \mathcal{N}\left(\frac{\sigma_x^2}{\sigma_x^2 + \sigma_y^2}y, \frac{\sigma_x^2\sigma_y^2}{\sigma_x^2 + \sigma_y^2}\right) \\
\end{align*}
$$

## PITS solution

For Gaussian distributions we can rewrite PITS as;

$$
\begin{align*}
x^* &= \arg \max_{x \in \mathcal T(p(x))_\epsilon} p(y | x) \tag{PITS} \\
&= \arg \min_{x \in \mathcal T(p(x))_\epsilon} \parallel x - y \parallel^2
\end{align*}
$$

Thus finding $x^*$ becomes a problem of finding the closest point in the $\epsilon$-typical set of $p(x)$ to $y$. Which can be calculated by normalising $y$.

$$
\begin{align*}
x^* &= \frac{y}{\parallel y \parallel}
\end{align*}
$$


## An illustrated example

Let's pick the prior to be a Gaussian distribution with mean 0 and standard deviation 1. And the likelihood to be a Gaussian distribution with mean 1 and standard deviation 0.5.


<img src="{{ site.baseurl }}/assets/pits/pits-ip.png">
<figcaption>Illustration of the inverse problem for a Gaussian prior and likelihood. Top;
</figcaption>

<img src="{{ site.baseurl }}/assets/pits/map-solns.png">
<figcaption>
The observed $y$'s are updated to be more likely under the prior.
</figcaption>

<img src="{{ site.baseurl }}/assets/pits/pits-solns.png">
<figcaption>
The observed $y$'s are projected into the typical set.
</figcaption>

## Bibliography

{% bibliography --cited %}
33 changes: 0 additions & 33 deletions _posts/inbetween-posts/2018-11-05-my-insurance-company-ipo.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
title: "Right beliefs, wrong reasons"
date: "2015-07-05"
categories:
- "politics-and-opinions"
- "philosophy"
coverImage: "download-2.jpeg"
layout: post
subtitle: It occured to me that my belief in evolution was just as illogical as others belief in god.
Expand Down
36 changes: 0 additions & 36 deletions archive/2020-06-10-equilibrium-prop.md

This file was deleted.

Binary file added assets/pits/map-solns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pits/pits-ip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pits/pits-solns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 0 additions & 18 deletions on_hold/2023-02-11-ethical-insurance.md

This file was deleted.

0 comments on commit 45b3665

Please sign in to comment.