2020年10月23日金曜日

JSテスト:ferNANDo

program code


delay: ms


input:


output:



2020年10月20日火曜日

StackEdit5-test3

--- title: StackEdit5-test3 ---

Using LaTeX

Inline LaTeX:Γ(z)=0tz1etdt.\LaTeX: \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.
Display LaTeX:Γ(z)=0tz1etdt.\LaTeX: \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.
Displaystyle LaTeX:Γ(z)=0tz1etdt.\displaystyle \LaTeX: \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.

$ or $$ 囲い
\\( \\), \\[ \\] 囲い(\ がエスケープされるので二重)

Inline \(\LaTeX: \Gamma(z) = \int_0^\infty t^ {z-1}e^ {-t}dt,.\)
Display \[\LaTeX: \Gamma(z) = \int_0^\infty t^ {z-1}e^ {-t}dt,.\]

Written with StackEdit.

StackEditテスト2

マークダウンで書いてBlogger に投稿できるらしいのでテスト(すぐ消す)

Welcome to StackEdit!

Hi! I’m your first Markdown file in StackEdit. If you want to learn about StackEdit, you can read me. If you want to play with Markdown, you can edit me. Once you have finished with me, you can create new files by opening the file explorer on the left corner of the navigation bar.

Files

StackEdit stores your files in your browser, which means all your files are automatically saved locally and are accessible offline!

Create files and folders

The file explorer is accessible using the button in left corner of the navigation bar. You can create a new file by clicking the New file button in the file explorer. You can also create folders by clicking the New folder button.

Switch to another file

All your files and folders are presented as a tree in the file explorer. You can switch from one to another by clicking a file in the tree.

Rename a file

You can rename the current file by clicking the file name in the navigation bar or by clicking the Rename button in the file explorer.

Delete a file

You can delete the current file by clicking the Remove button in the file explorer. The file will be moved into the Trash folder and automatically deleted after 7 days of inactivity.

Export a file

You can export the current file by clicking Export to disk in the menu. You can choose to export the file as plain Markdown, as HTML using a Handlebars template or as a PDF.

Synchronization

Synchronization is one of the biggest features of StackEdit. It enables you to synchronize any file in your workspace with other files stored in your Google Drive, your Dropbox and your GitHub accounts. This allows you to keep writing on other devices, collaborate with people you share the file with, integrate easily into your workflow… The synchronization mechanism takes place every minute in the background, downloading, merging, and uploading file modifications.

There are two types of synchronization and they can complement each other:

  • The workspace synchronization will sync all your files, folders and settings automatically. This will allow you to fetch your workspace on any other device.

    To start syncing your workspace, just sign in with Google in the menu.

  • The file synchronization will keep one file of the workspace synced with one or multiple files in Google Drive, Dropbox or GitHub.

    Before starting to sync files, you must link an account in the Synchronize sub-menu.

Open a file

You can open a file from Google Drive, Dropbox or GitHub by opening the Synchronize sub-menu and clicking Open from. Once opened in the workspace, any modification in the file will be automatically synced.

Save a file

You can save any file of the workspace to Google Drive, Dropbox or GitHub by opening the Synchronize sub-menu and clicking Save on. Even if a file in the workspace is already synced, you can save it to another location. StackEdit can sync one file with multiple locations and accounts.

Synchronize a file

Once your file is linked to a synchronized location, StackEdit will periodically synchronize it by downloading/uploading any modification. A merge will be performed if necessary and conflicts will be resolved.

If you just have modified your file and you want to force syncing, click the Synchronize now button in the navigation bar.

Note: The Synchronize now button is disabled if you have no file to synchronize.

Manage file synchronization

Since one file can be synced with multiple locations, you can list and manage synchronized locations by clicking File synchronization in the Synchronize sub-menu. This allows you to list and remove synchronized locations that are linked to your file.

Publication

Publishing in StackEdit makes it simple for you to publish online your files. Once you’re happy with a file, you can publish it to different hosting platforms like Blogger, Dropbox, Gist, GitHub, Google Drive, WordPress and Zendesk. With Handlebars templates, you have full control over what you export.

Before starting to publish, you must link an account in the Publish sub-menu.

Publish a File

