<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Mossite</title>
    <link>/</link>
    <description>Recent content on Mossite</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 10 Mar 2023 00:00:00 +0000</lastBuildDate><atom:link href="/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A Markov experiment</title>
      <link>/2023/03/10/markov-chain/</link>
      <pubDate>Fri, 10 Mar 2023 00:00:00 +0000</pubDate>
      
      <guid>/2023/03/10/markov-chain/</guid>
      <description>Introduction Suppose you conduct an experiment of the following form. You start out with an \(X_0\), then do a binary experiment \(Y_1\) with conditional probability \(P(Y_1\mid X_0)=f_\theta(X_0)\). Then you choose your next value of \(X\) deterministically, based solely on the value of \(X_0\) and \(Y_1\) using a known \(g(x,y)\), i.e., \(X_1\mid Y_0,X_1 = g(X_1,Y_0)\). Doing this \(n\) times, you will get a sequence of values \(X_0,X_1,X_2,\ldots,X_n\) and \(Y_1,Y_2,\ldots,Y_n\).
Our goal is to do inference on \(\theta\).</description>
    </item>
    
    <item>
      <title>Some thoughts on spaced repetition systems and math.</title>
      <link>/2023/03/09/srs-math/</link>
      <pubDate>Thu, 09 Mar 2023 00:00:00 +0000</pubDate>
      
      <guid>/2023/03/09/srs-math/</guid>
      <description>Update: 2023-03-10. SRS should be especially suitable for math. Definitions, examples and Theorems are not only hard to understand, they are hard to remember. Would you remember what a normal subgroup is \(\sim10\) years after taking my algebra class? Probably not! Unless you had to use the concept several times the last few years.
Everyone says the same about spaced repetition systems (SRS). They work best to make sure you keep knowing what you know.</description>
    </item>
    
    <item>
      <title>On power analysis</title>
      <link>/2023/02/25/power-analysis/</link>
      <pubDate>Sat, 25 Feb 2023 00:00:00 +0000</pubDate>
      
      <guid>/2023/02/25/power-analysis/</guid>
      <description>Here’s a demonstration that you should do integrated, or Bayesian, power analysis when making power calculations. Consider the case when, to the best of your knowledge, the true effect size is distributed according to the gamma distribution with parameters \(2\) and \(2\). You know the standard deviation is 1, to keep things simple.
In this case, taking the mean of the effect size distribution (1) and do power analysis on that would be a mistake.</description>
    </item>
    
    <item>
      <title>Social scientists need mostly elementary mathematics</title>
      <link>/2022/08/31/social-science-math/</link>
      <pubDate>Wed, 31 Aug 2022 00:00:00 +0000</pubDate>
      
      <guid>/2022/08/31/social-science-math/</guid>
      <description>They need elementary math for many reasons.
Figure out precisely what you want to say. (Think e.g. the difference between the mean and median, what does “it’s 90% nutrition” mean.) Doing simple modeling. (I’m not an advocate of complicated economics style modelling such as general equilibrium, most uses of differential equations, and so on.) Gain awareness of important phenomena and understand how to deal with them. An example would be range restriction.</description>
    </item>
    
    <item>
      <title>Weight loss notes. Planning and keeping track.</title>
      <link>/2022/08/31/weight-loss/</link>
      <pubDate>Wed, 31 Aug 2022 00:00:00 +0000</pubDate>
      
      <guid>/2022/08/31/weight-loss/</guid>
      <description>I wanted to get an idea of how long it will take to reach my body fat percentage goal of 8% (I’m a male; females shouldn’t go this low.) So I wrote a small script.
We’ll need the following constant, an approximation of how many calories there is in a kilogram of body fat (i.e., adipose tissue).
kcal_per_kg &amp;lt;- 7700 Then you provide approximations for your average calorie expenditure and intake.</description>
    </item>
    
    <item>
      <title>Latent Poisson process and Laplace&#39;s rule</title>
      <link>/2022/06/15/poisson-laplace/</link>
      <pubDate>Wed, 15 Jun 2022 00:00:00 +0000</pubDate>
      
      <guid>/2022/06/15/poisson-laplace/</guid>
      <description>(Note: This is related to the post on Laplace&amp;rsquo;s rule).
