Assume that:
- x[i] ~ Normal(0, 1) for all i
- c is a constant
Then the following operations have analytic results:
- x[1] + c ~ Normal(c, 1)
using Distributions | |
for sigma in -1:-1:-12 | |
p = 2 * cdf(Normal(0.0, 1.0), sigma) | |
n = round(BigInt, big(10)^(-log10(p))) | |
@printf("%d\t%s\n", -sigma, n) | |
end |
@doc """ | |
Search through all pairs of primes below n, then compute a table R[i, j] which | |
indicates the numbers of pairs (p, q) such that mod1(p, b) == i and | |
mod(q, b) + 1. | |
""" -> | |
function prime_pairs_mod_b(n, b, debug::Bool = false) | |
ps = primes(n) | |
R = zeros(Int, b, b) | |
for i in 1:(length(ps) - 1) | |
p, q = ps[i], ps[i + 1] |
In relation to the test of significance, we may say that a phenomenon is experimentally demonstrable when we know how to conduct an experiment which will rarely fail to give us a statistically significant result.
(Fisher 1947, p. 14)
From "Don't throw out the error control baby with the bad statistics bathwater: a commentary" by Deborah G. Mayo
# Generate a closure that computes the unnormalized negative log-posterior at | |
# any set of parameters. | |
function make_nlp( | |
n_legislators, | |
n_bills, | |
legislators, | |
bills, | |
votes, | |
) | |
function nlp(θ) |
To understand the design of the new Nullable
type in Julia 0.4, let's review how Julia worked in 0.3.
For the purpose of this discussion, there are only three things that matter in the Julia language: values, types and functions. 1
is a value; its type is Int
; and one(x::Int) = 1
is a function that maps any value of type Int
to the value 1
.
For the purposes of this note, we'll make the simplifying assumption that types are simply sets of values. For example, the type Int
is the set containing all of the valid Int
values: it is effectively equivalent to the set of values {..., -1, 0, 1, ...}
. In Julia, a type is uniquely defined by the set of values that it contains. At the same time, any value in Julia also has a unique concrete type, which is the smallest set that contains that value.
Given these three parts of the language, we want to introduce a new parametric class of values to represent the concept of nullness found in other languages. To help out type inference by pr
> library("dplyr") | |
Attaching package: ‘dplyr’ | |
The following objects are masked from ‘package:stats’: | |
filter, lag | |
The following objects are masked from ‘package:base’: |
"We are struck by the fact that in the social and behavioral sciences, | |
epidemiology, economics, market research, engineering, and even applied | |
physics, statistical methods are routinely used to justify causal inferences | |
from data not obtained from randomized experiments, and sample statistics are | |
used to predict the effects of policies, manipulations or experiments. Without | |
these uses the profession of statistics would be a far smaller business. It may | |
not strike many professional statisticians as particularly odd that the | |
discipline thriving from such uses assures its audience that they are | |
unwarranted, but it strikes us as very odd indeed." |
library("dplyr") | |
library("ggplot2") | |
packageVersion("dplyr") | |
packageVersion("ggplot2") | |
foo <- iris %>% group_by(Species) %>% summarize(m = mean(Sepal.Length)) | |
ggplot(foo, aes(x = 1, y = m)) + | |
stat_summary(fun.data = "mean_cl_boot", geom = "errorbar") |