You can publish your file by opening the Publish sub-menu and by clicking Publish to. For some locations, you can choose between the following formats:

  • Markdown: publish the Markdown text on a website that can interpret it (GitHub for instance),
  • HTML: publish the file converted to HTML via a Handlebars template (on a blog for example).

Update a publication

After publishing, StackEdit keeps your file linked to that publication which makes it easy for you to re-publish it. Once you have modified your file and you want to update your publication, click on the Publish now button in the navigation bar.

Note: The Publish now button is disabled if your file has not been published yet.

Manage file publication

Since one file can be published to multiple locations, you can list and manage publish locations by clicking File publication in the Publish sub-menu. This allows you to list and remove publication locations that are linked to your file.

Markdown extensions

StackEdit extends the standard Markdown syntax by adding extra Markdown extensions, providing you with some nice features.

ProTip: You can disable any Markdown extension in the File properties dialog.

SmartyPants

SmartyPants converts ASCII punctuation characters into “smart” typographic punctuation HTML entities. For example:

ASCII HTML
Single backticks 'Isn't this fun?' ‘Isn’t this fun?’
Quotes "Isn't this fun?" “Isn’t this fun?”
Dashes -- is en-dash, --- is em-dash – is en-dash, — is em-dash

KaTeX

You can render LaTeX mathematical expressions using KaTeX:

The Gamma function satisfying Γ(n)=(n1)!nN\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N is via the Euler integral

Γ(z)=0tz1etdt.\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.

You can find more information about LaTeX mathematical expressions here.

Inline LaTeX:Γ(z)=0tz1etdt.\LaTeX: \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.
Display LaTeX:Γ(z)=0tz1etdt.\LaTeX: \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.

$ or $$ 囲い
\\( \\), \\[ \\] 囲い(\ がエスケープされるので二重)

Inline \(\LaTeX: \Gamma(z) = \int_0^\infty t{z-1}e{-t}dt,.\)
Display \[\LaTeX: \Gamma(z) = \int_0^\infty t{z-1}e{-t}dt,.\]

UML diagrams

You can render UML diagrams using Mermaid. For example, this will produce a sequence diagram:

AliceBobJohnHello Bob, how are you?How about you John?I am good thanks!I am good thanks!Bob thinks a longlong time, so longthat the text doesnot fit on a row.Checking with John...Yes... John, how are you?AliceBobJohn

And this will produce a flow chart:

Link text
Square Rect
Circle
Round Rect
Rhombus

脚注はつけられますか?

脚注をつける1

スニペットのシンタックスハイライト

class Main{
  void main(String[] args){
    System.out.println("Hello, world!");
  }
}
print(set(input() for _ in range(10)))

ページ内リンク

アンカー


  1. これは脚注です ↩︎

Hello!

Welcome to StackEdit!

Hey! I’m your first Markdown document in StackEdit1. Don’t delete me, I’m very helpful! I can be recovered anyway in the Utils tab of the Settings dialog.


Documents

StackEdit stores your documents in your browser, which means all your documents are automatically saved locally and are accessible offline!

Note:

  • StackEdit is accessible offline after the application has been loaded for the first time.
  • Your local documents are not shared between different browsers or computers.
  • Clearing your browser’s data may delete all your local documents! Make sure your documents are synchronized with Google Drive or Dropbox (check out the Synchronization section).

Create a document

The document panel is accessible using the button in the navigation bar. You can create a new document by clicking New document in the document panel.

Switch to another document

All your local documents are listed in the document panel. You can switch from one to another by clicking a document in the list or you can toggle documents using Ctrl+[ and Ctrl+].

Rename a document

You can rename the current document by clicking the document title in the navigation bar.

Delete a document

You can delete the current document by clicking Delete document in the document panel.

Export a document

You can save the current document to a file by clicking Export to disk from the menu panel.

Tip: Check out the Publish a document section for a description of the different output formats.


Synchronization

StackEdit can be combined with Google Drive and Dropbox to have your documents saved in the Cloud. The synchronization mechanism takes care of uploading your modifications or downloading the latest version of your documents.

Note:

  • Full access to Google Drive or Dropbox is required to be able to import any document in StackEdit. Permission restrictions can be configured in the settings.
  • Imported documents are downloaded in your browser and are not transmitted to a server.
  • If you experience problems saving your documents on Google Drive, check and optionally disable browser extensions, such as Disconnect.

Open a document