For each interval length $s$ we have a sequence of binary variables $Y_{1}(s),Y_{2}(s),\ldots Y_{n/s}(s)$. We want to connect these variables, for each $s$, in a meaningful way and apply Laplace&amp;rsquo;s rule. One way to do so is by assuming a latent Poisson process.
Let $X_{t}$ be a Poisson process with parameter $\lambda$, $t\in[0,n]$. Then the number of observations in the time frame $[t,t+s]$ is distributed as $$ X_{t+s}-X_{t}\sim\text{Poisson}(\lambda s).</description>
    </item>
    
    <item>
      <title>Time in Laplace&#39;s rule in the context of a &#34;for all&#34; problem</title>
      <link>/2022/06/06/laplace/</link>
      <pubDate>Mon, 06 Jun 2022 00:00:00 +0000</pubDate>
      
      <guid>/2022/06/06/laplace/</guid>
      <description>We are working with a sequence of independent binary events on a discrete time-scale, say seconds, with success probability $\pi$. Call this sequence of events $X_{t}$, $t=1\ldots$. For instance, $X_{t}=1$ if it rains at second $t$ and $0$ otherwise. For each positive integer $m$, define the &amp;ldquo;for all&amp;rdquo;&#39;&#39;&amp;quot;-type variable
$$ Y_{t}^{m}=\begin{cases} 1 &amp;amp; \text{if }X_{t(m-1)+1}=\cdots=X_{tm}=1,\\ 0 &amp;amp; \textrm{otherwise}. \end{cases} $$
For instance, the variable $Y_{t}^{60}=1$ if it rained during the entirety of the the $t$th minute.</description>
    </item>
    
    <item>
      <title>Calculating the variance</title>
      <link>/2020/09/22/calculating-the-variance/</link>
      <pubDate>Tue, 22 Sep 2020 00:00:00 +0000</pubDate>
      
      <guid>/2020/09/22/calculating-the-variance/</guid>
      <description>Here&amp;rsquo;s how to prove that $$E[(y-\mu)^{T}A(y-\mu)]=E(y^{T}Ay)-\mu^{T}A\mu,$$
when $A$ is a matrix and $y$ a random vector with mean vector $\mu$.
$$\begin{eqnarray*} E[(y-\mu)^{T}A(y-\mu)] &amp;amp; = &amp;amp; E(y^{T}Ay-\mu^{T}Ay-y^{T}A\mu+\mu^{T}A\mu)\\ &amp;amp; = &amp;amp; E(y^{T}Ay)-E(\mu^{T}Ay)-E(y^{T}A\mu)+\mu^{T}A\mu \end{eqnarray*}$$
Here $$E(\mu^{T}Ay)=\mu^{T}AE(y)=\mu^{T}A\mu,$$ by linearity of the expectation operator. Likewise, $$E(y^{T}A\mu)=E(y)^{T}A\mu=\mu^{T}A\mu,$$
and $$E(y^{T}Ay)-E(\mu^{T}Ay)-E(y^{T}A\mu)+\mu^{T}A\mu=E(y^{T}Ay)-\mu^{T}A\mu$$ as claimed.</description>
    </item>
    
    <item>
      <title>Decision theory</title>
      <link>/2020/03/04/decision-theory/</link>
      <pubDate>Wed, 04 Mar 2020 00:00:00 +0000</pubDate>
      
      <guid>/2020/03/04/decision-theory/</guid>
      <description>Decision theory confuses me. On one hand, evidential decision theory is obviously wrong. On the other hand, causal decision theory is obviously applied incorrectly.
Evidential decision theory is wrong since it conditions on the act made. One reason why you shouldn’t do this is that this presupposes that your act is a random variable, itself strange, but it’s also conceptually wrong. Decision theory is about making choices, in most cases making a choice between random variables.</description>
    </item>
    
    <item>
      <title>Some advice</title>
      <link>/2020/01/16/some-advice/</link>
      <pubDate>Thu, 16 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>/2020/01/16/some-advice/</guid>
      <description>It is not my place to give advice about being an academic, but here I go anyway.
 Use a reference manager. Paperpile serves me well. Have a label or a folder for each paper you&amp;rsquo;re working on. You want to use a reference manager since your pdfs will make a garbled mess in no time. And it&amp;rsquo;s a pain to write the references into BibTex again and again and again!</description>
    </item>
    
    <item>
      <title>Fisher and Neyman</title>
      <link>/2020/01/05/fisher-and-neyman/</link>
      <pubDate>Sun, 05 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>/2020/01/05/fisher-and-neyman/</guid>
      <description>So what’s the deal with the conflict between Neyman and Fisher?
