Finite Population Sampling without Replacement
Personal note of finite population sampling
Posted on April 26, 2019
(Last modified on February 17, 2021)
| 2 minutes
| Vincent Tam
|
0 comment
First moment
Population: $ \Omega = \{ x_1, \dots, x_N \} $
Collection of $n$-samples:
$\mathcal{S} = \{ s \in \Omega^n \mid \forall i,j \in s, i \ne j \} $
Collection of $n$-samples containing $x$:
$ \mathcal{S}_x = \{ s \in \mathcal{S} \mid x \in s \} $
Observe that $ |\mathcal{S}_x| = \binom{N-1}{n-1} $.
Let population mean be zero. $\mu = 0$, i.e. $ \sum_{i = 1}^N x_i = 0 $
Fix an order for $\mathcal{S}$:
$ \mathcal{S} = \{ s_1, s_2, \dots, s_{|\mathcal{S}|} \} $.
$j$-th $n$-sample mean $ m_j = \frac1n \sum_{x \in \mathcal{S}_j} x $
Remark: I don’t use $ \sum s_j $ as in $ \cup \mathcal{T} $ in topology to
avoid misreading the $n$-sample $ s_j $ as an element.
mean of $n$-sample mean
$ m = \frac{1}{|\mathcal{S}|} \sum_{s_j \in \mathcal{S}} m_j $
[Read More]
Replacing Deprecated Hugo Syntax in Blog Theme
Fixing Beautiful Hugo issue #261
Posted on April 25, 2019
| 2 minutes
| Vincent Tam
|
1 comment
Problem
Since the recent Hugo upgrade to v0.55.3, the following messages popped up after
each local site regeneration with hugo server
.
WARN 2019/04/24 18:07:00 Page's .URL is deprecated and will be removed in a futu
re release. Use .Permalink or .RelPermalink. If what you want is the front matte
r URL value, use .Params.url.
WARN 2019/04/24 18:07:00 Page's .Hugo is deprecated and will be removed in a fut
ure release. Use the global hugo function.
WARN 2019/04/24 18:07:00 Page's .RSSLink is deprecated and will be removed in a
future release. Use the Output Format's link, e.g. something like:
{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}.
Total in 136 ms
GitLab’s online runner also gave the same type of warnings. This was
reported in Beautiful Hugo issue #261.
[Read More]
Julia Rcall Installation
Rcall.jl build failure due to missing dependencies
Posted on April 24, 2019
(Last modified on April 29, 2019)
| 5 minutes
| Vincent Tam
|
0 comment
Problem
During the installation of RCall.jl, the package wasn’t successfully
built due to a missing variable $R_HOME
.
$ julia -q
julia> Pkg.add("RCall")
Resolving package versions...
Installed WinReg ─ v0.3.1
Installed RCall ── v0.13.2
Updating `~/.julia/environments/v1.0/Project.toml`
[6f49c342] + RCall v0.13.2
Updating `~/.julia/environments/v1.0/Manifest.toml`
[6f49c342] + RCall v0.13.2
[1b915085] + WinReg v0.3.1
Building RCall → `~/.julia/packages/RCall/ffM0W/deps/build.log`
┌ Error: Error building `RCall`:
│ ERROR: LoadError: R_HOME is not a directory.
│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] top-level scope at logging.jl:322
│ [3] top-level scope at /home/vin100/.julia/packages/RCall/ffM0W/deps/build.jl
:19
│ [4] include at ./boot.jl:317 [inlined]
│ [5] include_relative(::Module, ::String) at ./loading.jl:1041
│ [6] include(::Module, ::String) at ./sysimg.jl:29
│ [7] include(::String) at ./client.jl:388
│ [8] top-level scope at none:0
│ in expression starting at /home/vin100/.julia/packages/RCall/ffM0W/deps/build.
jl:10
└ @ Pkg.Operations /buildworkjr/worker/package_linux64/build/usr/share/julia/std
lib/v1.0/pkg/src/operations.jl:1069
Discussion
It took me a few minutes to realise that the cause of this error is the
absence of R. I referred to
CRAN’s installation instructions for Ubuntu and added
[Read More]
Xubuntu Screen Enlargement
Posted on April 21, 2019
| 1 minutes
| Vincent Tam
|
0 comment
Tonight, the screen of Xubuntu suddenly enlarged and blurred. Typing “xubuntu
screen display enlarged” on Google, I’ve learnt that the <Alt>
key and the
mouse scroll wheel can enlarge/minify screen display from Ubuntu Forums.
Cython Can't Replace Julia
Posted on April 17, 2019
(Last modified on April 13, 2023)
| 1 minutes
| Vincent Tam
|
0 comment
This is a linklog to
Christopher Rackauckas’s article about Julia, Cython & Numba. Unluckily, I
don’t have time to read this now. Hope I can return to this later.
Cantonese vs Mandarin for Reading Tang Poems
Comparison using Du Mu's poem
Posted on April 17, 2019
(Last modified on May 11, 2019)
| 1 minutes
| Vincent Tam
|
0 comment
This is a linkblog to a post on Discuss HK which claims how Mandarin (普通話)
messes up the flat and oblique tones (平仄) of the regulate verse (近體詩) below.
《山行》 杜牧
遠上寒山石徑斜,白雲生處有人家。
停車坐愛楓林晚,霜葉紅於二月花。
Cantonese (粵語) |
Mandarin (普通話) |
仄仄平平仄仄平 仄平平仄仄平平 平平仄仄平平仄 仄仄平平仄仄平 |
仄仄平平平仄平 平平平仄仄平平 平平仄仄平平仄 仄仄平平仄仄平 |
However, Kimery has checked the Mandarin pinyin (拼音) and (s)he doesn’t found
such problem except for some characters with entering tone (入聲). Luckily,
such characters are located at the odd numbered position of a verse.
Eventually, (after considering other factors,) that won’t harm the variation
of tones in principle.
[Read More]
Quels schémas à tester ?
Posted on April 11, 2019
(Last modified on February 16, 2021)
| 1 minutes
| Vincent Tam
|
2 comments
Pour simuler les trajectoires d’une équation différentielle, le schéma le plus
facile est l’un découvert par Euler.
Cependant, en espérant mettre ce que j’ai vu au cours de ma licence en pratique,
j’ai cherché un peu sur des méthodes numériques pour les EDS sur Google, et je
suis tombé sur un article écrit par Brian D. Ewald.
Les différences entre les schémas « forts » et « faibles » seraient-ils
pertinents pour mon stage ? On va voir.
[Read More]
Borel Cantelli Exercise 2019
Posted on February 4, 2019
(Last modified on February 16, 2021)
| 1 minutes
| Vincent Tam
|
1 comment
I intend to post this for a Borel-Cantelli lemma exercise on
Math.SE.
The target event is ${\exists i_0 \in \Bbb{N} : \forall i \ge i_0, X_i =
1}$, whose complement is
$$
{\forall i_0 \in \Bbb{N} : \exists i \ge i_0, X_i > = 0}
= \limsup_i {X_i = 0}.
$$
To apply Borel-Cantelli, one has to determine whether $\sum_i P(X_i =
0)<+\infty$.
Mise à jour du template de lettre
Template de lettre en Xe$\LaTeX$
Posted on January 16, 2019
(Last modified on May 11, 2019)
| 1 minutes
| Vincent Tam
|
0 comment
Contexte
J’ai publié mon template de lettre en Xe$\LaTeX$ sur mon ancien blog
(hébergé sur GitHub Pages) il y a trois ans.
Problème et solution
Après le changement de l’ordi portable, il me faut l’installation du
pacquetage “texlive-lang-french” sur la nouvelle version d’Ubuntu. Sinon, une
erreur du pacquetage Babel se surviendra.
! Package babel Error: Unknown option `frenchb'. Either you misspelled it
(babel) or the language definition file frenchb.ldf was not foun
d.
See the babel package documentation for explanation.
Type H <return> for immediate help.
l.445 \ProcessOptions*
?
A ce stade, Xe$\LaTeX$ parviendra à compiler le fichier $\TeX$ avec une remarque
à propos de l’obsolescence de l’option frenchb
pour le pacquetage Babel.
[Read More]
Staticman Failure on Tsalikis' Site
Use Alternative Staticman API server
Posted on January 1, 2019
(Last modified on April 27, 2019)
| 1 minutes
| Vincent Tam
|
2 comments
After reading Hugo Comments with Staticman on Kostas Tsalikis’ web site,
I tried to leave the following comment.
As far as I know, Staticman can be used only with GitHub, since it works as
a GitHub bot. Obviously, not all static sites are saved in GitHub, and this may
be a showstopper for someone using another service. Thanks to
eduardoboucas/staticman#219, Staticman now supports GitLab. You may view my
demo Hugo site on Framagit at
https://staticman-gitlab-pages.frama.io/bhdemo/posts/my-second-post/
Source) as a working
example.
[Read More]