You can open a document from Google Drive or the Dropbox by opening the Synchronize sub-menu and by clicking Open from…. Once opened, any modification in your document will be automatically synchronized with the file in your Google Drive / Dropbox account.

Save a document

You can save any document by opening the Synchronize sub-menu and by clicking Save on…. Even if your document is already synchronized with Google Drive or Dropbox, you can export it to a another location. StackEdit can synchronize one document with multiple locations and accounts.

Synchronize a document

Once your document is linked to a Google Drive or a Dropbox file, StackEdit will periodically (every 3 minutes) synchronize it by downloading/uploading any modification. A merge will be performed if necessary and conflicts will be detected.

If you just have modified your document and you want to force the synchronization, click the button in the navigation bar.

Note: The button is disabled when you have no document to synchronize.

Manage document synchronization

Since one document can be synchronized with multiple locations, you can list and manage synchronized locations by clicking Manage synchronization in the Synchronize sub-menu. This will let you remove synchronization locations that are associated to your document.

Note: If you delete the file from Google Drive or from Dropbox, the document will no longer be synchronized with that location.


Publication

Once you are happy with your document, you can publish it on different websites directly from StackEdit. As for now, StackEdit can publish on Blogger, Dropbox, Gist, GitHub, Google Drive, Tumblr, WordPress and on any SSH server.

Publish a document

You can publish your document by opening the Publish sub-menu and by choosing a website. In the dialog box, you can choose the publication format:

  • Markdown, to publish the Markdown text on a website that can interpret it (GitHub for instance),
  • HTML, to publish the document converted into HTML (on a blog for example),
  • Template, to have a full control of the output.

Note: The default template is a simple webpage wrapping your document in HTML format. You can customize it in the Advanced tab of the Settings dialog.

Update a publication

After publishing, StackEdit will keep your document linked to that publication which makes it easy for you to update it. Once you have modified your document and you want to update your publication, click on the button in the navigation bar.

Note: The button is disabled when your document has not been published yet.

Manage document publication

Since one document can be published on multiple locations, you can list and manage publish locations by clicking Manage publication in the menu panel. This will let you remove publication locations that are associated to your document.

Note: If the file has been removed from the website or the blog, the document will no longer be published on that location.


Markdown Extra

StackEdit supports Markdown Extra, which extends Markdown syntax with some nice features.

Tip: You can disable any Markdown Extra feature in the Extensions tab of the Settings dialog.

Note: You can find more information about Markdown syntax here and Markdown Extra extension here.

Tables

Markdown Extra has a special syntax for tables:

Item Value
Computer $1600
Phone $12
Pipe $1

You can specify column alignment with one or two colons:

Item Value Qty
Computer $1600 5
Phone $12 12
Pipe $1 234

Definition Lists

Markdown Extra has a special syntax for definition lists too:

Term 1
Term 2
Definition A
Definition B
Term 3

Definition C

Definition D

part of definition D

Fenced code blocks

GitHub’s fenced code blocks are also supported with Highlight.js syntax highlighting:

// Foo
var bar = 0;

Tip: To use Prettify instead of Highlight.js, just configure the Markdown Extra extension in the Settings dialog.

Note: You can find more information:

  • about Prettify syntax highlighting here,
  • about Highlight.js syntax highlighting here.

Footnotes

You can create footnotes like this2.

SmartyPants

SmartyPants converts ASCII punctuation characters into “smart” typographic punctuation HTML entities. For example:

ASCII HTML
Single backticks 'Isn't this fun?' ‘Isn’t this fun?’
Quotes "Isn't this fun?" “Isn’t this fun?”
Dashes -- is en-dash, --- is em-dash – is en-dash, — is em-dash

Table of contents

You can insert a table of contents using the marker [TOC]:

MathJax

You can render LaTeX mathematical expressions using MathJax, as on math.stackexchange.com:

The Gamma function satisfying is via the Euler integral

Tip: To make sure mathematical expressions are rendered properly on your website, include MathJax into your template:

<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>

Note: You can find more information about LaTeX mathematical expressions here.

Inline
Display

$ or $$ 囲い
\\( \\), \\[ \\] 囲い(\ がエスケープされるので二重)

Inline \(\LaTeX: \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt,.\)
Display

UML diagrams

You can also render sequence diagrams like this:

Created with Raphaël 2.1.2AliceAliceBobBobHello Bob, how are you?Bob thinksI am good thanks!

And flow charts like this:

Created with Raphaël 2.1.2StartMy OperationYes or No?Endyesno

Note: You can find more information:

  • about Sequence diagrams syntax here,
  • about Flow charts syntax here.

Support StackEdit


  1. StackEdit is a full-featured, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.
  2. Here is the text of the footnote.

2020年10月19日月曜日

分散が2乗じゃないとどうなるのか

Introduction

分散はなぜ偏差の絶対値ではなく2乗を使うのか。この話題は度々Twitterでもみかけます。
こういうのってちゃんと統計の講義を受けたら説明してもらえるんでしょうかね?筆者は高校でも大学でも統計をちゃんと教わったことがないので実際どうなっているのかわからないのですが、高校生向けの教材を見る限りにおいてはいきなり2乗が出てきて絶対値だとどうなるのかみたいなあまり詳しく扱われていないと思います。ただ、数理統計の教科書を読んでみると結構いろいろなことが書いてあります。
バイト1で必要に迫られちょくちょく調べて得た知見をもとに2乗以外だとどうなるのかということをまとめていきたいと思います。
何かツッコミや質問等ありましたらページ下部のコメントフォームまたはTwitterまでお願いします。

※スマホ版では数式が表示できないためPC版に切り替えて御覧ください。

目次


1. 分散と平均値

ある変数の列 \( X _1, X _2, \ldots, X _n \) 2 があるとします。
このデータをある一つの値 \( \mu \) で代表したとき、その値がどれくらい信頼できるかという指標がほしいですね。代表値と各々のデータの誤差を絶対値として平均する

\( \displaystyle\mathrm{MAE} _\mu=\frac{1}{n}\sum _{i}^n |X _i - \mu| \)

:Mean Absolute Error(平均絶対値誤差) と、2乗した値を平均する

\( \displaystyle\mathrm{MSE} _\mu=\frac{1}{n}\sum _{i}^n (X _i - \mu)^2 \)

:Mean Squared Error(平均二乗誤差) とが考えられます。

誤差が小さい \( \mu \) の方が代表値として嬉しいのでこれらの誤差を最小にする \( \mu \) を考えてみますが、絶対値があると数式的に計算が面倒なので後に回し、まずは \( \mathrm{MSE} \) を計算してみます。

\( \displaystyle \frac{d}{d\mu} \mathrm{MSE} _\mu = \frac{1}{n}\sum _i 2(\mu^2-X _i) = 2\{\mu -(\frac{1}{n}\sum _iX _i)\} \)

より \( \mathrm{MSE} _\mu \) は \( \mu=\frac{1}{n}\sum _iX _i \) のとき極値をとります。導関数が \( \mu \) について1次なので明らかにこれは最小値で、代入すると \( \frac{1}{n}\sum _iX _i^2-(\frac{1}{n}\sum _iX _i)^2 \) を取ることがわかります。
いうまでもなくこれらは(算術)平均値と分散ですね。つまり平均値は平均二乗誤差を最小にするデータの代表値、分散はこれに対するデータの「ばらつき」であるとみなすことができます。
他の統計量と比べ数学的にも扱いやすく、特に正規分布との相性がよく正規分布の仮定をおけばさらに色々な情報が表せるため引っ張りだこな統計量です。

1.1. 不偏推定量

「数学的に扱いやすい」ということを見るため平均と分散の不偏性を確認してみましょう。
推測統計の立場から、上の \( X _1, \ldots, X _n \) をある分布に従う母集団から無作為抽出した確率変数の集合=標本として見ます。この標本から母集団の性質を推定したいというのが推測統計の目的です。
さて、この標本に対する統計量とは \( X _1, \ldots, X _n \) を引数に取る関数であるので抽出に対しランダム性を持っています。このランダムネスに対して取った期待値が「真の値」=母集団の統計量と一致していると嬉しいのでこのような性質を持つ統計量を不偏推定量と呼びます。

詳しい計算は省きます3が、平均値は不偏推定量です。
分散はそのままでは不偏推定量ではありませんが、常に母分散の \( \frac{n-1}{n} \) 倍になっているので \( \frac{n}{n-1} \) 倍してやると不偏推定量になります。