It appears to be this:
Neyman wanted to be explicit with alternative hypotheses. Neyman used the explicit alternative hypothesis to generate and prove the optimality of tests. Neyman wanted to calculate power and saw it as an important part of the whole hypothesis testing set up. Fisher used p-values while Neyman used fixed \(\alpha\)s. Fisher talked about inductive evidence while Neyman talked about inductive behavior.</description>
    </item>
    
    <item>
      <title>Problems with confidence intervals</title>
      <link>/2020/01/04/problems-with-confidence-intervals/</link>
      <pubDate>Sat, 04 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>/2020/01/04/problems-with-confidence-intervals/</guid>
      <description>In a sense, it is not reasonable to expect finite and well-behaved confidence for parameters. The argument goes as follows:
When testing parameters in classical settings such as for the t-test, the assumption of normality is crucial, or at least semi-crucial. It is possible to construct ok confidence intervals using the Berry-Esseen theorem, but it is at least sometimes possible to show that no well-behaved approximate confidence interval exists when we cannot reliably bound the third moment.</description>
    </item>
    
    <item>
      <title>Business science</title>
      <link>/2020/01/02/business-science/</link>
      <pubDate>Thu, 02 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>/2020/01/02/business-science/</guid>
      <description>How would you evaluate the quality of a typical business school scientific field? I am talking about for instance management, marketing, organizational psychology, accounting (is that a field though?), finance, strategy, et cetera.
The first rule of thumb could be to look at how quantitative the field is, using the idea that quantitative science is better than qualitative science. But there are some good reasons not to trust this rule of thumb.</description>
    </item>
    
    <item>
      <title>Good habits</title>
      <link>/2019/12/20/good-habits/</link>
      <pubDate>Fri, 20 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/12/20/good-habits/</guid>
      <description>You should develop good habits as a student, it is often said. Still, I was never guided in this. And I honestly don&amp;rsquo;t think my teachers had any good habits to teach anyway.
As a statistician, what habits should you definitely learn right away? I can think of some:
i) Good programming habits. Make projects or R-packages. Lint your code. Always write tests; plenty of tests. Document your code. Never skip documenting and testing your code!</description>
    </item>
    
    <item>
      <title>Papers are too long</title>
      <link>/2019/12/12/papers-are-too-long/</link>
      <pubDate>Thu, 12 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/12/12/papers-are-too-long/</guid>
      <description>Papers are too long.
The introductions are too long, the digressions are too long. There are too many results, there are too many words.
Here&amp;rsquo;s an ideal paper for me: Explain the problem in one paragraph. Say something about how other people have handled the problem in the next paragraph. Say something about related problems, if applicable. Then solve the problem.
How long will such a paper be? About two pages!</description>
    </item>
    
    <item>
      <title>Computer algebra systems</title>
      <link>/2019/12/05/computer-algebra-systems/</link>
      <pubDate>Thu, 05 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/12/05/computer-algebra-systems/</guid>
      <description>There are at leastttwo reasons to learn Maple or Mathematica, or maybe some open source alternatives such as Sage. These two reasons I&amp;rsquo;m thinking about are i) To actually be able to calculate difficult stuff, such as integrals with difficult integrands or horrible determinants. ii) To have a reliable way to verify your computations.
