summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUser <bnewbold@daemon.robocracy.org>2009-11-17 21:32:21 +0000
committerUser <bnewbold@daemon.robocracy.org>2009-11-17 21:32:21 +0000
commitbafa4e42755a9ec419717c908a16aa6f2e768246 (patch)
tree136146b3f0e30e48cc31474eca15e9d85ad0208f
parente46de232709f0ac78266467fdb076c8da45b6e90 (diff)
parent266d85c512490d6e52b04f8d982a73ddd9dd9cfe (diff)
downloadknowledge-bafa4e42755a9ec419717c908a16aa6f2e768246.tar.gz
knowledge-bafa4e42755a9ec419717c908a16aa6f2e768246.zip
Merge branch 'master' of animus.robocracy.org:/srv/git/knowledge
-rw-r--r--math/statistics.page80
-rw-r--r--software/idl.page16
2 files changed, 94 insertions, 2 deletions
diff --git a/math/statistics.page b/math/statistics.page
new file mode 100644
index 0000000..446450f
--- /dev/null
+++ b/math/statistics.page
@@ -0,0 +1,80 @@
+Statistics
+====================
+
+Basic Measures
+-------------------------
+The sample distribution has finite size and is what has been measured; the
+parent distribution is inifinite and smooth and is the limit case of the
+sample distribution.
+
+The mean, or average, is (of course):
+$$\langle x \rangle = \frac{1}{N} \sum_{i=1}^{N}x_i$$
+
+The variance is;
+$$s^{2}_x = \frac{1}{N-1}\sum^{N}_{i=1}\left(x-\langle x \rangle\right)^2$$
+
+The standard deviation is the square root of the variance; the standard
+deviation of the parent distribution is represented by $\sigma_x$ instead of
+$s_x$. The mean of the parent distribution is $\mu$ instead of $\bar{x}$.
+
+Binomial Distribution
+-------------------------
+If we are playing a yes/no game (eg flipping a coin), the binomial distribution
+represents the probability of getting 'yes' $x$ times out of $n$ if $p$ is the
+probability of getting 'yes' for a single attempt.
+
+$$P(x;n,p) = \frac{n!}{x! (n-x)!} p^x (1-p)^{n-x}$$
+
+The mean of this distribution is $\mu = np$, and $\sigma$ = \sqrt{np (1-p)}.
+
+Poisson Distribution
+------------------------
+
+$$P(x,\mu) = \frac{\mu^x}{x!} e^{-\mu}$$
+
+The mean is $\mu$, and $\sigma=\sqrt{\mu}$.
+
+Gaussian Distribution
+--------------------------
+The classic! Also called a normal distribution.
+
+$$P(x;\mu,\sigma) = \frac{1}{2\pi \sigma} e^{-\left(\frac{(x-\mu)^2}{2\sigma^2}\right)}$$
+
+The mean is $\mu$ and the deviation is $\sigma=\sqrt(\mu)$.
+
+Lorentzian Distribution
+---------------------------
+This distribution represents damped resonance; it is also the Fourier
+transform of an exponentially decaying sinusoid.
+
+$$P(x;\mu,\Gamma) = \frac{1}{\pi} \frac{\Gamma/2}{(x-\mu)^2 + (\Gamma/2)^2}$$
+
+where the mean is $\mu$ and the linewidth (the width of the peak) is $\Gamma$.
+
+Error Analysis
+-------------------
+For a given measurement, the error on the mean is not the standard deviation
+(which is a measure of the statistics), it is $\frac{s_x}{\sqrt{N}}$: the
+standard deviation should stay roughly constant as $N$ gets very large, but
+the error on the mean should get smaller. More elaborately, if the errors are
+different for each individual measurement, the mean will be:
+
+$$\bar{x}=
+ \frac{ \sum_{i=1}^{N} x_i / \simga_{i}^2}{\sum_{i=1}^{N} 1/\simga_{i}^2}
+ \pm \sqrt{ \frac{1}{\sum_{i=1}^{N} 1/\simga_{i}^2}}$$
+
+$\Chi^2$ Distribution
+------------------------
+$\Chi^2$ is often writen "chi-squared" and is a metric for how well a fit
+curve matches uncertain data.
+
+$$\Chi^2 = \sum_{i=1}^{N}\left(\frac{x_i-\mu_i}{\sigma{i}}\right)^2$$
+
+The number of degrees of freedom of the system is the number of measurements
+$N$ minus the number of variable parameters in a curve fit $N_c$: $\nu = N-N_c$.
+
+The reduced $\Chi^2$ value is $\Chi^{2}_r = \Chi^2 /\nu$. You want $\Chi^{2}_r$
+to be around (but not exactly!) 1; if it is significantly larger there are
+probably too many degrees of freedom, while if significantly smaller the fit is
+bad.
+
diff --git a/software/idl.page b/software/idl.page
index e961a71..00b444a 100644
--- a/software/idl.page
+++ b/software/idl.page
@@ -16,8 +16,9 @@ Language Design
IDL is "pass by reference", which means that arguments to functions are always
variable pointers, not the actual value (the alternative is usually to pass by
-copy, where the value gets passed through to a new variable inside the function.One side effect of this is that return values are collected by passing a
-recieving variable name as an argument to functions.
+copy, where the value gets passed through to a new variable inside the
+function. One side effect of this is that return values are collected by
+passing a recieving variable name as an argument to functions.
Syntax
-----------------
@@ -30,4 +31,15 @@ Command Interface
Instead of the ever-standard ``!`` to execute system commands, use ``$``.
+X Windows
+--------------
+When used remotely with X Windows, sometimes plots don't refresh correctly
+(eg, blacked out after another window has covered them). To correct this issue,
+add these lines to your ``~/.Xdefaults``::
+ !stuff to manage IDL under 24-bit Linux displays
+ idl.retain:2
+ idl.gr_visual: TrueColor
+
+and then run ``xrdb -merge ~/.Xdefault``. (This tip from
+http://star.pst.qub.ac.uk/help/idl.shtml)