さらに言えば、この期待値についての平均二乗誤差を考えてやるとこれが小さいほど母推定の信頼度が高いと言えます(より有効であるという4)。これは重み付け平均や中央値(中央値が不偏推定量となる場合(母分布が左右対称な場合など)に限る)よりも平均の場合のほうが小さく、この意味でも平均値は有用です。


2. 中央値と平均絶対偏差

前章で飛ばした \( \mathrm{MAE} _\mu \) についても考えていきます。
\( \mathrm{MSE} _\mu \) は \( \mu \) についての\( |\mathrm{1次式}| \)を足し合わせたものなので区分的に1次関数でかつ連続になっています。\( X _1, \ldots, X _n \) を昇順に並び替えたものを \( X’ _1, \ldots, X’ _n \) として、 \( \mu \) を \( \mu=X’ _i (i=1, \ldots, n) \) となる境界値で場合分けしていきます。

\( \mu\le X’ _1 \text{のとき}, \text{傾き}=-n \)
\( X’ _1\le \mu\le X’ _2 \text{のとき}, \text{傾き}=-n+2 \)
\( \vdots \)
(\( n \):偶数のとき)
\( X’ _{n/2-1}\le \mu\le X’ _{n/2} \text{のとき}, \text{傾き}=-2 \)
\( X’ _{n/2}\le \mu\le X’ _{n/2+1} \text{のとき}, \text{傾き}=0 \)
\( X’ _{n/2+1}\le \mu\le X’ _{n/2+2} \text{のとき}, \text{傾き}=2 \)
(\( n \):奇数のとき)
\( X’ _{(n-1)/2}\le \mu\le X’ _{(n+1)/2} \text{のとき}, \text{傾き}=-1 \)
\( X’ _{(n+1)/2}\le \mu\le X’ _{(n+3)/2} \text{のとき}, \text{傾き}=1 \)
\( \vdots \)
\( X’ _n\le \mu \text{のとき}, \text{傾き}=n \)

となるので、連続性から増減を考え
\( \begin{cases}X’ _{n/2}\le \mu \le X’ _{n/2+1}&:n\text{が偶数のとき}\\mu=X’ _{(n+1)/2} &:n\text{が奇数のとき}\end{cases} \)
のときに \( \mathrm{MAE} _\mu \) は最小になります。

偶数のときは幅がありますが、 \( \mu=\frac{X’ _{n/2}+X’ _{n/2+1}}{2} \) はこの範囲内なので、\( \mu \) が中央値のとき \( \mathrm{MAE} _\mu \) は最小になります。これはMean Absolute Deviation(平均絶対偏差)と呼んだりします。(ただし「平均絶対偏差」は\( \mu \)が平均値など他の統計量である場合も指すことがある。つまり”MAD”と言ったときにそれが中央値をを中心とした絶対偏差であるかどうかは文脈による。)


2.1. 中央値不偏推定量

さて、代表値と「ばらつき」を表す統計量が定義されたのでこれを使って母推定を行いたいですね。
結論から言えば中央値は一般には5不偏推定量ではありません。
このnote に標本中央値による推定と母中央値が一致しない具体例が示されている通り、標本中央値は期待値として母集団の性質を反映していません。
しかし、期待値とは確率分布に対する平均値です。中央値が相手の土俵で戦って真価を発揮しないのはある意味当然と言えるでしょう。
上記資料では引き続き「中央値不偏推定量(median-unbiassed estimator)」という推定量を導入しています。標本統計量に対して取る中央値が母推定量であるような統計量を定めたもので、中央値はめでたくこれに該当することがわかります。


2.2. 中央値絶対偏差

ところでMAEの定義には違和感があります。というのも偏差として \( |X _i-\mu| \) を取った後に全体をまとめるときに平均を使っている点です。MAEが中央値と関連しているのならば \( |X _i-\mu| \) の代表値としては中央値をとってもいいはずです。

\( \displaystyle\mathrm{MAE}’ _\mu=\mathrm{median}[ |X _i - \mu|\ (i=1, \ldots, n)] \)

:Median Absolute Error(中央値絶対値誤差) (MAEという略称が被ってしまったので’をつけています)と呼ばれることがあります 6