Obviously both of these are important. So why aren&amp;rsquo;t these programs more widely used? There might be a reason I am not aware of &amp;mdash; but I actually think there are some low-hanging fruits here.</description>
    </item>
    
    <item>
      <title>Automatic Testing</title>
      <link>/2019/12/04/automatic-testing/</link>
      <pubDate>Wed, 04 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/12/04/automatic-testing/</guid>
      <description>I believe it is important to improve the reliability of R programming. Packages such as testthat help with this, but these packages aren&amp;rsquo;t comprehensive enough. What I would like it more automatic testing. In some packages, univariateML being a great example, there are a lot of functions following the same basic prototype: Every function has the same formals and they return similar objects. What I would like is to specify the prototype and automatically check that each of the approximately 25 functions in univariateML adheres to it.</description>
    </item>
    
    <item>
      <title>Organizing Projects</title>
      <link>/2019/12/03/organizing-projects/</link>
      <pubDate>Tue, 03 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/12/03/organizing-projects/</guid>
      <description>My current main is problem is that I don&amp;rsquo;t manage to handle all my silly ideas and projects. I often work, say, 5 - 10 days on a project, manage to write down some results (some half-assed), then get myself back on track on my &amp;ldquo;real&amp;rdquo; project. The problem is that the projects aren&amp;rsquo;t finalized properly. For instance, I wrote quite a bit about transferring parameters in meta-analysis earlier this year.</description>
    </item>
    
    <item>
      <title>Rant about learning Japanese</title>
      <link>/2019/12/02/japanese-rant/</link>
      <pubDate>Mon, 02 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/12/02/japanese-rant/</guid>
      <description>The most difficult part of learning Japanese is to know what to do. I have motivation to do stuff, I just don&amp;rsquo;t know what that stuff is. That&amp;rsquo;s partly a lie though; I do plenty of stuff. It&amp;rsquo;s just that the stuff is inefficient, as all of it is memorization of kanji (chinese characters) and vocabulary. I also distrust most resources without any SRS: How can be reasonably sure I won&amp;rsquo;t forget what I&amp;rsquo;ve learned by a week without a program for reinforcing it?</description>
    </item>
    
    <item>
      <title>Counterfactuals in the Probit Model</title>
      <link>/2019/11/27/counterfactuals-in-the-probit-model/</link>
      <pubDate>Wed, 27 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/11/27/counterfactuals-in-the-probit-model/</guid>
      <description>This post is about counterfactuals in the probit model. I wrote this while reading Pearl et al’s 2016 book Causal Inference in Statistics: A Primer.
The probit model with one normally distributed covariate can be written like this:
\[ \begin{eqnarray*} \epsilon &amp;amp; \sim &amp;amp; N\left(0,1\right)\\ X &amp;amp; \sim &amp;amp; N\left(0,1\right)\\ Y\mid X,\epsilon &amp;amp; = &amp;amp; 1_{X+\epsilon\geq0} \end{eqnarray*} \]
Now we wish to find the density of the counterfactual \(Y_{x}\), see Pearl et al.</description>
    </item>
    
    <item>
      <title>Skolematematikk</title>
      <link>/2019/10/29/skolematematikk/</link>
      <pubDate>Tue, 29 Oct 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/10/29/skolematematikk/</guid>
      <description>Start med $\frac{3}{2y}-\frac{3z}{4}-\frac{1}{2}$. Nå bruker vi at vi kan gange med et tall (ulikt $0$) over og under brøkstreken:
$$\frac{3}{2y}=\frac{3\cdot2}{2y\cdot2}=\frac{6}{4y}$$
$$-\frac{3z}{4}=-\frac{3z\cdot y}{4\cdot y}=-\frac{3zy}{4y}$$
$$-\frac{1}{2}=-\frac{1\cdot2y}{2\cdot2y}=-\frac{2y}{4y}$$
Dermed er
$$\begin{eqnarray*} \frac{3}{2y}-\frac{3z}{4}-\frac{1}{2} &amp;amp; = &amp;amp; \frac{6}{4y}-\frac{3zy}{4y}+-\frac{2y}{4y}\\ &amp;amp; = &amp;amp; \frac{6-3zy-2y}{4y}\\ &amp;amp; = &amp;amp; \frac{-2y-3zy+6}{4y} \end{eqnarray*}$$</description>
    </item>
    
    <item>
      <title>About</title>
      <link>/about/</link>
      <pubDate>Fri, 04 Oct 2019 00:00:00 +0000</pubDate>
      
      <guid>/about/</guid>
      <description>This is my microblog. Each post has a specific purpose and will not always make sense in isolation. I am Jonas Moss by the way.
The theme was forked from @jrutheiser/hugo-lithium-theme and modified by Yihui Xie. To make a microblog like this, check out Blogdown</description>
    </item>
    
    <item>
      <title>First Post</title>
      <link>/2019/10/04/first-post/</link>
      <pubDate>Fri, 04 Oct 2019 00:00:00 +0000</pubDate>
      
      <guid>/2019/10/04/first-post/</guid>
      <description>I made this small site to be able to share small documents with mathematical notation. When I want to share snippets of code I use Gist, but it&amp;rsquo;s hard to use Latex there. Think of this microblog as a Gist for Latex.
Example of Latex Let $X$ be a metric space. A sequence of elements $x_i\in X$ converges to an $x\in X$ if there for every $\epsilon &amp;gt; 0$ is an $N$ such that if $n\geq N$ then $d\left(x_{n},x\right)&amp;lt;\epsilon$.</description>
    </item>
    
  </channel>
</rss>