これが \( \mu=\mathrm{median}[X _i] \) で最小になりかつ中央値不偏統計量になっていてくれると大変きれいですがどうも中央値不偏にはならないようです。だいぶ計算がしんどいので詳しくはまたの機会にしますが、こういう統計的扱いやすさの差が平均・分散との使われ方の差になっているのかなと思います。


3. "0-ノルム"と最頻値

「ばらつき」の定義として偏差の2乗と1乗の場合を見たのでそのままのノリで「0乗」の場合を考えてみましょう。

\( \displaystyle\mathrm{MZE} _\mu=\frac{1}{n}\sum _{i}^n |X _i - \mu|^0 \)

(Mean Zero-norm Error …というものが一般に定義されているわけではなく今名前をつけました。)
ここで「\( x^0 \)」は \( x=0 \) で定義されませんが、便宜的に \( 0^0=0 \) と定義します。
このように定義した \( \sum _{i} |x _i|^0 \) は距離の定義を満たさない7ものの、 \( L^p \)ノルムで \( p\to 0 \) とした極限であるため、"0-ノルム"と呼ばれることがある8そう。なお、本記事の MAE、MADはそれぞれ \( p=1,2 \) の \( L^p \)ノルムに相当します。

この場合、 \( X _i\neq \mu \) のときは \( 1 \) 、 \( X _i=\mu \) のときは \( 0 \) となるので、\( \sum _{i} |X _i - \mu|^0 \) はすなわち \( \# \{ i | X _i \neq \mu \}=n - \# \{i | X _i= \mu \} \) になります。
\( X _i= \mu \) である \( i \) の個数が最大の \( \mu \) とは他ならぬ最頻値のことであり \( \mathrm{MZE} \) は \( \mu \) で最小となります。

これもまた解析がしんどいので今後の課題としますが、中央値と同様、最頻値不偏性(mode-unbiassedness)を導入することもできるようです9


3.1. ∞ノルムでは?

指数を減らした場合があるのなら当然指数を増やしたバージョンも考えられます。
\( p=3,4,\ldots \)と順に考えていけるはずですが、きりがないので一気に \( p\to \infty \) の極限を考えてみます。"0-ノルム"の場合に習って \( L^\infty \) ノルムを考えるとこの場合は \( |x| _\infty=\max\{|x _1|, |x _2|, \ldots \} \) となるので

\( \displaystyle\mathrm{MME} _\mu=\frac{1}{n}\max{|X _i-\mu|} \)

(これもまた造語)
これは \( \mu \) が \( X _i \) の最大値と最小値の中点にある時(これには中点値と名付けられています10)に最小になり、範囲 \( R=\max _i{X _i}-\min _i{X _i} \) として最小値 \( R/2n \) をとります。


4. 「ばらつき」と距離

長くなりましたが以上で見たように、(統計的にどれくらい有用かを別として)様々な「距離」11の定義に応じて「ばらつき」を定義できるが、2乗の場合が一番使いやすそうだということが言えると思います。やはり微分可能であるというのが大きい。

最後に「距離」と統計量の対応をまとめてみます。

代表値 「ばらつき」 対応する「距離」
平均値 分散 \( L^2 \)ノルム (ユークリッド距離)
中央値 平均絶対偏差 \( L^1 \)ノルム (マンハッタン距離)
最頻値 不正解率 “0-ノルム”
中点値 範囲/\( 2n \) \( L^\infty \)ノルム (一様ノルム・チェビシェフ距離)

参考文献

尾畑伸明(2014)『数理統計学の基礎』共立出版
Takayuki Uchiba (2020)「標本中央値は母中央値の不偏推定量か」note https://note.com/utaka233/n/n412b5e6e4c73
@greatonbi (2020)「腑に落ちない人のための不偏性と一致性の解説」 https://qiita.com/greatonbi/items/ec5db93ec70189704c0e
Lp空間 - Wikipedia
Average absolute deviation - Wikipedia


  1. 高校教材の校正業務をしています。最近統計必修化の対応でこの分野の問題が増えてきたためゆとりなんでわかんないですじゃ済まなくなってきて大変です。 ↩︎

  2. この「データ」の扱いかたは立場によって変わってきます。記述統計の立場では表すべき全データ、推測統計の立場では母集団から確率的にサンプリングした標本、ベイズ統計の立場では逆に確率的に母集団パラメータを確率的に定めるデータというようになりますね。ベイズはともかく記述統計と推測統計の用語はしばしば入り交じるのでめちゃくちゃややこしいです。 ↩︎

  3. この記事なんかが実際に実験してみた結果も載っているのでわかりやすいと思います。 ↩︎

  4. 『数理統計学の基礎』p170 ↩︎

  5. 左右対称な分布などでは中央値は平均値と一致し、不偏統計量となる。 ↩︎

  6. https://en.wikipedia.org/wiki/Median_absolute_deviation ↩︎

  7. 斉次性(\( |ax|=a|x| \))を満たさない ↩︎

  8. https://ja.wikipedia.org/wiki/Lp空間#p___の場合 なお、ちゃんと距離の定義を満たす別の「\( L^0 \)ノルム」も存在するそうです。 ↩︎

  9. Sung, Nae-Kyung (1990) “An Optimality Criterion for Median-unbiased Estimators” Journal of the Korean Statistical Society - Sec.3 (読みかけ) ↩︎

  10. https://ja.wikipedia.org/wiki/要約統計量#中点値 ↩︎

  11. 数学的な距離の定義を満たさない"0-ノルム"も含む ↩︎

2020年9月27日日曜日

東北旅行記

また前から間が空いてしまった。せっかくなので4連休で行ってきた旅行の日記をつけようと思う。

概要

2020年9月19日(土)~22日(火) の4連休、(元含む)寮の同期[1]4人で車を借り仙台発、山形・秋田・青森・岩手を周り仙台に戻ってくる旅行を行った。

メンバーは

  • A氏:社会人。鉄オタ。旅慣れしているので旅行の手配をだいぶ頼っている
  • B氏:M2で寮の隣人。学科柄航空オタク
  • C氏:社会人。仕事柄航空オタクになった
  • 筆者:酒が飲めないので自動的にハンドルキーパーになる

の4人である。

旅程詳細

9/19(Sat.)

・朝イチで東京駅に集合。東北新幹線で仙台へ。
東海道以外の新幹線は初だったのでちょっとテンションが上がった。

・仙台駅着後レンタカー屋で自動車をレンタル。
車種ははっきり確認し忘れたが日産のe-POWERとかだったと思う。モーター駆動のガス・エレクトリック式で結構運転感覚がいつもと違う。回生システムが動いているときのエンジンブレーキがものすごい。
ルームミラーがカメラの映像を映す方式だった[2]。やたらとハイテク。

余談だが仙台市内にめちゃくちゃ名鉄バスみたいな塗装のバスがいた。A氏に聞いてみると仙台交通は名鉄グループらしい。血が濃すぎでしょ。

・本格的に移動する前に仙台市内、愛子駅で一時停車。
駅メモのイベント駅であるためA氏からの要望であった。

・宮城と山形の県境あたり、天童市将棋資料館を訪問。様々な将棋駒を見学した。

・山形県銀山温泉を訪問。ちょっと手前の記念館(?)で車を停めシャトルバスで温泉街へ向かう。町並みを散策し蕎麦と豆腐を食べた。


銀山温泉街の町並み

・日も下がってきた頃、日本海沿岸、山居倉庫を訪問。
C氏の提案をそのまま旅程に入れたので知らなかったが彼から米倉としての工夫や船着場などいろいろ説明を受けた。
そのまま魚市場の海鮮を食べる計画であったがコロナの影響かネットの情報より早く閉まってしまっていた。近隣の料理店で寿司定食を食べた。


山居倉庫

・食後、更に北上し秋田市内のホテルに宿泊。
日も暮れてきたところで借りた車がライト機能も非常に高性能であることを発見。対向車の有無などを判断し自動でハイビームを切り替えられる。信号やリフレクターなどをちゃんと判別しているようでなかなかの高精度だった。一方カメラ式のルームミラーは雨が降り出すと全く役に立たなくなった(普通のミラーと切り替えられるのでもちろん後ろは見える)。

ここまで車で270km、新幹線を含め600kmの移動。

1日目行程
1日目行程

9/20(Sun.)

・朝から移動開始。すき家で朝食を済ます。

・内陸側に西進し、角館武家屋敷を訪問。城下町の武家屋敷がたくさん保存されている。伝統工芸「樺細工」(桜の皮の利用し模様を生み出す)の展示館も見学。小豆粉から作った落雁、「もろこし」をお土産に購入。


武家屋敷(これがたくさんある)

・田沢湖へ。湖岸をほぼ一周し、たつこ像を見学、昼食に近くの食堂でラーメンを食べた。


たつこ像対岸あたりにあった神社

・3時間ほど北上し青森県に突入。今度は十和田湖へ。駐車場から10分ほど歩いて十和田神社に参拝した。
夕焼けでなかなか綺麗な景色だったがスマホのカメラでは如何せん逆光で全然映らない。


順光方向ならなんとか映る

・下北半島付け根あたり、野辺地駅周辺で寿司を食べた。

・ホテルに一旦チェックインした後、天体観測のため恐山へ向かう。
しかし真っ暗な山道で対向車も全然いないこともあり、C氏がビビり散らかしていたのが全員に伝染(ちなみに運転していたのは筆者である。めっちゃ怖かった。)、途中で引き返しもう少し開けたところの公園に停車した。なお天候不順のため結局星は見えずさっさと引き返してきた。
この日の移動は320km。


2日目行程
2日目行程

9/21(Mon.)

・北上し本州最北端、大間崎へ。道中太平洋沿岸から対岸、つまり北海道の陸地がほのかに見える。津軽海峡って意外と近いんですなあ。最北端では”最寄り駅”がギリギリ函館市電「湯の川」停留所になる。実質北海道。
大間で昼食にマグロ丼を食べた。めちゃくちゃ美味いわ、びっくりした。マグロそのものが美味いと感じたの初めてかもしれない(バカ舌なので)。



かすかに対岸に町並みも見える

マグロがでっかいマグロ丼

・来た道を戻り三沢航空科学館を訪問。当初は予定になかったが何故か航空オタクが2人もいる集団なので訪問が決定。オタクの解説を聞きながら科学館を回るとためになりますね。
十和田湖に沈められていたのが引き上げられたゼロ戦などの展示を見学。


十和田湖から引き上げられたゼロ戦

航空科学館なのになぜか艦船の絵も展示されていた。菅野泰紀氏による写真と見紛うほどの精緻な鉛筆画で、艦内神社の慰霊ということで関係各所に奉納されているらしい。


写真ではなく鉛筆画である

・急に目的地を増やしたので次の目的地、花巻市の宮沢賢治記念館には閉館時間までに間に合わなくなった。観光地の夜は早い。
車中で調べたところもう少し近い盛岡市に「もりおか啄木・賢治青春館」を見つけたのでそこへ。旧銀行を改装した記念館で色々見学。


もりおか啄木・賢治青春館(旧九十銀行)

・この日は食事もつけたのでそのまま一関市の宿へ。牛を焼いて食べた。とても美味い。
青森北端から岩手南端まで2日目かけて北上した分を1日で高速で一気にかっ飛ばしたため移動距離は420kmと長め。疲れた。


肉が柔らかい
3日目行程
3日目行程

9/22(Fri.)

・疲れたので宿で程々にゆっくりしつつ朝食を食べ出発。

・少し北上し平泉の中尊寺へ。金色堂を始めいろいろと参拝。


中尊寺金色堂の覆堂 575

・宮城県、松島へ。遊覧船に乗り島々を遊覧。その後遅めの昼食に牛タンを食べた。


松島の島々

・ようやくレンタカーを返却。ちょっとゆったりしすぎたか時間ギリギリになった。
車ではこの日は120km、4日間で約1100kmの移動。長い。

・仙台駅で立て替えの精算をし、駅前のカラオケで1時間歌って解散した。コロナ以来の人とのカラオケ。4日も同じ車に乗ってたんだからまあ濃厚接触も今更ですね。

・筆者はそのまま新幹線で帰省。東北→東海道とこんなに新幹線に乗ったのも初めて。
一気に620kmを駆け抜け4日間での累計移動距離は約2000kmとなった。

4日目行程
4日目行程

結び

筆者は普段食事にはあまり頓着しないのだが、今回はいろいろと美味いものを食べた。たまにはこういうのもいいなと感じられる旅行となった。



[1]: 筆者は現在県人寮に在籍中である。基本的に学部4年間専用だが若干名は2年間延長可能なのでちょいちょい院生がいる。

[2]: インテリジェントミラーというらしい。