<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://leedh.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://leedh.github.io/" rel="alternate" type="text/html" /><updated>2025-11-20T01:34:38+09:00</updated><id>https://leedh.github.io/feed.xml</id><title type="html">Dong Hee’s blog</title><subtitle>Exploring the world..</subtitle><author><name>Dong Hee</name></author><entry><title type="html">Prefrontal cortex as a meta-reinforcement learning system</title><link href="https://leedh.github.io/paper%20review/Wang_et_al-2018-NatNeurosci/" rel="alternate" type="text/html" title="Prefrontal cortex as a meta-reinforcement learning system" /><published>2025-11-18T00:00:00+09:00</published><updated>2025-11-18T00:00:00+09:00</updated><id>https://leedh.github.io/paper%20review/Wang_et_al-2018-NatNeurosci</id><content type="html" xml:base="https://leedh.github.io/paper%20review/Wang_et_al-2018-NatNeurosci/"><![CDATA[<p>논문 리뷰</p>]]></content><author><name>Dong Hee</name></author><category term="[&quot;paper review&quot;]" /><category term="neuroscience" /><category term="artificial intelligence" /><summary type="html"><![CDATA[published in Nature Neuroscience (2018) by Wang et al.]]></summary></entry><entry><title type="html">인지과학(Cognitive Science)이란?</title><link href="https://leedh.github.io/landscape/cognitive-science-kr/" rel="alternate" type="text/html" title="인지과학(Cognitive Science)이란?" /><published>2024-03-04T00:00:00+09:00</published><updated>2024-03-06T00:00:00+09:00</updated><id>https://leedh.github.io/landscape/cognitive-science-kr</id><content type="html" xml:base="https://leedh.github.io/landscape/cognitive-science-kr/"><![CDATA[<p><a href="/landscape/cognitive-science/">English version: <img src="/assets/images/flag_en.png" alt="English" width="5%" height="5%" /></a></p>

<p>인지과학에 대해서 개괄적으로 다룹니다. 본 포스팅의 많은 부분은 책 &lt;인지과학: 학문 간 융합의 원리와 응용&gt;<sup id="fnref:book1" role="doc-noteref"><a href="#fn:book1" class="footnote" rel="footnote">1</a></sup>를 참고했습니다.</p>

<h1 id="인지과학이란-무엇인가">인지과학이란 무엇인가?</h1>
<p>인지과학은 나(인간)에 대한 물음에서 출발합니다. <strong>“나의 마음이 어떻게 작동하는가?”</strong>라는 질문이 인지과학의 핵심입니다. (동물, 인간, 혹은 기계의) 마음과 지능에 대해서 던질 수 있는 모든 질문이 인지과학이 다루는 영역입니다. 하나의 학문이 이에 대한 답을 내릴 수는 없고, 자연과학과 인문사회과학을 넘나드는 통섭적인 접근법을 통해서 ‘나의 마음’에 대해 조금씩 알아갈 수 있습니다.</p>

<blockquote>
  <p>인지과학은 (1) 두뇌, (2) 마음, (3) 인공물의 정수인 컴퓨터, 그리고 (4) 기타 인공물 (언어, 경제, 행정체제 등의 소프트 인공물과 로봇, 스마트폰 등 각종 하드웨어 인공물 포함) 사이의 정보적, 인지적 (지식 형성 및 사용적) 관계를 다루는 다학문적, 학제적 과학이라고 정의할 수 있습니다.</p>
</blockquote>

<h2 id="정보처리-패러다임">정보처리 패러다임</h2>
<p>인지과학은 출발부터 인간의 마음과 그 물리적 구현체인 두뇌 그리고 컴퓨터를 바라보는 과학적 틀로써 정보처리 패러다임을 사용합니다. 인지과학의 정보처리 패러다임은 마음을 하나의 정보처리체계라고 상정하고, 정보처리체계로서의 마음의 작용을 감각, 지각, 학습, 기억, 언어, 사고, 정서 등의 여러 과정으로 나눈 다음, 각 과정에서 어떠한 정보처리가 일어나는가, 각 과정들은 어떻게 상호작용하는가를 묻고, 다음으로 각 과정에서 어떠한 정보(지식) 구조, 즉 표상 구조가 관련되는가를 규명하려 합니다.</p>

<p>정보처리 패러다임의 두 가지 중요한 개념은 계산주의와 표상주의 입니다.</p>
<ul>
  <li>계산주의(computation): 정보를 처리, 활용, 변환하는 과정을 계산이라 하며 마음과 컴퓨터의 계산 과정을 밝히는 활동이 정보처리 패러다임입니다.</li>
</ul>

<p class="notice--info"><strong>정보(information)란?</strong> 정보이론에서의 ‘정보’와 정보처리적 접근에서 ‘정보’는 정의가 다릅니다. 정보이론에서는 정보의 의미가 아니라 정보의 양을 다룹니다. 반면, 인지 현상을 표현할 때 말하는 정보는 일반적으로 메시지 의미의 개념(지식의 기본 단위)과 연관해서 ‘정보’라는 개념을 사용합니다.</p>

<ul>
  <li>표상주의(representation): 각종 데이터는 마음이나 컴퓨터에 표상의 형태로 저장되어 있다고 봅니다.</li>
</ul>

<p class="notice--info"><strong>표상(representation)이란?</strong> 마음이 다루는 대상 자체를 그대로 다루는 것(presentation)이 아니라 이를 어떤 상징이나 형태로 재표현(re-)하여, 즉 추상화하여 이를 저장하고 활용합니다. 이렇게 대상에 대한 추상화된 내용을 표상(表象; representation)이라 합니다.</p>

<h2 id="인지과정">인지과정</h2>
<p><img src="/assets/images/posts/2018cogsci_dtm.png" alt="trends_in_cogsci" />
인지과학이 다루는 앎의 과정(인지 과정;cognitive processes)은 여러 가지 있습니다. 위 그림은 2018년 한 논문이 주제별 트렌드를 조사한 결과입니다.<sup id="fnref:fig" role="doc-noteref"><a href="#fn:fig" class="footnote" rel="footnote">2</a></sup></p>

<p>제가 생각한 인지과정들은 아래와 같습니다.</p>
<ul>
  <li>Sensation</li>
  <li>Perception</li>
  <li>Cognitive Control</li>
  <li>Attention</li>
  <li>Reward / Punishment</li>
  <li>Value</li>
  <li>Learning</li>
  <li>Homeostasis</li>
  <li>Memory</li>
  <li>Language</li>
  <li>Decision Making</li>
  <li>Knowledge</li>
  <li>Thinking</li>
  <li>Feeling / Emotion/ Affect</li>
  <li>Social Cognition</li>
  <li>등등…</li>
</ul>

<h1 id="인지과학의-특성">인지과학의 특성</h1>
<ol>
  <li>인지과학은 인간을, 마음을 정보처리 시스템으로 본다.</li>
  <li>정보처리 시스템의 기본 기능은 정보의 변환이라는 계산적 관점이 인지과학의 입장이다.</li>
  <li>정보처리 시스템은 표상(representation)을 다룬다는 표상주의가 인지과학의 또 다른 기본 입장이다.</li>
  <li>정보처리 시스템의 기초는 신경계라는 신경과학적 기초를 강조한다.</li>
  <li>인지과학적 정보처리 시스템은 다학문적 접근의 필요성을 강조한다.</li>
</ol>

<h1 id="인지과학의-접근-수준">인지과학의 접근 수준</h1>
<p>인간의 복잡한 심적 현상을 설명할 때 어떠한 수준으로 접근하는가는 연구자마다 다를 수 있습니다. 접근(설명) 수준에 대한 이론적 틀은 계산 시각 이론을 제안한 데이비드 마의 생각(Marr’s Three Levels)에 기반합니다. <sup id="fnref:book2" role="doc-noteref"><a href="#fn:book2" class="footnote" rel="footnote">3</a></sup></p>

<table>
  <thead>
    <tr>
      <th>수준</th>
      <th>내용</th>
      <th>관련분야</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Computational theory</td>
      <td>What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?(계산 목적)</td>
      <td>심리학, 언어학, 인류학 등</td>
    </tr>
    <tr>
      <td>Representation and algorithm</td>
      <td>How can this computational theory be implemented? In particular, what is the representation for the input and output, and what is the algorithm for the transformation?(논리적 절차)</td>
      <td>계산신경학, 계산언어학, 계산모델링</td>
    </tr>
    <tr>
      <td>Hardware implementation</td>
      <td>How can the representation and algorithm be realized physically?(물리적 구현)</td>
      <td>생물학, 신경과학, 전기전자공학</td>
    </tr>
  </tbody>
</table>

<p>이 세 수준은 서로 독립적입니다. 즉, 하나의 설명 수준이 다른 수준으로 반드시 환원될 수 있다는 것이 아니라 3가지 설명 수준이 모두 다 필요할 수 있으며 상보적 역할을 할 수 있다는 의미입니다.</p>

<h1 id="인지과학의-역사">인지과학의 역사</h1>
<p>인지과학은 1950년대 시작된 이래로 계속 변화해왔습니다.<sup id="fnref:book3" role="doc-noteref"><a href="#fn:book3" class="footnote" rel="footnote">4</a></sup></p>

<p><img src="/assets/images/posts/CognitiveScienceMapRiedlAVersionOne.png" alt="cogscimap" />
그림 출처: <a href="https://www.riedlanna.com/cognitivesciencemap.html">Anna Riedl 홈페이지</a></p>

<h2 id="초년기-1기-1950년대-말---1970년대-초">초년기 1기: 1950년대 말 - 1970년대 초</h2>
<p>1950년대부터 서구에서 기초과학으로 자리 잡은 인지과학은 하나의 과학혁명(Cognitive Revolution)이었습니다. 초기에 튜링기계를 중심으로한 계산주의가 나타나면서 정보처리 패러다임이 주목받기 시작했습니다. 인지과학 출발의 핵심은 “컴퓨터의 계산 과정과 인간 마음의 작동 과정이 정보처리라는 공통적인 개념으로 묶어서 생각할 수 있다.”입니다. 즉, 인간과 컴퓨터는 하드웨어가 다르지만 같은 종류의 시스템이라고 봅니다.</p>

<p>이 무렵 등장하여 직간접적으로 인지과학에 영향을 끼친 개념적(이론적) 틀과 경험적 연구들은 아래와 같습니다.</p>
<ul>
  <li>1936, 앨런 튜링의 자동기계 이론 (Automata)</li>
  <li>1943, 워렌 맥컬럭와 월터 피츠의 신경망 계산 모델</li>
  <li>1945, 폰 노이만의 컴퓨터 구조 이론 (Von Neumann architecture)</li>
  <li>1948, 클로드 섀넌의 정보 이론 (Information Theory)</li>
  <li>1948, 노버트 위너의 사이버네틱스 이론 (Cybernetics)</li>
  <li>1957, 허버트 사이먼과 앨런 뉴웰의 범용목적 기호(상징) 조작체계 이론 (General purpose symbol manipulation system)</li>
  <li>1957, 노엄 촘스키의 변형문법 언어 이론 (Syntactic Structures)</li>
  <li>인지심리학적 연구의 실험 결과들</li>
  <li>두뇌 손상자들에 대한 신경학적 연구 및 단일 세포 활동 기록 연구</li>
  <li>새로운 과학철학과 심리철학의 대두</li>
</ul>

<p>이러한 개념적 틀과 경험적 연구결과는 각기 다르게 등장해 통합되지 않다가 1956년 MIT에서 개최된 정보 이론 심포지엄(Symposium on information theory)을 기점으로 하나의 새로운 과학적 패러다임이 됩니다. 같은 해 여름 다트머스 대학에서 열린 학술대회(The Dartmouth Workshop)에서는 Artificial Intelligence(AI)라는 명칭이 존 매카시에 의해 최초로 공식적으로 사용됐으며, 이는 인공지능 분야의 본격적인 출발을 알렸습니다.</p>

<h2 id="초년기-2기-1970년대-말---1980년대-초">초년기 2기: 1970년대 말 - 1980년대 초</h2>
<p>인지과학이라는 틀 안에서 다학제적인 아이디어 교환이 컴퓨터라는 정보처리기계를 중심으로 계속 이어졌습니다. 또한, 1967년 율릭 나이서가 ‘인지심리학’이라는 명칭의 새로운 학문을 정립합니다. 그밖에 언어학, 인공지능학, 철학 등 여러 학문에서 여러 이론과 틀이 제안됩니다. 다만, 이 시기 신경과학에서는 분자생물학을 중심으로 매우 작은 단위의 연구가 떠오르며 인지과학과는 거리를 뒀습니다.</p>

<h2 id="청년기-1기-1980년대-중">청년기 1기: 1980년대 중</h2>
<p><img src="/assets/images/posts/backprop.png" alt="ANN" class="align-left" />
컴퓨터의 계산 과정처럼 바라보던 마음의 작동 과정이 1980년대부터 ‘뇌’의 작동 과정으로 바라보기 시작합니다. (생명체의 하드웨어인) 뇌와 신경계를 기초로 한 신경망 이론이 나오고 신경과학과의 연결점이 생겼습니다. 인공신경망(artificial neural networks) 분야의 기념비적인 논문이 1986년에 출간된건 우연이 아니었을 겁니다.<sup id="fnref:paper1" role="doc-noteref"><a href="#fn:paper1" class="footnote" rel="footnote">5</a></sup> 이 시기 연결주의에 의한 인지과학이 새로운 움직임으로 등장합니다.</p>

<h2 id="청년기-2기-1980년대-말---1990년대-초">청년기 2기: 1980년대 말 - 1990년대 초</h2>
<p><img src="/assets/images/posts/290px-1206_FMRI.jpg" alt="BOLD" class="align-left" />
인지과학은 더더욱 뇌 연구를 중심으로 발전했고 인지신경과학(Cognitive Neuroscience)이라는 분야가 정식으로 출범합니다. 현재까지도 뇌의 기능적 활동을 측정하는 도구로 많이 쓰이는 functional magnetic resonance imaging (fMRI)에 대한 탄생도 이 무렵입니다.<sup id="fnref:paper2" role="doc-noteref"><a href="#fn:paper2" class="footnote" rel="footnote">6</a></sup> 살아 있는 사람이 특정 과제를 수행할 때 뇌의 어느 부위가 활성화되는지를 측정할 수 있는 도구가 개발됨으로써 인지신경과학의 발전이 가속화되기 시작했습니다.</p>

<p>신경과학과 더불어 진화적 접근이 시도된 시기이기도 합니다. 다윈의 자연선택 이론에 근거하여, 행동 생물학 종간 비교 연구 및 뇌 모델링과 진화 연구, 유전자 알고리즘의 창안, 진화 과정의 컴퓨터 시뮬레이션 연구 등이 나타납니다.</p>

<h2 id="청년기-3기-1990년대-중">청년기 3기: 1990년대 중</h2>
<p>인지과학의 초년기, 청년기에 배척했던 ‘의식’ 및 ‘정서’에 대한 연구도 이 시기에 부활합니다. 또한, 문화사회적 환경 요인에 의해서 인간 마음이 변한다는 개념이 생깁니다. 이는 기존 인지신경과학이나 명제 중심의 논리적 체계에 의해서만 마음을 설명하던 접근법의 한계를 벗어나려는 시도였습니다. 마음과 환경의 상호작용을 강조함으로써 인간의 인지구조가 환경과 뗄 수 없음을 밝히기 시작합니다.</p>

<h2 id="청년기-4기-2000년대-이후">청년기 4기: 2000년대 이후</h2>
<p>물리학의 동역학적 접근이 도입되어 정적인 시간상에서의 정보처리를 강조한 과거의 전통적 인지주의에 반하여 흘러가는 시간 축에서의 정보처리 특성과 표상의 역동적 변화를 강조한 동역학체계적(Dynamical Systems) 접근이 주목받기 시작했습니다. 또한, 인지신경과학적 접근과 진화이론적 접근뿐만 아니라 몸에 바탕한 마음을 강조한 체화적(Embodied) 접근도 인지과학의 새로운 패러다임으로 부상하는 중입니다.</p>

<h1 id="인지과학의-주요-하위-분야">인지과학의 주요 하위 분야</h1>
<p><img src="/assets/images/posts/Cognitive_Science_Hexagon.png" alt="hexagon" class="align-center" /></p>
<ul>
  <li>철학: 인식론, 심신론, 과학철학, 논리학</li>
  <li>심리학: 연구 주제, 실험법, 마음, 인지, 인지공학</li>
  <li>신경과학: 뇌(신경계) 연구, 뇌/이상 손상 현상, 신경 구조와 과정</li>
  <li>인공지능학: 디지털 컴퓨터, 컴퓨터 유추, 저장된 프로그래밍 개념, 프로그래밍</li>
  <li>언어학: 형식 이론(formal theory), 내적 규칙 계산 언어학, 심적 능력</li>
  <li>인류학: 종/문화(사회)적 결정요인, 진화론</li>
</ul>

<p>이 외에도 수학, 물리학, 커뮤니케이션학, 사회학도 인지과학의 하위 분야로 볼 수 있습니다. 더 넓게 보면 전기공학, 로보틱스, 정보과학, 의학, 생물학, 건축학, 음악학, 문학, 예술학, 미학, 정치학, 경제학, 행정학, 교육학, 컴퓨터공학까지도 확장할 수 있습니다.</p>

<h2 id="인지과학-방법론">인지과학 방법론</h2>
<p>인지과학 연구방법은 여러 학문들이 기존에 연구하던 방법들이 모두 사용됩니다.</p>
<ul>
  <li>철학: 논리적, 형식적 분석</li>
  <li>심리학: 실험법, 시뮬레이션, 자연관찰법</li>
  <li>신경과학: 신경해부법, 뇌 손상법, 뇌영상법</li>
  <li>인공지능학: 시뮬레이션, 언어보고 분석법</li>
  <li>언어학: 형식적 분석, 자연관찰법, 실험법</li>
  <li>인류학: 민생방법, 자연관찰법</li>
</ul>

<h3 id="1-실험법">(1) 실험법</h3>
<ul>
  <li>반응시간 법(reaction time methods): 인지심리학의 중심 방법으로서 인지적 과제가 질적 또는 양적으로 달라짐에 따라 정보처리 시간(속도)이 달라진다고 보고, 문제 상황이 조금씩 달라짐에 따라 일어나는 반응시간의 차이에서 특정 정보처리 과정/구조가 존재하고 관여되었으며 진행되는가, 그리고 그 특성이 다른 과정이나 구조와 어떻게 다른가를 탐색하는 방법입니다.</li>
  <li>정신물리학 방법(psychophysics)
    <ul>
      <li>고전적 정신물리학적 방법: 물리적 자극의 크기나 강도가 변함에 따라 그에 대한 감각, 지각되는 정도, 즉 심리적 변화 정도가 어떻게 달라지는가를 탐색하는 방법입니다. 독일 심리학자 페히너가 정신물리학 방법을 탄생시켰으며 문턱값(threshold)을 주로 측정합니다.</li>
      <li>신호탐지 이론(signal detection theory): 인간의 자극에 대한 감각 반응은 단순히 자극 크기의 함수로 결정되는 것이 아니라, 인간의 주관적 결정과정이 개입된다는 것이 신호탐지 이론의 기본입장입니다. 자극 정보 수집 단계와 이를 평가하고 반응을 결정하는 단계라는 2 단계로 바라봅니다.</li>
    </ul>
  </li>
</ul>

<h3 id="2-컴퓨터-시뮬레이션">(2) 컴퓨터 시뮬레이션</h3>
<p>컴퓨터 시뮬레이션에서는 개인의 외적 반응과 내성 보고들을 근거로 하여 어떤 심리적 과정의 세부 정보처리 연산들을 논리적, 이성적으로 추론하고 명세화하여 분석하며, 이를 프로그램으로 바꾸어 컴퓨터에 넣었을 때 컴퓨터가 인간과 동일하게 행동하는가(출력을 내어놓는가)를 관찰함으로써 그 프로그램이, 즉 연구자가 상정한 정보처리 연산(operations)이 이론적으로 타당한지를 검증합니다.</p>

<h3 id="3-언어-보고-분석법-protocol-analysis">(3) 언어 보고 분석법 (Protocol analysis)</h3>
<p>19세기 마음에 대한 과학적 연구를 시작하던 시기에는 외부의 관찰뿐만 아니라 피험자들이 주관적으로 느낀 내적 경험을 보고한 데이터도 분석에 활용했습니다. 하지만, 이러한 내성법은 비과학적이라는 이유로 행동주의 심리학자들에 의해 거부됐으나 20세기 정보처리 패러다임 이후 다시 수정되어 부활했습니다. 내성법의 일종인 언어 보고 분석법은 어떤 과제를 수행하는 피험자의 과제 수행 과정에 대한 내성 언어 보고를 분석하는 방법입니다. 이 방법은 자극을 먼저 제시한 후, 마음 속에서 일어나는 정보처리 내용 그대로를 언어적으로 보고하도록 합니다.</p>

<h3 id="4-인지신경과학적-방법">(4) 인지신경과학적 방법</h3>
<p><img src="/assets/images/posts/spatiotemporal.png" alt="tools" />
신경과학 분야에서 사용하는 측정도구에 대한 공간해상도(spatial resolution)와 시간해상도(temporal resolution)을 한눈에 비교한 그림입니다. 참고로 봐주세요.<sup id="fnref:fig2" role="doc-noteref"><a href="#fn:fig2" class="footnote" rel="footnote">7</a></sup></p>

<h4 id="a-뇌영상-방법-neuroimaging">(a) 뇌영상 방법 (neuroimaging)</h4>
<h5 id="전기적-신호의-영상화">전기적 신호의 영상화</h5>

<table>
  <thead>
    <tr>
      <th>이름</th>
      <th>설명</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>단일세포기록법 (single cell recording)</td>
      <td>이 방법은 전극(electrode)을 직접 동물 뇌의 단일 뉴런 근처에 주입하여 이 뉴런의 전기적 활동을 컴퓨터로 기록함으로써 뉴런의 활동에 대한 정보를 제공합니다.</td>
    </tr>
    <tr>
      <td>뇌파분석법 (EEG: electroencephalogram)</td>
      <td>두피에 바깥에 다수의 전극을 부착하여 뇌의 전기적 활동을 기록하는 방법입니다. 뇌의 다양한 지점사이에서의 전위 차이를 기록하여 뇌파를 그려냅니다.</td>
    </tr>
    <tr>
      <td>사건관련전위차 (ERP: event-related potentials)</td>
      <td>동일한 자극 사건을 반복 제시하고 이들의 평균 전위를 얻어 측정치를 기록하는 방법입니다.</td>
    </tr>
    <tr>
      <td>뇌자도 (MEG: magnetoencephalography)</td>
      <td>뇌에서 발생하는 자기신호의 그림을 뇌자도라고 부르며, 뇌가 활동할 때 전기신호를 발생시킨 뒤 다시 자기신호를 만드는 과정을 초전도 센서로 측정하는 방법입니다. 이 방법은 시간해상도와 공간해상도의 한계를 어느 정도 극복하지만 복잡한 인지과제 수행 부위를 정확히 찾아내는 데에는 한계가 있어 fMRI 방법 등과 함께 사용합니다.</td>
    </tr>
  </tbody>
</table>

<h5 id="뇌-구조-및-기능의-영상화">뇌 구조 및 기능의 영상화</h5>

<table>
  <thead>
    <tr>
      <th>이름</th>
      <th>설명</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>컴퓨터단층촬영(CT: computerized tomography)</td>
      <td>X-ray를 이용하여 뇌의 구조를 3차원으로 영상화하는 방법입니다.</td>
    </tr>
    <tr>
      <td>단일광자방출단층촬영(SPECT: single photon emission computed tomography)</td>
      <td>국소 뇌혈류(regional cerebral blood flow)의 분표 변화를 관찰하는 기능적 뇌영상입니다.</td>
    </tr>
    <tr>
      <td>양전자방출단층촬영(PET: positron emission tomography)</td>
      <td>방사성동위원소를 혈관에 투여하고 이 물질이 방출하는 방사성을 감지하는 카메라로 영상을 만들어냅니다. fMRI 이전에 뇌와 인지기능 연구에서 많이 쓰였으나 최근엔 뇌의 분자수준에서 물질들을 영상화하는데 많이 쓰입니다.</td>
    </tr>
    <tr>
      <td>자기공명영상(MRI: magnetic resonance imaging)</td>
      <td>뇌의 해부학적 구조를 자기(magnetic) 성질을 이용하여 영상화하는 방법입니다.</td>
    </tr>
    <tr>
      <td>기능성자기공명영상(fMRI: functional magnetic resonance imaging)</td>
      <td>fMRI는 MRI 장비를 이용하며 혈관 내 산소 농도 차이(BOLD: blood oxygen level dependent) 신호를 반복 측정하여 뇌의 활성화 정도를 영상화합니다. 신경세포의 직접적인 활동이 아니라 이로 인한 혈류의 변화량을 통해 뇌의 기능을 간접적으로 살펴보긴 하지만 다른 어떠한 영상 기술보다 공간해상도 면에서 가장 좋은 퀄리티의 영상을 제공하고 비침습적이기 때문에 뇌와 인지기능의 관계를 연구할 때 가장 많이 사용되고 있는 방법입니다.</td>
    </tr>
    <tr>
      <td>MRS(magnetic resonance spectroscopy)</td>
      <td>뇌 물질의 80%를 차지하는 물분자가 아니라 나머지 20%를 차지하는 다른 물질들(micromolecule, cell membrane, glial cell 등)을 영상화하는 방법입니다.</td>
    </tr>
    <tr>
      <td>기능성근적외선기능영상(fNIS: functional near infrared spectroscopy)</td>
      <td>근적외선을 이용하여 혈류를 측정하는 방법으로, 산소와 결합한 헤모글로빈과 결합하지 않은 헤모글로빈의 농도를 측정하여 산소 소모량과 혈류 증가량을 측정합니다.</td>
    </tr>
    <tr>
      <td>DTI(diffusion tensor imaging)</td>
      <td>신경섬유들의 연결성을 시각화하는 방법으로 물 분자의 방향을 띤 움직임을 감지하여 신경섬유의 경로를 영상화합니다. 회백질(gray matter)가 아니라 백질(white matter)의 연결성을 봅니다.</td>
    </tr>
  </tbody>
</table>

<h4 id="b-뇌자극-방법-brain-stimulation">(b) 뇌자극 방법 (brain stimulation)</h4>

<table>
  <thead>
    <tr>
      <th>이름</th>
      <th>설명</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>경두개자기자극법(TMS: transcranial magnetic stimulation)</td>
      <td>뇌의 특정 영역을 의도적으로 자극함으로써 그 영역에서 진행 중인 정보처리 과정을 일시적으로 간섭 또는 활성화시킬 수 있습니다. 자기 코일을 통해 일련의 자기장 펄스(pulse)를 통해 두개골 밖에서 특정 부위에 전류를 흘려주면, 이 부위의 밑에 있는 뇌 영역에서 신경활동이 촉진 또는 방해됩니다.</td>
    </tr>
    <tr>
      <td>두개강내뇌자극법(intracranial brain stimulation)</td>
      <td>뇌 안에 전류를 직접 삽입하는 침습적 방법으로, 전극(electrode)을 삽입하여 뉴런의 활동 전위(action potential)을 의도적으로 일으키는 방법입니다.</td>
    </tr>
  </tbody>
</table>

<h4 id="c-신경심리검사-neuropsychological-tests">(c) 신경심리검사 (neuropsychological tests)</h4>
<p>심리검사의 일종으로 뇌 손상으로 인해 인지 및 행동 상의 문제가 발생하였는지 유무와 그 정도를 평가하는 방법입니다. 임상환경에서 주로 사용됩니다.</p>

<h4 id="d-신경과정의-계산적-모델링-computational-modeling">(d) 신경과정의 계산적 모델링 (computational modeling)</h4>
<p>이 접근 방법은 뇌가 본질적으로 뉴런이라는 단순한 요소가 많이 모여 병렬처리 시스템적으로 연결되어 작동한다는 입장입니다. 생물학적, 기능적으로 신경세포 또는 신경 시스템의 생리적 메커니즘과 변화를 수식을 통해 기술하며 수학적인 모델링하는 것에 초점을 둡니다. 상위 인지 과정보다는 주로 인간과 동물의 주의, 감각, 지각, 기초 기억 과정 등의 하위 인지 과정에 관심을 두며 이러한 인지 과정이 어떻게 일어나는지 시뮬레이션 방법을 사용하여 분석하고 모델링합니다.</p>

<h3 id="5-비실험적-방법">(5) 비실험적 방법</h3>
<ul>
  <li>사례 연구법: 극단적인 인지현상을 보여주는 사례에 대한 종단적 연구입니다.</li>
  <li>자연관찰법: 상황에 개입하거나 통제하지 않고 실험실이 아닌 자연 상황에서 있는 그대로 관찰하여 분석하는 방법입니다.</li>
  <li>담화분석법: 대화를 나누며 말하는 문장 속에 드러난 특징을 분석하는 방법입니다.</li>
</ul>

<h1 id="인지과학의-미래">인지과학의 미래</h1>
<p>인지과학이 묻고 있는 ‘나’에 대한 질문을 미래에는 어느 수준까지 답할 수 있을까요? 최근 인공지능의 급격한 발달은 어느 방향을 향해 달려가고 있고 향후 우리에게 어떤 영향을 끼칠까요?</p>

<ul>
  <li>UX/UI (User eXperience / User Interface): 인간의 인지, 정서, 동기 특성을 통합하여 소프트웨어 및 하드웨어 개발에 반영</li>
  <li>Robotics: 추상적인 인공지능 시스템이 아니라 구체적인 몸을 지닌 (embodied) 지능 시스템 개발</li>
  <li>BCI (Brain-Computer Interface): 컴퓨터를 뇌에 연결하여 뇌의 기능을 보완 및 강화시키는 인터페이스 개발</li>
</ul>

<hr />
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:book1" role="doc-endnote">
      <p>이정모. (2009). 인지 과학: 학문 간 융합 의 원리 와 응용. 성균관 대학교 출판부. <a href="#fnref:book1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:fig" role="doc-endnote">
      <p>Rothe A., Rich A. S., &amp; Li Z. (2018). Topics and Trends in Cognitive Science. In T. T. Rogers, M. Rau, X. Zhu, &amp; C. W. Kalish (Eds.), Proceedings of the 40th Annual Conference of the Cognitive Science Society (pp. 979-984). Austin, TX: Cognitive Science Society. (https://anselmrothe.github.io/publication/2018cogsci_dtm/) <a href="#fnref:fig" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:book2" role="doc-endnote">
      <p>Marr, D. (1982). Vision: A Computational Approach. Freeman &amp; Co. <a href="#fnref:book2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:book3" role="doc-endnote">
      <p>Boden, M. A. (2008). Mind as machine: A history of cognitive science. Oxford University Press. <a href="#fnref:book3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:paper1" role="doc-endnote">
      <p>Rumelhart, D. E., Hinton, G. E., &amp; Williams, R. J. (1986). Learning representations by back-propagating errors. nature, 323(6088), 533-536. <a href="#fnref:paper1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:paper2" role="doc-endnote">
      <p>Ogawa, S., Lee, T. M., Nayak, A. S., &amp; Glynn, P. (1990). Oxygenation‐sensitive contrast in magnetic resonance image of rodent brain at high magnetic fields. Magnetic resonance in medicine, 14(1), 68-78. <a href="#fnref:paper2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:fig2" role="doc-endnote">
      <p>Sejnowski, T. J., Churchland, P. S., &amp; Movshon, J. A. (2014). Putting big data to good use in neuroscience. Nature neuroscience, 17(11), 1440-1441. <a href="#fnref:fig2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Dong Hee</name></author><category term="[&quot;landscape&quot;]" /><category term="cognitive science" /><category term="cognition" /><summary type="html"><![CDATA[인지과학에 대해서 개괄적으로 다룹니다.]]></summary></entry><entry><title type="html">The Landscape of Cognitive Science</title><link href="https://leedh.github.io/landscape/cognitive-science/" rel="alternate" type="text/html" title="The Landscape of Cognitive Science" /><published>2024-03-04T00:00:00+09:00</published><updated>2024-03-06T00:00:00+09:00</updated><id>https://leedh.github.io/landscape/cognitive-science</id><content type="html" xml:base="https://leedh.github.io/landscape/cognitive-science/"><![CDATA[<p><a href="/landscape/cognitive-science-kr/">한국어 버전: <img src="/assets/images/flag_ko.png" alt="Korean" width="5%" height="5%" /></a></p>

<p>This provides an overview of cognitive science. Many parts of this post refer to the book &lt;Cognitive Science: Interdisciplinary Convergence and Applications&gt;<sup id="fnref:book1" role="doc-noteref"><a href="#fn:book1" class="footnote" rel="footnote">1</a></sup>.</p>

<h1 id="what-is-cognitive-science">What is cognitive science?</h1>
<p>Cognitive science originates from questions about the self, exploring how individual minds operate. All questions that can be asked about the mind and intelligence (of animals, humans, or machines) are the domain of cognitive science, highlighting the complexity and interdisciplinary nature of understanding cognition. It emphasizes that no single discipline can fully answer these profound questions. But, we can learn about the human mind one by one through an interdisciplinary approach that crosses the natural sciences, humanities, and social sciences.</p>

<blockquote>
  <p>Cognitive science explores the relationships between (1) the brain, (2) the mind, (3) technological innovations such as computers, and (4) other artifacts, including both tangible hardware like robots and smartphones, and intangible systems such as language, economy, and administrative structures. It is defined as a multidisciplinary and interdisciplinary field that examines the informational and cognitive aspects of knowledge formation and utilization.</p>
</blockquote>

<h2 id="information-processing-paradigm">Information processing paradigm</h2>
<p>From the start, cognitive science has employed the information processing paradigm as a foundational scientific framework to examine the human mind, its physical manifestation in the brain, and the computational analogs found in computers. This paradigm assumes that the mind functions are an information processing system, engaging in a series of processes such as sensation, perception, learning, memory, language, thinking, and emotion. It inquires into the specific types of information processing that occur within these processes, how each process interacts, and aims to describe the underlying informational (knowledge) structures—or representational structures—that facilitate each process.</p>

<p>Two important concepts in the information processing paradigm are computationalism and representationalism.</p>
<ul>
  <li>Computationalism: The process of processing, utilizing, and converting information is called computation. The information processing paradigm is the activity of uncovering the computational processes of the mind and computer.</li>
</ul>

<p class="notice--info">What is information? The definitions of ‘information’ in information theory and ‘information’ in the information processing approach are different. Information theory deals with the amount of information, not the meaning of information. On the other hand, when expressing cognitive phenomena, the concept of ‘information’ is generally used in relation to the concept of message meaning (the basic unit of knowledge).</p>

<ul>
  <li>Representationalism: It is believed that various data are stored in the form of representations in the mind or computer.</li>
</ul>

<p class="notice--info">What is representation? Rather than treating the object itself as is (presentation), the mind re-expresses (re-) it in some symbol or form, that is, abstracts it and stores and utilizes it. This abstracted content about an object is called a representation.</p>

<h2 id="cognitive-processes">cognitive processes</h2>
<p><img src="/assets/images/posts/2018cogsci_dtm.png" alt="trends_in_cogsci" />
Cognitive processes covered by cognitive science are various. The figure above shows topics and trends in cognitive science.<sup id="fnref:fig" role="doc-noteref"><a href="#fn:fig" class="footnote" rel="footnote">2</a></sup></p>

<p>The representative cognitive processes I think are as follows.</p>
<ul>
  <li>Sensation</li>
  <li>Perception</li>
  <li>Cognitive Control</li>
  <li>Attention</li>
  <li>Reward / Punishment</li>
  <li>Value</li>
  <li>Learning</li>
  <li>Homeostasis</li>
  <li>Memory</li>
  <li>Language</li>
  <li>Decision Making</li>
  <li>Knowledge</li>
  <li>Thinking</li>
  <li>Feeling / Emotion / Affect</li>
  <li>Social Cognition</li>
  <li>etc…</li>
</ul>

<h1 id="characteristics-of-cognitive-science">Characteristics of Cognitive Science</h1>
<ol>
  <li>Cognitive science views humans and the mind as an information processing system.</li>
  <li>Cognitive science’s position is that the basic function of an information processing system is the conversion of information.</li>
  <li>Representationalism, which states that information processing systems deal with representations, is another basic position in cognitive science.</li>
  <li>The foundation of information processing systems emphasizes the neuroscience foundation of the nervous system.</li>
  <li>Cognitive scientific information processing systems emphasize the need for a multidisciplinary approach.</li>
</ol>

<h1 id="levels-of-approach-in-cognitive-science">Levels of approach in cognitive science</h1>
<p>The level of approach taken when explaining complex human mental phenomena may vary from researcher to researcher. The theoretical framework for access (explanation) levels is based on the ideas of David Marr (Marr’s Three Levels), who proposed a theory of computational vision. <sup id="fnref:book2" role="doc-noteref"><a href="#fn:book2" class="footnote" rel="footnote">3</a></sup></p>

<table>
  <thead>
    <tr>
      <th>level</th>
      <th>detail</th>
      <th>related fields</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Computational theory</td>
      <td>What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?</td>
      <td>Psychology, linguistics, anthropology, etc.</td>
    </tr>
    <tr>
      <td>Representation and algorithm</td>
      <td>How can this computational theory be implemented? In particular, what is the representation for the input and output, and what is the algorithm for the transformation?</td>
      <td>Computational neurology, computational linguistics, computational modeling</td>
    </tr>
    <tr>
      <td>Hardware implementation</td>
      <td>How can the representation and algorithm be realized physically?</td>
      <td>Biology, neuroscience, electrical and electronic engineering</td>
    </tr>
  </tbody>
</table>

<p>These three levels are independent of each other. This does not mean that one level of explanation is necessarily reducible to another level, but rather that all three levels of explanation may be necessary and play complementary roles.</p>

<h1 id="history-of-cognitive-science">History of Cognitive Science</h1>
<p>Cognitive science has continued to change since its inception in the 1950s.<sup id="fnref:book3" role="doc-noteref"><a href="#fn:book3" class="footnote" rel="footnote">4</a></sup></p>

<p><img src="/assets/images/posts/CognitiveScienceMapRiedlAVersionOne.png" alt="cogscimap" />
figure source: <a href="https://www.riedlanna.com/cognitivesciencemap.html">Anna Riedl website</a></p>

<h2 id="early-years-1-late-1950s---early-1970s">Early Years 1: Late 1950s - Early 1970s</h2>
<p>Cognitive science, which has become a basic science in the West since the 1950s, was a scientific revolution. With the emergence of computationalism centered on Turing machines, the information processing paradigm began to gain attention. The core of the starting point of cognitive science is that “the computational process of a computer and the operating process of the human mind can be considered as a group under the common concept of information processing.” In other words, humans and computers have different hardware, but they are considered the same type of system.</p>

<p>The conceptual (theoretical) frameworks and empirical studies that emerged around this time and directly or indirectly influenced cognitive science are as follows.</p>
<ul>
  <li>1936, Alan Turing’s Automata</li>
  <li>1943, Warren McCulloch and Walter Pitts’ neural network computational model</li>
  <li>1945, Von Neumann architecture</li>
  <li>1948, Claude Shannon’s Information Theory</li>
  <li>1948, Norbert Wiener’s Cybernetics</li>
  <li>1957, Herbert Simon and Alan Newell’s general purpose symbol manipulation system theory</li>
  <li>1957, Noam Chomsky’s Syntactic Structures</li>
  <li>Experimental results from cognitive psychological research</li>
  <li>Neurological studies and single cell activity recording studies in brain-injured people</li>
  <li>Emergence of new philosophy of science and philosophy of mind</li>
</ul>

<p>These conceptual frameworks and empirical research results emerged differently and were not integrated, but became a new scientific paradigm starting with the Symposium on Information Theory held at MIT in 1956. At the Dartmouth Workshop held at Dartmouth College in the summer of the same year, the name Artificial Intelligence (AI) was first officially used by John McCarthy, marking the start of the field of artificial intelligence.</p>

<h2 id="early-years-2-late-1970s---early-1980s">Early Years 2: Late 1970s - Early 1980s</h2>
<p>Within the framework of cognitive science, multidisciplinary exchange of ideas continued centered around information processing machines called computers. Also, in 1967, Ulrik Neisser established a new discipline called ‘cognitive psychology’. In addition, various theories and frameworks are proposed in various disciplines such as linguistics, artificial intelligence, and philosophy. However, during this period, very small-scale research centered on molecular biology emerged in neuroscience and distanced itself from cognitive science.</p>

<h2 id="adolescence-1-mid-1980s">Adolescence 1: Mid-1980s</h2>
<p><img src="/assets/images/posts/backprop.png" alt="ANN" class="align-left" />
From the 1980s, the mind’s operating process, which was once viewed as a computer’s calculation process, began to be viewed as the ‘brain’ operating process. Neural network theory based on the brain and nervous system (the hardware of living organisms) emerged and a connection with neuroscience emerged. It may not have been a coincidence that a landmark paper in the field of artificial neural networks was published in 1986.<sup id="fnref:paper1" role="doc-noteref"><a href="#fn:paper1" class="footnote" rel="footnote">5</a></sup> At this time, cognitive science based on connectionism emerged as a new movement.</p>

<h2 id="adolescence-2-late-1980s---early-1990s">Adolescence 2: Late 1980s - Early 1990s</h2>
<p><img src="/assets/images/posts/290px-1206_FMRI.jpg" alt="BOLD" class="align-left" />
Cognitive science further developed with a focus on brain research, and a field called Cognitive Neuroscience was officially launched. The development of functional magnetic resonance imaging (fMRI), which is still widely used today as a tool to measure functional activity of the brain, also began around this time.<sup id="fnref:paper2" role="doc-noteref"><a href="#fn:paper2" class="footnote" rel="footnote">6</a></sup> Advances in cognitive neuroscience began to accelerate with the development of tools to measure which parts of the brain are activated when living people perform specific tasks.</p>

<p>It was also a time when evolutionary approaches were attempted along with neuroscience. Based on Darwin’s theory of natural selection, cross-species research in behavioral biology, brain modeling and evolution research, creation of genetic algorithms, and computer simulation research of the evolutionary process appear.</p>

<h2 id="adolescence-3-mid-1990s">Adolescence 3: Mid-1990s</h2>
<p>Research on ‘consciousness’ and ‘emotion’, which had been rejected in the early years of cognitive science, is also being revived during this period. Additionally, the concept arises that the human mind changes due to cultural, social and environmental factors. This began with the goal of breaking away from the limitations of approaches that explained the mind only through existing cognitive neuroscience or proposition-centered logical systems. By emphasizing the interaction between mind and environment, we begin to reveal that human cognitive structure is inseparable from the environment.</p>

<h2 id="adolescence-4-after-2000">Adolescence 4: After 2000</h2>
<p>With the introduction of the dynamical approach in physics, the Dynamical Systems approach, which emphasizes the dynamic changes in information processing characteristics and representations on the flowing time axis, is attracting attention, contrary to the traditional cognitivism of the past that emphasized information processing in static time. In addition, cognitive neuroscientific and evolutionary approaches, as well as embodied approaches that emphasize the mind based on the body, are emerging as new paradigms in cognitive science.</p>

<h1 id="major-subfields-of-cognitive-science">Major subfields of cognitive science</h1>
<p><img src="/assets/images/posts/Cognitive_Science_Hexagon.png" alt="hexagon" class="align-center" /></p>
<ul>
  <li>Philosophy: epistemology, mental theory, philosophy of science, logic</li>
  <li>Psychology: Research topics, experimental methods, mind, cognition, cognitive engineering</li>
  <li>Neuroscience: Study of the brain (nervous system), brain/abnormal injury phenomena, neural structures and processes</li>
  <li>Artificial intelligence: digital computers, computer analogies, stored programming concepts, programming</li>
  <li>Linguistics: formal theory, internal rule computational linguistics, mental abilities</li>
  <li>Anthropology: Species/Cultural (Social) Determinants, Evolutionary Theory</li>
</ul>

<p>In addition, mathematics, physics, communication studies, and sociology can also be considered subfields of cognitive science. More broadly, it can be expanded to include electrical engineering, robotics, information science, medicine, biology, architecture, music, literature, art, aesthetics, political science, economics, public administration, education, and computer engineering.</p>

<h2 id="cognitive-science-methodology">Cognitive Science Methodology</h2>
<p>Cognitive science research methods use all existing research methods from various disciplines.</p>
<ul>
  <li>Philosophy: logical and formal analysis</li>
  <li>Psychology: Experimental methods, simulations, natural observation methods</li>
  <li>Neuroscience: neuroanatomy, brain injury, brain imaging</li>
  <li>Artificial Intelligence: Simulation, language reporting analysis methods</li>
  <li>Linguistics: formal analysis, natural observation, experimental methods</li>
  <li>Anthropology: people’s livelihood methods, natural observation methods</li>
</ul>

<h3 id="1-experimental-method">(1) Experimental method</h3>
<ul>
  <li>Reaction time methods: As a central method in cognitive psychology, it is believed that information processing time (speed) changes as the cognitive task changes qualitatively or quantitatively, and it is determined from the difference in reaction time that occurs as the problem situation slightly changes. It is a method of exploring whether information processing processes/structures exist, are involved, and progress, and how their characteristics differ from other processes or structures.</li>
  <li>Psychophysics
    <ul>
      <li>Classic psychophysical method: This is a method of exploring how the sensation and perceived degree of a physical stimulus, that is, the degree of psychological change, changes as the size or intensity of the physical stimulus changes. German psychologist Fechner created the psychophysical method, which primarily measures thresholds.</li>
      <li>Signal detection theory: The basic position of signal detection theory is that the sensory response to a human stimulus is not simply determined as a function of the size of the stimulus, but rather involves the human subjective decision process. We look at it in two stages: (1) collecting stimulus information and (2) evaluating it and deciding on a response.</li>
    </ul>
  </li>
</ul>

<h3 id="2-computer-simulation">(2) Computer simulation</h3>
<p>In computer simulations, the detailed information processing operations of certain psychological processes are logically and rationally inferred, specified, and analyzed based on the individual’s external reactions and introspection reports. When this is converted into a program and inserted into a computer, does the computer behave the same as a human? By observing (whether output is produced), it is verified whether the program, that is, the information processing operations assumed by the researcher, are theoretically sound.</p>

<h3 id="3-protocol-analysis">(3) Protocol analysis</h3>
<p>When scientific research on the mind began in the 19th century, not only external observations but also data in which subjects reported their subjective inner experiences were used for analysis. However, this introspection method was rejected by behaviorist psychologists on the grounds that it was unscientific, but was revised and revived after the information processing paradigm of the 20th century. Verbal report analysis, a type of introspection method, is a method of analyzing introspective verbal reports about the process of performing a task by a subject performing a certain task. This method first presents a stimulus and then verbally reports the information processing that occurs in the mind.</p>

<h3 id="4-cognitive-neuroscience-methods">(4) Cognitive neuroscience methods</h3>
<p><img src="/assets/images/posts/spatiotemporal.png" alt="tools" />
This is an illustration comparing spatial resolution and temporal resolution at a glance for a measurement tool used in neuroscience.<sup id="fnref:fig2" role="doc-noteref"><a href="#fn:fig2" class="footnote" rel="footnote">7</a></sup></p>

<h4 id="a-neuroimaging">(a) Neuroimaging</h4>
<h5 id="imaging-of-electrical-signals">Imaging of electrical signals</h5>

<table>
  <thead>
    <tr>
      <th>name</th>
      <th>detail</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Single cell recording</td>
      <td>This method provides information about the activity of a neuron by injecting an electrode directly near a single neuron in the animal’s brain and recording the electrical activity of this neuron on a computer.</td>
    </tr>
    <tr>
      <td>Electroencephalogram (EEG)</td>
      <td>A method of recording the electrical activity of the brain by attaching multiple electrodes to the outside of the scalp. Brain waves are drawn by recording potential differences between various points in the brain.</td>
    </tr>
    <tr>
      <td>Event-related potentials (ERP)</td>
      <td>This is a method of repeatedly presenting the same stimulus event and recording the measurement by obtaining the average potential of these events.</td>
    </tr>
    <tr>
      <td>Magnetoencephalography (MEG)</td>
      <td>A picture of magnetic signals generated in the brain is called a magnetoencephalogram. It is a method of measuring the process of generating electrical signals when the brain is active and then creating magnetic signals again using a superconducting sensor. This method overcomes the limitations of temporal resolution and spatial resolution to some extent, but has limitations in accurately finding the area performing complex cognitive tasks, so it is usually used in conjunction with other methods such as fMRI.</td>
    </tr>
  </tbody>
</table>

<h5 id="imaging-of-brain-structure-and-function">Imaging of brain structure and function</h5>

<table>
  <thead>
    <tr>
      <th>name</th>
      <th>detail</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Computed tomography (CT: computerized tomography)</td>
      <td>A method of imaging the brain structure in three dimensions using X-rays.</td>
    </tr>
    <tr>
      <td>Single photon emission computed tomography (SPECT)</td>
      <td>Functional brain imaging that observes changes in distribution of regional cerebral blood flow.</td>
    </tr>
    <tr>
      <td>Positron emission tomography (PET)</td>
      <td>Radioactive isotopes are injected into blood vessels and images are created with a camera that detects the radioactivity emitted by this substance. Before fMRI, it was widely used in brain and cognitive function research, but recently it is widely used to image substances at the molecular level in the brain.</td>
    </tr>
    <tr>
      <td>Magnetic resonance imaging (MRI)</td>
      <td>A method of imaging the anatomical structure of the brain using magnetic properties.</td>
    </tr>
    <tr>
      <td>Functional magnetic resonance imaging (fMRI)</td>
      <td>fMRI uses MRI equipment and repeatedly measures blood oxygen level dependent (BOLD) signals to image the degree of brain activation. Although brain function is examined indirectly through the change in blood flow resulting from this rather than the direct activity of nerve cells, it provides the highest quality images in terms of spatial resolution than any other imaging technology and is non-invasive, so it can be used to examine the relationship between the brain and cognitive function. This is the most used method when researching.</td>
    </tr>
    <tr>
      <td>MRS (magnetic resonance spectroscopy)</td>
      <td>A method of imaging not the water molecules that make up 80% of brain matter, but other substances (micromolecules, cell membranes, glial cells, etc.) that make up the remaining 20%.</td>
    </tr>
    <tr>
      <td>Functional near infrared spectroscopy (fNIS)</td>
      <td>A method of measuring blood flow using near infrared rays. It measures oxygen consumption and increase in blood flow by measuring the concentration of hemoglobin bound to oxygen and hemoglobin not bound to oxygen.</td>
    </tr>
    <tr>
      <td>DTI (diffusion tensor imaging)</td>
      <td>A method of visualizing the connectivity of nerve fibers, it detects the directional movement of water molecules and images the path of the nerve fibers. We look at the connectivity of white matter, not gray matter.</td>
    </tr>
  </tbody>
</table>

<h4 id="b-brain-stimulation-method">(b) Brain stimulation method</h4>

<table>
  <thead>
    <tr>
      <th>name</th>
      <th>detail</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Transcranial magnetic stimulation (TMS)</td>
      <td>By intentionally stimulating a specific area of ​​the brain, information processing ongoing in that area can be temporarily interrupted or activated. When an electric current is passed through a series of magnetic field pulses through a magnetic coil to a specific area outside the skull, it stimulates or inhibits neural activity in the underlying brain area.</td>
    </tr>
    <tr>
      <td>Intracranial brain stimulation</td>
      <td>An invasive method of inserting an electric current directly into the brain. This method intentionally generates action potentials in neurons by inserting electrodes.</td>
    </tr>
  </tbody>
</table>

<h4 id="c-neuropsychological-tests">(c) Neuropsychological tests</h4>
<p>A type of psychological test that evaluates whether and to what extent cognitive and behavioral problems have occurred due to brain damage. It is mainly used in clinical settings.</p>

<h4 id="d-computational-modeling-of-neural-processes">(d) Computational modeling of neural processes</h4>
<p>This approach holds that the brain is essentially made up of many simple elements called neurons, which work in parallel and systematically connected. Biologically and functionally, the physiological mechanisms and changes of nerve cells or nervous systems are described through formulas and focus on mathematical modeling. Rather than higher-level cognitive processes, we are mainly interested in lower-level cognitive processes such as attention, sensation, perception, and basic memory processes in humans and animals, and use simulation methods to analyze and model how these cognitive processes occur.</p>

<h3 id="5-non-experimental-methods">(5) Non-experimental methods</h3>
<ul>
  <li>Case study method: A longitudinal study of cases that demonstrate extreme cognitive phenomena.</li>
  <li>Natural observation method: This is a method of observing and analyzing things as they are in natural situations, not in a laboratory, without intervening or controlling the situation.</li>
  <li>Discourse analysis: This is a method of analyzing the characteristics revealed in sentences spoken during conversation.</li>
</ul>

<h1 id="the-future-of-cognitive-science">The future of cognitive science</h1>
<p>To what extent will cognitive science be able to answer questions about ‘me’ in the future? In which direction is the recent rapid development of artificial intelligence heading and what impact will it have on us in the future?</p>

<ul>
  <li>UX/UI (User eXperience / User Interface): Integrating human cognitive, emotional, and motivational characteristics and reflecting them in software and hardware development</li>
  <li>Robotics: Developing a concrete, embodied intelligence system rather than an abstract artificial intelligence system</li>
  <li>BCI (Brain-Computer Interface): Development of an interface that complements and strengthens brain functions by connecting the computer to the brain</li>
</ul>

<hr />
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:book1" role="doc-endnote">
      <p>Lee Jeong-mo. (2009). Cognitive science: Interdisciplinary convergence and applications. Sungkyunkwan University Press. <a href="#fnref:book1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:fig" role="doc-endnote">
      <p>Rothe A., Rich A. S., &amp; Li Z. (2018). Topics and Trends in Cognitive Science. In T. T. Rogers, M. Rau, X. Zhu, &amp; C. W. Kalish (Eds.), Proceedings of the 40th Annual Conference of the Cognitive Science Society (pp. 979-984). Austin, TX: Cognitive Science Society. (https://anselmrothe.github.io/publication/2018cogsci_dtm/) <a href="#fnref:fig" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:book2" role="doc-endnote">
      <p>Marr, D. (1982). Vision: A Computational Approach. Freeman &amp; Co. <a href="#fnref:book2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:book3" role="doc-endnote">
      <p>Boden, M. A. (2008). Mind as machine: A history of cognitive science. Oxford University Press. <a href="#fnref:book3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:paper1" role="doc-endnote">
      <p>Rumelhart, D. E., Hinton, G. E., &amp; Williams, R. J. (1986). Learning representations by back-propagating errors. nature, 323(6088), 533-536. <a href="#fnref:paper1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:paper2" role="doc-endnote">
      <p>Ogawa, S., Lee, T. M., Nayak, A. S., &amp; Glynn, P. (1990). Oxygenation‐sensitive contrast in magnetic resonance image of rodent brain at high magnetic fields. Magnetic resonance in medicine, 14(1), 68-78. <a href="#fnref:paper2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:fig2" role="doc-endnote">
      <p>Sejnowski, T. J., Churchland, P. S., &amp; Movshon, J. A. (2014). Putting big data to good use in neuroscience. Nature neuroscience, 17(11), 1440-1441. <a href="#fnref:fig2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Dong Hee</name></author><category term="[&quot;landscape&quot;]" /><category term="cognitive science" /><category term="cognition" /><summary type="html"><![CDATA[This post provides an overview of cognitive science.]]></summary></entry><entry><title type="html">나만의 개발 환경 설정</title><link href="https://leedh.github.io/computer/mac-development-environment/" rel="alternate" type="text/html" title="나만의 개발 환경 설정" /><published>2022-02-19T00:00:00+09:00</published><updated>2022-02-19T00:00:00+09:00</updated><id>https://leedh.github.io/computer/mac-development-environment</id><content type="html" xml:base="https://leedh.github.io/computer/mac-development-environment/"><![CDATA[<p>macOS의 개발 환경을 예쁘고 생산적이게 만들어볼게요.</p>

<h1 id="-system-preferences"><img src="https://icons.iconarchive.com/icons/johanchalibert/mac-osx-yosemite/32/system-preferences-icon.png" alt="icon" /> System Preferences</h1>
<h2 id="mission-control">Mission Control</h2>
<ul>
  <li>Mission Control에서 <code class="language-plaintext highlighter-rouge">Automatically rearrance Spaces based on most recent use</code>를 체크 해제한다.
    <ul>
      <li>미션 컨트롤 창 순서가 의도치 않게 바뀌는 경우를 막는다.</li>
    </ul>
  </li>
</ul>

<h2 id="language--region">Language &amp; Region</h2>
<ul>
  <li>Language &amp; Region에서 <code class="language-plaintext highlighter-rouge">Preferred languages</code>의 순서를 English 최상위로 설정한다. 드래그로 순서 조절 가능하다.
    <ul>
      <li>간혹 locale 설정 때문에 오류가 발생하는 걸 방지해주고 영어 오류 메시지가 떠서 구글 검색에 용이하다.</li>
    </ul>
  </li>
</ul>

<h2 id="security--privacy">Security &amp; Privacy</h2>
<ul>
  <li>Security &amp; Privacy의 General 탭에 가면 <code class="language-plaintext highlighter-rouge">Require password</code>가 있다. 이를 5초로 설정했다.
    <ul>
      <li>잠자기 모드나 화면 보호기가 켜지면 패스워드를 요구하기까지 걸리는 시간을 의미한다.</li>
    </ul>
  </li>
  <li><code class="language-plaintext highlighter-rouge">Show a message when the screen is locked</code>에서 <code class="language-plaintext highlighter-rouge">Set Lock Message</code>에다가 연락처와 이름 등을 작성한다.
    <ul>
      <li>혹여 분실했을 경우 연락받을 수 있게 하기 위함이다.</li>
    </ul>
  </li>
</ul>

<h2 id="keyboard">Keyboard</h2>
<ul>
  <li>Keyboard에서 Text 탭에 가서 모든 자동변경 옵션을 체크 해제한다.
    <ul>
      <li><code class="language-plaintext highlighter-rouge">Correct spelling automatically</code></li>
      <li><code class="language-plaintext highlighter-rouge">Capitalize words automatically</code></li>
      <li><code class="language-plaintext highlighter-rouge">Add period with double-space</code></li>
      <li><code class="language-plaintext highlighter-rouge">Use smart quotes and dashes</code></li>
      <li>코드 작성 및 붙여넣기 할 때 컴퓨터가 의도치 않게 변경하는걸 방지한다.</li>
    </ul>
  </li>
  <li>Keyboard에서 Shortcut 탭에 가서 <code class="language-plaintext highlighter-rouge">Use Keyboard navigation to move focust between controls</code>을 체크한다.
    <ul>
      <li>링크나 버튼을 마우스 대신 키보드의 <code class="language-plaintext highlighter-rouge">Tab</code>과 <code class="language-plaintext highlighter-rouge">Shift</code>+<code class="language-plaintext highlighter-rouge">Tab</code>으로 이동할 수 있다.</li>
    </ul>
  </li>
</ul>

<h2 id="trackpad">Trackpad</h2>
<ul>
  <li>Trackpad의 Point &amp; Click 탭에서 <code class="language-plaintext highlighter-rouge">Tab to click</code>을 체크한다.
    <ul>
      <li>트랙패드에서 힘줘서 누르지 않고 살짝 터치만해도 클릭된다.</li>
    </ul>
  </li>
</ul>

<h2 id="accessibility">Accessibility</h2>
<ul>
  <li>Accessibility의 Pointer Control로 가면 Mouse &amp; Trackpad 탭이 있는데 여기서 Trackpad Options…에 <code class="language-plaintext highlighter-rouge">Enable dragging three finger drag</code> 설정을 해준다.
    <ul>
      <li>드래그 시 트랙패드를 계속 누를 필요 없고 세 손가락으로 할 수 있다.</li>
    </ul>
  </li>
</ul>

<h1 id="-finder-preferences"><img src="https://icons.iconarchive.com/icons/johanchalibert/mac-osx-yosemite/32/finder-icon.png" alt="icon" /> Finder Preferences</h1>
<p>Finder 앱을 열고 <code class="language-plaintext highlighter-rouge">Cmd</code> + <code class="language-plaintext highlighter-rouge">,</code>를 누르면 Finder Preference 창이 열린다.</p>
<h2 id="finder-폴더-기본-설정">Finder 폴더 기본 설정</h2>
<ul>
  <li>General 탭에서 <code class="language-plaintext highlighter-rouge">New Finder windows show</code>를 home directory로 설정한다.
    <ul>
      <li>Finder를 새로 킬 때마다 홈디렉토리가 열린다.</li>
    </ul>
  </li>
</ul>

<h2 id="파일-확장자-표시">파일 확장자 표시</h2>
<ul>
  <li>Advanced 탭에서 <code class="language-plaintext highlighter-rouge">Show all filename extensions</code>를 체크한다.</li>
</ul>

<h2 id="다운로드-폴더-설정">다운로드 폴더 설정</h2>
<p>Downloads 폴더에서 <code class="language-plaintext highlighter-rouge">Cmd</code> + <code class="language-plaintext highlighter-rouge">J</code>를 누른다.</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">Group By</code>는 Date Added, <code class="language-plaintext highlighter-rouge">Sort By</code>는 Name으로 설정
    <ul>
      <li>파일목록을 저장한 날짜별로 그룹화하고 그룹 내에서는 파일 이름으로 정렬한다.</li>
    </ul>
  </li>
</ul>

<h1 id="-homebrew"><img src="https://brew.sh/assets/img/homebrew-256x256.png" alt="icon" width="32px" height="32px" /> HomeBrew</h1>

<p><code class="language-plaintext highlighter-rouge">HomeBrew</code>는 프로그램 패키지를 관리해주는 프로그램이다. 각종 패키지를 다운로드받기 위해 먼저 HomeBrew를 다운로드 받는다.</p>

<p><a href="https://brew.sh">Homebrew 홈페이지</a> / <a href="https://docs.brew.sh/Manpage.html">brew 명령어</a> / <a href="https://formulae.brew.sh/">brew 패키지</a></p>

<p>아래의 명령어를 터미널에 입력해서 설치한다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>/usr/bin/ruby <span class="nt">-e</span> <span class="s2">"</span><span class="si">$(</span>curl <span class="nt">-fsSL</span> https://raw.githubusercontent.com/Homebrew/install/master/install<span class="si">)</span><span class="s2">"</span></code></pre></figure>

<p>잘 설치됐는지 확인한다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c"># brew test</span>
<span class="nv">$ </span>brew doctor
Your system is ready to brew.</code></pre></figure>

<h1 id="-xcode"><img src="https://icons.iconarchive.com/icons/artua/mac/32/Xcode-icon.png" alt="icon" /> Xcode</h1>
<p>Homebrew를 설치하면 자동으로 Xcode가 설치된다.</p>

<p>macOS는 gcc, make와 같은 컴파일 도구가 설치되어 있지 않아 명령어 도구(Command Line Tools)를 설치해야 한다. Xcode 전체를 설치할 필요 없고 명령어 도구만 따로 설치한다. <a href="https://developer.apple.com/xcode/">Xcode 홈페이지</a></p>

<p>아래는 혹~시 Homebrew 설치 안해을 경우 따로 Xcode를 설치하는 방법이다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>xcode-select <span class="nt">--install</span></code></pre></figure>

<p>잘 설치됐는지 확인한다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c"># gcc test</span>
<span class="nv">$ </span>gcc
clang: error: no input files</code></pre></figure>

<h1 id="-git"><img src="https://git-scm.com/images/logos/downloads/Git-Icon-1788C.png" alt="icon" width="32px" height="32px" /> git</h1>
<p>macOS에 기본으로 <code class="language-plaintext highlighter-rouge">git</code>이 설치되어 있지만, 최신버전으로 새롭게 설치해줘야 한다. 이때도 <code class="language-plaintext highlighter-rouge">brew</code>를 이용한다. 더불어 Git Large File Storage의 약자인 <code class="language-plaintext highlighter-rouge">git-lfs</code>도 같이 설치한다. 이거는 용량이 큰 바이너리 파일을 git으로 관리할 때 유용하다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew <span class="nb">install </span>git git-lfs</code></pre></figure>

<p>설치가 완료되면 개인정보 설정과 한글 파일명 처리를 위한 추가설정을 해준다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>git config <span class="nt">--global</span> user.name <span class="s2">"Your Name"</span>
<span class="nv">$ </span>git config <span class="nt">--global</span> user.email <span class="s2">"you@your-domain.com"</span>
<span class="nv">$ </span>git config <span class="nt">--global</span> core.precomposeunicode <span class="nb">true</span>
<span class="nv">$ </span>git config <span class="nt">--global</span> core.quotepath <span class="nb">false</span></code></pre></figure>

<h1 id="-zsh"><img src="https://camo.githubusercontent.com/4db3e4069e59f51d03dd3e7fa5e89ab8fb95c9f4acda36cd5bfdf58d95269d92/68747470733a2f2f6f686d797a73682e73332e616d617a6f6e6177732e636f6d2f6f6d7a2d616e73692d6769746875622e706e67" alt="icon" width="64px" height="64px" /> zsh</h1>
<p>macOS Catalina 부터는 기본 shell이 <code class="language-plaintext highlighter-rouge">zsh</code>이다. 이전 OS버전에서는 기본이 bash이었다. <code class="language-plaintext highlighter-rouge">zsh</code>는 <code class="language-plaintext highlighter-rouge">bash</code>에 추가적인 명령어를 추가하고 편의성을 개선한 새로운 shell이다. 한가지 예로 git 폴더 상태를 관리해주고 터미널의 상태를 나타내주는 기능이 있다.</p>

<p>현재 shell이 뭔지는 아래 명령어를 치면 나온다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span><span class="nb">echo</span> <span class="nv">$0</span></code></pre></figure>

<p>여기선 <code class="language-plaintext highlighter-rouge">zsh</code>를 사용할 것이다.</p>

<h2 id="oh-my-zsh">oh my zsh</h2>
<p><code class="language-plaintext highlighter-rouge">oh my zsh</code>는 <code class="language-plaintext highlighter-rouge">zsh</code>를 좀더 편리하게 이용하게 도와주는 일종의 <code class="language-plaintext highlighter-rouge">zsh</code>용 plugin이다. <code class="language-plaintext highlighter-rouge">oh my zsh</code>를 설치하면 <code class="language-plaintext highlighter-rouge">zsh</code>도 같이 설치된다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c"># curl을 먼저 설치한다.</span>
<span class="nv">$ </span>brew <span class="nb">install </span>curl
<span class="c"># oh my zsh를 설치한다.</span>
<span class="nv">$ </span>sh <span class="nt">-c</span> <span class="s2">"</span><span class="si">$(</span>curl <span class="nt">-fsSL</span> https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh<span class="si">)</span><span class="s2">"</span></code></pre></figure>

<p>설치가 끝나면 <code class="language-plaintext highlighter-rouge">~/.oh-my-zsh</code>에서 기본 테마와 플러그인을 확인할 수 있다.</p>

<p><code class="language-plaintext highlighter-rouge">oh my zsh</code>가 제공하는 기본 plugin은 <a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins">여기</a> 나와있다.</p>

<div class="notice--info">
  <p>oh my zsh를 설치하고 난 후, 터미널에 <code class="language-plaintext highlighter-rouge">$ open ~/.zshrc</code>를 치면 아래와 같은 텍스트파일을 볼 수 있다. 이곳에서 zsh와 관련한 여러가지 설정을 해준다.</p>

  <p><img src="../../assets/images/posts/zshrc_example.png" alt="1" width="50%" height="50%" class="align-center" /></p>

  <p>(참고) zshrc에서 rc는 <em>run command</em>의 약자란다.</p>
</div>

<h3 id="추가-plugin-설치">추가 plugin 설치</h3>

<p>기본 plugin 외에 추가적으로 plugin을 설치한다.</p>
<ul>
  <li><a href="https://github.com/zsh-users/zsh-syntax-highlighting">zsh-syntax-highlighting</a>: 명령어 강조</li>
  <li><a href="https://github.com/zsh-users/zsh-autosuggestions">zsh-autosuggestions</a>: 자동완성</li>
  <li><a href="https://github.com/djui/alias-tips">alias-tips</a>: 정의한 alias를 알려주는 도구</li>
  <li><a href="https://github.com/junegunn/fzf">fzf</a>: 강력하고 빠른 fuzzy finder 도구이다. 원하는 파일이나 히스토리를 찾아준다.
    <ul>
      <li><code class="language-plaintext highlighter-rouge">ctrl</code>+<code class="language-plaintext highlighter-rouge">T</code>: 하위 디렉토리 파일 검색</li>
      <li><code class="language-plaintext highlighter-rouge">ctrl</code>+<code class="language-plaintext highlighter-rouge">R</code>: 히스토리 검색</li>
      <li><code class="language-plaintext highlighter-rouge">esc</code>+<code class="language-plaintext highlighter-rouge">C</code>: 하위 디렉토리 검색 후 이동</li>
    </ul>
  </li>
  <li><a href="https://github.com/clvv/fasd">fasd</a>: 사용빈도가 높은 파일 또는 디렉토리 검색을 편하게 해준다.
    <ul>
      <li>명령어를 사용하기 위해서 어느정도 디렉토리 이동하고 파일 열고 해야한다. 히스토리가 쌓이면 사용빈도에 따라 검색결과가 나온다.</li>
      <li><code class="language-plaintext highlighter-rouge">z</code>: 디렉토리 이동</li>
      <li><code class="language-plaintext highlighter-rouge">s</code>: 파일/디렉토리 검색</li>
    </ul>
  </li>
  <li><a href="https://asdf-vm.com/">asdf vm</a>: 각종 언어나 프로그램(nodejs, ruby, python 등..)의 버전을 통합적으로 관리해주는 도구
    <ul>
      <li><code class="language-plaintext highlighter-rouge">asdf plugin list</code>: 설치된 plugin 목록</li>
      <li><code class="language-plaintext highlighter-rouge">asdf plugin add &lt;name&gt; [&lt;git-ref&gt;]</code>: plugin 설치</li>
      <li><code class="language-plaintext highlighter-rouge">asdf list all &lt;name&gt;</code>: 플러그인 설치 가능한 버전 확인</li>
      <li><code class="language-plaintext highlighter-rouge">asdf install &lt;name&gt; &lt;version&gt;</code>: 플러그인 버전 설치</li>
      <li><code class="language-plaintext highlighter-rouge">asdf local &lt;name&gt; &lt;version&gt;</code>: 현재 경로 기준 버전 사용 설정</li>
      <li><code class="language-plaintext highlighter-rouge">asdf global &lt;name&gt; &lt;version&gt;</code>: 전체 버전 사용 설정</li>
    </ul>
  </li>
  <li><a href="https://github.com/tmux/tmux">tmux</a>: Terminal MUltipleXer의 약자로 터미널에서 여러 개의 창을 쓸 때, 리눅스 원격 연결이 꺼져도 코드가 돌아가게 할 때 사용한다.
    <ul>
      <li>별도의 포스트로 자세히 다룰 예정이다.</li>
    </ul>
  </li>
</ul>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c"># zsh-syntax-highlighting</span>
<span class="nv">$ </span>git clone https://github.com/zsh-users/zsh-syntax-highlighting.git <span class="k">${</span><span class="nv">ZSH_CUSTOM</span><span class="k">:-</span><span class="p">~/.oh-my-zsh/custom</span><span class="k">}</span>/plugins/zsh-syntax-highlighting
<span class="c"># zsh-autosuggestions</span>
<span class="nv">$ </span>git clone git://github.com/zsh-users/zsh-autosuggestions <span class="nv">$ZSH_CUSTOM</span>/plugins/zsh-autosuggestions
<span class="c"># alias-tips</span>
<span class="nv">$ </span><span class="nb">cd</span> <span class="k">${</span><span class="nv">ZSH_CUSTOM1</span><span class="k">:-</span><span class="nv">$ZSH</span><span class="p">/custom</span><span class="k">}</span>/plugins <span class="c"># Go to your custom plugins folder</span>
<span class="nv">$ </span>git clone https://github.com/djui/alias-tips.git
<span class="c"># fzf</span>
<span class="nv">$ </span>brew <span class="nb">install </span>fzf
<span class="c"># fasd</span>
<span class="nv">$ </span>brew <span class="nb">install </span>fasd
<span class="c"># asdf</span>
<span class="nv">$ </span>brew <span class="nb">install </span>asdf
<span class="c"># tmux</span>
<span class="nv">$ </span>brew <span class="nb">install </span>tmux</code></pre></figure>

<p>plugin을 설치한 후에는 반드시 <code class="language-plaintext highlighter-rouge">~/.zshrc</code>파일에 설정값을 기입해줘야 한다. 파일을 열고 plugins 항목에 플러그인을 추가한다.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>plugins=(
  ...
  zsh-syntax-highlighting
  zsh-autosuggestions
  alias-tips
  fzf
  fasd
  asdf
  tmux
  ...
)
</code></pre></div></div>

<p>설정파일을 수정한 후에는 터미널을 재시작하거나 <code class="language-plaintext highlighter-rouge">source ~/.zshrc</code> 명령어를 실행하여 설정을 다시 불러와야 한다. 이제 명령어를 입력할 때 존재하지 않는 명령어는 빨간색으로 뜨고 한번 입력했던 명령어는 회색으로 나타나는 걸 확인할 수 있다.</p>

<h3 id="oh-my-zsh-팁">oh my zsh 팁</h3>

<ol>
  <li>명령어가 기억나지 않으면 <code class="language-plaintext highlighter-rouge">tab</code>키 누른다.</li>
  <li>cd ../.. 대신 <code class="language-plaintext highlighter-rouge">...</code>, <code class="language-plaintext highlighter-rouge">....</code>, <code class="language-plaintext highlighter-rouge">.....</code>, …</li>
  <li>단축명령어 - <code class="language-plaintext highlighter-rouge">git status</code> =&gt; <code class="language-plaintext highlighter-rouge">gst</code>, <code class="language-plaintext highlighter-rouge">git pull</code> =&gt; <code class="language-plaintext highlighter-rouge">gl</code> 등등 여러가지 있다.
    <ul>
      <li><a href="https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git">다양한 단축명령어</a></li>
    </ul>
  </li>
</ol>

<h2 id="zsh-theme">zsh theme</h2>
<p>zsh의 터미널을 더욱 꾸며기 theme을 설정해줘야한다. oh my zsh에서 제공하는 zsh theme 목록은 <a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Themes">여기</a>에서 확인할 수 있다.
예전에는 Powerlevel9k를 쓰다가 최근엔 더욱 심플한 cloud_custom을 사용한다.</p>

<h3 id="cloud_custom">cloud_custom</h3>
<p><a href="https://gist.github.com/lehighjcut/1eb32d9224bce3dbd5d42da99231c670">cloud_custom</a>은 <a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#cloud">cloud</a> theme을 변형한 것이다.</p>

<p>https://medium.com/dolomite-official/supercharge-your-productivity-with-iterm2-zsh-a1fbc7607cd6</p>

<h3 id="powerlevel9k">Powerlevel9k</h3>
<p><a href="https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-1-install-powerlevel9k">powerlevel9k</a>를 설정하기 위해 설정값들을 <code class="language-plaintext highlighter-rouge">~/.zshrc</code> 에 입력해준다.</p>

<p><code class="language-plaintext highlighter-rouge">.zshrc</code>에서 기본 ZSH_THEME는 아마 robbyrussell일텐데, 이걸 powerlevel9k로 바꿔준다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c"># (1) powerlevel9k가 방금 설치한 Nerd Font를 사용토록 셋팅한다.</span>
<span class="nv">$ </span><span class="nb">echo</span> <span class="s2">"POWERLEVEL9K_MODE='nerdfont-complete'"</span> <span class="o">&gt;&gt;</span> ~/.zshrc

<span class="c"># (2) github를 통해 `powerlevel9k`를 설치해서 역시 `~/.zshrc`에 삽입한다.</span>
<span class="nv">$ </span>git clone https://github.com/bhilburn/powerlevel9k.git ~/powerlevel9k	

<span class="nv">$ </span><span class="nb">echo</span> <span class="s1">'source  ~/powerlevel9k/powerlevel9k.zsh-theme'</span> <span class="o">&gt;&gt;</span> ~/.zshrc</code></pre></figure>

<div class="notice--info">
  <p><code class="language-plaintext highlighter-rouge">powerlevel9k</code>가 시작되기 전에 font가 셋업되어 있어야 한다.</p>

  <p><code class="language-plaintext highlighter-rouge">~/.zshrc</code>는 위에서부터 아래로 line by line로 명령어를 실행시키기 때문에 순서가 중요하다.</p>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>POWERLEVEL9K_MODE='nerdfont-complete'
source ~/powerlevel9k/powerlevel9k.zsh-theme
</code></pre></div>  </div>
  <p>반드시 이 순서어야 한다!</p>
</div>

<p>powerlevel9k의 configuration 변경하자.</p>

<p><code class="language-plaintext highlighter-rouge">~/.zshrc</code>에서 powerlevel9k의 환경변수의 configuration을 변경할 수 있다. 자세한 내용은 <a href="https://github.com/bhilburn/powerlevel9k#prompt-customization">이곳</a>을 참고한다.</p>

<p>내가 추가했던 셋팅은 다음과 같다.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh dir vcs newline status)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(ssh time)
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true

# reversed time format
POWERLEVEL9K_TIME_FORMAT='%D  {  %H:%M:%S}'
</code></pre></div></div>

<p>다른 유저들이 뽐낸 <a href="https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config">configuration을 구경</a>해볼 수도 있다.</p>

<h2 id="zsh-삭제">zsh 삭제</h2>

<p>이렇게 애써 설치한 zsh를 uninstall 해야될 때가 있다. 그때는 아래 링크를 참고하자.</p>

<p><a href="https://medium.com/the-code-review/back-to-bash-remove-zsh-and-terminal-themes-on-a-mac-step-by-step-f89f69d2ec73">Back to Bash: Remove Zsh and terminal themes on a Mac step-by-step</a></p>

<h1 id="-iterm"><img src="https://icons.iconarchive.com/icons/froyoshark/enkel/32/iTerm-icon.png" alt="icon" /> iterm</h1>

<p>macOS의 기본적인 terminal은 편의기능이 많이 부족하기 때문에 여러 편의기능을 갖춘 iterm을 사용한다.</p>

<p>대표 기능을 뽑아보면 아래와 같다. <a href="https://iterm2.com/features.html">기능 더보기</a></p>
<ul>
  <li>터미널 탭 기능 (+토글 단축키)</li>
  <li>터미널 Split View</li>
  <li>자동완성 기능</li>
  <li>터미널 내에서 단어 찾기</li>
  <li>마우스 없이 복사&amp;붙여넣기</li>
  <li>256 이상의 색상 지원</li>
</ul>

<p><a href="https://www.iterm2.com/downloads.html">iterm2 다운로드 페이지</a>에 가서 stable releases의 최신 버전을 다운로드 받는다.</p>

<p>혹은 커맨드로 설치 가능하다. 이러면 iTerm 어플리케이션이 <code class="language-plaintext highlighter-rouge">~/Applications</code> 폴더에 저장된다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew cask <span class="nb">install </span>iterm2</code></pre></figure>

<h2 id="gui-디자인-설정">GUI 디자인 설정</h2>
<p><code class="language-plaintext highlighter-rouge">Cmd</code> + <code class="language-plaintext highlighter-rouge">,</code>를 눌러 preference 창을 연다.</p>
<ul>
  <li>타이틀바 스타일 변경
    <ul>
      <li>Appearnce에서 General 탭에 Theme 중에서 <strong>Minimal</strong>를 좋아한다.</li>
    </ul>
  </li>
  <li>margin 키우기
    <ul>
      <li>Appearnce에서 Panes 탭에 <code class="language-plaintext highlighter-rouge">Side margins</code>를 12로 설정</li>
      <li>Appearnce에서 Panes 탭에 <code class="language-plaintext highlighter-rouge">Top &amp; bottom margins</code>를 10로 설정</li>
    </ul>
  </li>
  <li>탭 라인 제거
    <ul>
      <li>Advanced에서 Tabs의 <code class="language-plaintext highlighter-rouge">In the Minimal theme, how prominent should the tab outline be?</code>를 0으로 설정</li>
    </ul>
  </li>
  <li>줄 간격
    <ul>
      <li>Profiles의 Text 탭에서 n/n 줄간격을 110으로 설정</li>
    </ul>
  </li>
</ul>

<h2 id="한글파일-깨짐방지">한글파일 깨짐방지</h2>
<ul>
  <li>Preference의 Profiles에서 Text 탭을 보면 <code class="language-plaintext highlighter-rouge">Unicode normalization form</code>이 있다. 이걸 <code class="language-plaintext highlighter-rouge">UFC</code>로 설정한다.
    <ul>
      <li>파일명 또는 디렉토리명의 자/모가 분리되는 현상을 방지한다.</li>
    </ul>
  </li>
</ul>

<h2 id="단축키-설정">단축키 설정</h2>
<ul>
  <li>Preference의 Profiles에서 Keys 탭에 <code class="language-plaintext highlighter-rouge">Presets</code>을 눌러서 <code class="language-plaintext highlighter-rouge">Natural Text Editing</code>을 선택한다.
    <ul>
      <li><code class="language-plaintext highlighter-rouge">Option</code> + <code class="language-plaintext highlighter-rouge">&lt;-</code>/<code class="language-plaintext highlighter-rouge">-&gt;</code>를 이용하여 단어 단위로 커서를 이동할 수 있다.</li>
    </ul>
  </li>
</ul>

<h2 id="colour-scheme-고르기">colour scheme 고르기</h2>

<p><code class="language-plaintext highlighter-rouge">iterm</code>에는 많은 colour scheme이 있다. <a href="https://iterm2colorschemes.com">이곳</a>에서 기존에 설정된 scheme들 중 취향에 맞는 걸 다운로드 받는다. 나는 <strong>Matrix</strong>가 맘에 든다.</p>

<p><strong>preferences &gt; profile &gt; colors</strong>로 간다.</p>

<p><img src="../../assets/images/posts/color_setup.png" alt="2" width="50%" height="50%" class="align-center" /></p>

<p>import누르고 다운로드 받은 <code class="language-plaintext highlighter-rouge">matrix.itermcolors</code>를 고른다.</p>

<h2 id="fonts-설치">fonts 설치</h2>
<p>예전엔 Hack Nerd Font를 썼는데, 이제는 둥근모꼴을 쓴다.</p>
<h3 id="hack-nerd-font">Hack Nerd Font</h3>
<p>(powerlevel9k의 경우) 만약 zsh shell에서 특별한 icons를 띄우고 싶으면 특별한 fonts를 설치해줘야 한다. <a href="https://github.com/ryanoasis/nerd-fonts#font-installation">여러가지</a>가 있지만 개인적으로 <a href="https://github.com/ryanoasis/nerd-fonts#option-4-homebrew-fonts">nerd fonts</a>가 괜찮다.</p>

<p>아래의 두 명령어를 입력한다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew tap caskroom/fonts
<span class="nv">$ </span>brew cask <span class="nb">install </span>font-hack-nerd-font</code></pre></figure>

<p>그리고 나서, <strong>item &gt; preferences &gt; profiles &gt; text &gt; font &gt; Change Font</strong> 에서 Hack Nerd Font를 고른다.</p>

<p>개인적으로 선호하는 셋팅은 글씨크기 <em>18px</em>, <em>Vertical space 120%</em></p>

<p><img src="../../assets/images/posts/font_setup.png" alt="3" width="50%" height="50%" class="align-center" /></p>

<h3 id="둥근모꼴">둥근모꼴</h3>
<p>최근엔 깔끔하게 icons를 안띄우고 사용한다. 그래서 <strong>둥근모꼴</strong>을 사용한다. 레트로 감성이다.</p>

<p><a href="https://cactus.tistory.com/193">둥근모꼴 다운로드</a></p>

<h1 id="-vim"><img src="https://icons.iconarchive.com/icons/papirus-team/papirus-apps/32/vim-icon.png" alt="icon" /> Vim</h1>
<p>macOS에는 vi 커맨드가 기본적으로 내장되어 있다. vi 커맨드를 이용하여 에디터를 띄울 수 있는데, vi커멘드는 vim(Vi IMproved) 커멘드와 동일하게 동작한다.</p>

<p>vim 관련해서는 <a href="https://www.youtube.com/channel/UCpY9pb4-S0PwCJBp2r6nOvg">개발자의 맛</a>님의 <a href="https://youtu.be/IKa8RaTLTYc">vim 추천동영상</a>, <a href="https://www.youtube.com/watch?v=oLvFt-UJ7UI&amp;t">vim plugin 동영상</a>이 많은 도움 되었다.</p>

<p class="text-center"><img src="../../assets/images/posts/vim_screen.png" alt="4" width="75%" height="75%" class="align-center" />
▲ 완성된 vim 화면</p>

<h2 id="vimrc">vimrc</h2>
<p><a href="https://github.com/amix/vimrc">The Ultimate Vim configuration</a>을 사용해서 기본적인 vim 환경을 세팅할 수 있다.</p>

<p>basic version과 awesome version이 있는데 basic version을 설치하자.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>git clone <span class="nt">--depth</span><span class="o">=</span>1 https://github.com/amix/vimrc.git ~/.vim_runtime
<span class="nv">$ </span>sh ~/.vim_runtime/install_basic_vimrc.sh</code></pre></figure>

<p>이로써 기본적인 vim 화면 구성은 마쳤으나, 몇 가지 기능을 더 추가했다.</p>

<p><a href="https://github.com/leedh/dotfiles/blob/main/.vimrc">여기</a>에서 나의 vimrc 파일 셋팅을 볼 수 있다.</p>

<h2 id="vim-plugins">vim plugins</h2>
<p>vim의 plugin에 대한 부분은 따로 자세한 포스팅을 작성하겠다.</p>

<h1 id="-docker"><img src="https://www.docker.com/sites/default/files/d8/2019-07/Moby-logo.png" alt="icon" width="32px" height="32px" /> docker</h1>

<p>docker에 대한 자세한 설명은 subicura님의 <a href="https://subicura.com/2017/01/19/docker-guide-for-beginners-1.html">도커 설명 글</a>이나 엘리님의 <a href="https://youtu.be/LXJhA3VWXFA">도커 설명 영상</a>를 참고하면 좋다.</p>

<p><a href="https://www.docker.com/">Docker 홈페이지</a></p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew cask <span class="nb">install </span>docker</code></pre></figure>

<h1 id="tig">tig</h1>
<p>tig란 Text-mode Interface for Git의 약자이다. 말 그대로 텍스트만으로 git을 관리할 수 있게 해주는 프로그램이다. git 자체로도 충분하지만 tig를 사용하여 여러 로그를 편하게 볼 수 있다.</p>

<p><a href="https://jonas.github.io/tig/">tig 홈페이지</a></p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew <span class="nb">install </span>tig</code></pre></figure>

<h1 id="jq">jq</h1>

<p>JSON 결과를 보기 좋게 시각화해주고 원하는 대로 편집할 수 있는 프로그램이다. 간단한 필터와 결과 변환이 가능하다.</p>

<p><a href="https://stedolan.github.io/jq/">jq 홈페이지</a></p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew <span class="nb">install </span>jq</code></pre></figure>

<h1 id="bat">bat</h1>
<p><code class="language-plaintext highlighter-rouge">cat</code> 명령어에 syntax highlighting과 여러 가지 기능이 추가된 명령어이다.</p>

<p><a href="https://github.com/sharkdp/bat">bat 홈페이지</a></p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew <span class="nb">install </span>bat</code></pre></figure>

<p><code class="language-plaintext highlighter-rouge">~/.zshrc</code>에서 <code class="language-plaintext highlighter-rouge">cat</code>대신 <code class="language-plaintext highlighter-rouge">bat</code>을 쓰도록 alias를 설정하자.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nb">alias cat</span><span class="o">=</span><span class="s2">"bat"</span></code></pre></figure>

<h1 id="openinterminal">OpenInTerminal</h1>
<p>Finder에서 바로 terminal 열 수 있는 도구이다. 설치 후 <code class="language-plaintext highlighter-rouge">cmd</code>누르고 드래그해서 버튼을 추가할 수 있다.</p>

<p><a href="https://github.com/Ji4n1ng/OpenInTerminal">OpenInTerminal github</a></p>

<p><img src="https://user-images.githubusercontent.com/11001224/78589385-b797b880-7872-11ea-9062-c11a49461598.gif" alt="sample" width="50%" height="50%" class="align-center" /></p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew <span class="nb">install</span> <span class="nt">--cask</span> openinterminal</code></pre></figure>

<h1 id="ngrok">ngrok</h1>
<p>로컬 서버를 터널링을 통해 외부로 오픈해주는 도구이다.</p>

<p><a href="https://ngrok.com/">ngrok 홈페이지</a></p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew cask <span class="nb">install </span>ngrok</code></pre></figure>

<h1 id="thefuck">thefuck</h1>
<p>오타나거나 잘못된 명령어를 실행했을 때, <code class="language-plaintext highlighter-rouge">fuck</code>을 외치면 제대로된 명령어를 실행시켜준다.</p>

<p><a href="https://github.com/nvbn/thefuck">thefuck github</a></p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span>brew <span class="nb">install </span>thefuck</code></pre></figure>

<h1 id="참고자료">참고자료</h1>

<ul>
  <li><a href="https://blog.pigno.se/post/184576332493/완벽한-mac-작업환경-세팅하기-vim-zsh-iterm">완벽한 mac 작업환경 세팅하기</a> 👍</li>
  <li><a href="https://subicura.com/2017/11/22/mac-os-development-environment-setup.html">본격 mac에 개발환경 구축하기</a> 👍</li>
  <li><a href="https://blog.funspaces.org/2017/02/13/z-shell-with-oh-my-zsh-config-guide/#z-shell-1990년에-나온-shell이-갑자기-왜">Z shell with Oh My Zsh Config Guide</a></li>
  <li><a href="https://beomi.github.io/2017/07/07/Beautify-ZSH/">멋진 Terminal 만들기</a></li>
</ul>]]></content><author><name>Dong Hee</name></author><category term="[&quot;computer&quot;]" /><category term="vim" /><summary type="html"><![CDATA[macOS의 개발 환경을 예쁘고 생산적이게 만들어볼게요.]]></summary></entry><entry><title type="html">좋은 git commit 메시지 작성하기</title><link href="https://leedh.github.io/computer/commit-message/" rel="alternate" type="text/html" title="좋은 git commit 메시지 작성하기" /><published>2021-11-20T00:00:00+09:00</published><updated>2021-11-20T00:00:00+09:00</updated><id>https://leedh.github.io/computer/commit-message</id><content type="html" xml:base="https://leedh.github.io/computer/commit-message/"><![CDATA[<p>git에서 commit 메시지를 짜임새 있게 적어야 일할 능률이 오를거에요.</p>

<p>git commit message는 쉘 프롬프트에서 아래와 같이 입력하면 된다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c"># commit message editor를 활용하는 방법</span>
<span class="nv">$ </span>git commit 

<span class="c"># 빠르고 간단한 방법</span>
<span class="nv">$ </span>git commit <span class="nt">-m</span> <span class="s2">"commit message title"</span> </code></pre></figure>

<h1 id="1-좋은-커밋을-위한-8가지-약속">1. 좋은 커밋을 위한 8가지 약속.</h1>

<ol>
  <li>제목과 본문을 한 줄 띄워 분리하기.</li>
  <li>제목은 영문 기준 50자 이내로.</li>
  <li>제목 첫글자를 대문자로.</li>
  <li>제목 끝에 <code class="language-plaintext highlighter-rouge">.</code> 금지.</li>
  <li>제목은 명령조로.</li>
  <li>Github - 제목(이나 본문)에 이슈 번호 붙이기.</li>
  <li>본문은 영문 기준 72자마다 줄 바꾸기.</li>
  <li>본문은 어떻게보다 무엇을, 왜에 맞춰 작성하기.</li>
</ol>

<h1 id="2-좋은-커밋의-목적">2. 좋은 커밋의 목적</h1>

<ul>
  <li>더 좋은 커밋 로그 가독성.</li>
  <li>더 나은 협업과 리뷰 프로세스.</li>
  <li>더 쉬운 코드 유지보수.</li>
  <li>커밋 메시지를 작성할 때는 기승전결(제목, 본문, 꼬리말)을 고려하고 나와 타인이 쉽게 이해하고 검색하기 좋도록 간결하고 명확하게 작성.</li>
</ul>

<h1 id="3-커밋-메시지-구조">3. 커밋 메시지 구조</h1>

<h2 id="title-제목">Title 제목</h2>

<p>Title은 <code class="language-plaintext highlighter-rouge">Type</code>과 <code class="language-plaintext highlighter-rouge">Subject</code>로 나뉜다.</p>

<p><code class="language-plaintext highlighter-rouge">Type</code>은 아래 중 하나를 목적에 맞게 쓴다.</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">init</code>: 초기화</li>
  <li><code class="language-plaintext highlighter-rouge">feat</code>: 새로운 기능 추가</li>
  <li><code class="language-plaintext highlighter-rouge">update</code>: 기능 보완 (업그레이드)</li>
  <li><code class="language-plaintext highlighter-rouge">remove</code>: 코드나 파일 제거</li>
  <li><code class="language-plaintext highlighter-rouge">fix</code>: 버그 수정</li>
  <li><code class="language-plaintext highlighter-rouge">config</code>: 설정 관련 파일 작성 또는 변경</li>
  <li><code class="language-plaintext highlighter-rouge">build</code>: 빌드 관련 파일 수정</li>
  <li><code class="language-plaintext highlighter-rouge">ci</code>: CI관련 설정 수정</li>
  <li><code class="language-plaintext highlighter-rouge">docs</code>: 문서 (문서 추가, 수정, 삭제)</li>
  <li><code class="language-plaintext highlighter-rouge">style</code>: 스타일 (코드 형식, 세미콜론 추가: 코드 로직에 변경 없는 경우)</li>
  <li><code class="language-plaintext highlighter-rouge">refactor</code>: 코드 리팩토링</li>
  <li><code class="language-plaintext highlighter-rouge">test</code>: 테스트 (테스트 코드 추가, 수정, 삭제: 코드 로직에 변경 없는 경우)</li>
  <li><code class="language-plaintext highlighter-rouge">chore</code>: 기타 변경사항 (스크립트 수정 등)</li>
</ul>

<p><code class="language-plaintext highlighter-rouge">Subject</code>는 아래 규칙을 지켜 통일감을 유지한다.</p>
<ul>
  <li>제목은 50자 이하</li>
  <li>제목 첫 글자는 대문자</li>
  <li>제목은 명령문</li>
  <li>제목 끝에 마침표(.) 금지</li>
  <li>제목과 본문을 한 줄 띄워 분리</li>
  <li>제목이나 본문에 이슈 번호(가 있다면) 붙임</li>
</ul>

<h2 id="content-본문">Content 본문</h2>
<ul>
  <li>쓸지 말지는 선택 사항</li>
  <li>최소 20자 필수 입력</li>
  <li>한 줄에 72자 이하</li>
  <li>어떻게(How)보다 무엇을, 왜(What, Why)에 맞춰 작성</li>
</ul>

<h2 id="footer-꼬리말">Footer 꼬리말</h2>
<ul>
  <li>쓸지 말지는 선택 사항</li>
  <li>
    <p>Issue tracker ID를 작성할 때 사용</p>
  </li>
  <li><code class="language-plaintext highlighter-rouge">Resolve</code>: 이슈 해결</li>
  <li><code class="language-plaintext highlighter-rouge">See also</code>: 참고할 이슈</li>
</ul>

<h3 id="github-이슈-자동-종료-팁">github 이슈 자동 종료 팁</h3>
<p>Github는 commit 메세지를 작성할 때 예약된 키워드를 사용하면 이슈가 자동으로 종료되는 기능을 탑재하고 있다. 예약어는 commit 메세지 어느 위치에서나 사용 가능합니다.</p>

<p>예시</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell">Resolve <span class="c">#337</span></code></pre></figure>

<p>사용되는 키워드</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">close</code></li>
  <li><code class="language-plaintext highlighter-rouge">closes</code></li>
  <li><code class="language-plaintext highlighter-rouge">closed</code></li>
  <li><code class="language-plaintext highlighter-rouge">fix</code></li>
  <li><code class="language-plaintext highlighter-rouge">fixes</code></li>
  <li><code class="language-plaintext highlighter-rouge">fixed</code></li>
  <li><code class="language-plaintext highlighter-rouge">resolve</code></li>
  <li><code class="language-plaintext highlighter-rouge">resolves</code></li>
  <li><code class="language-plaintext highlighter-rouge">resolved</code></li>
</ul>

<p>close 계열은 일반 개발 이슈, fix 계열은 버그 수정 이나 hot-fix 이슈, resolve 계열은 문의나 요청 사항에 대응한 이슈에 사용하면 적당하다.</p>

<h1 id="4-commit-message-template-만들기">4. Commit message template 만들기</h1>

<p>Commit message template을 적용할 git 프로젝트 폴더로 이동한 다음, <code class="language-plaintext highlighter-rouge">.gitmessage.txt</code> 파일을 생성한다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">$ </span><span class="nb">touch</span> ~/.gitmessage.txt
<span class="nv">$ </span>vi ~/.gitmessage.txt</code></pre></figure>

<p>커스텀 템플릿 파일을 아래와 같이 작성했다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c">##### 제목(title) #####</span>
<span class="c"># 50자 이내로</span>
<span class="c"># &lt;Type&gt;: &lt;Title&gt;</span>
<span class="c"># ex) docs: Add new post</span>
<span class="c"># 해당 라인 지우고 제목 작성</span>

<span class="c">##### 본문(content) #####</span>
<span class="c"># 72자마다 줄바꾸기</span>
<span class="c"># 해당 라인 지우고 본문 작성</span>

<span class="c">##### 꼬리말(footer) #####</span>
<span class="c"># 깃허브는 이슈종료 예약어 있음</span>
<span class="c"># &lt;Type&gt; #&lt;Issue number&gt;</span>
<span class="c"># ex) Resolve #122</span>
<span class="c"># 해당 라인 지우고 꼬리말 작성</span>

<span class="c">##### COMMIT END #####</span>
<span class="c"># &lt;Type&gt; 목록</span>
<span class="c"># init: 초기화</span>
<span class="c"># feat: 새로운 기능 추가</span>
<span class="c"># update: 기능 보완 (업그레이드)</span>
<span class="c"># remove: 코드나 파일 제거</span>
<span class="c"># fix: 버그 수정</span>
<span class="c"># config: 설정 관련 파일 작성 또는 변경</span>
<span class="c"># build: 빌드 관련 파일 수정</span>
<span class="c"># ci: CI관련 설정 수정</span>
<span class="c"># docs: 문서 (문서 추가, 수정, 삭제)</span>
<span class="c"># style: 스타일 (코드 형식, 세미콜론 추가: 코드 로직에 변경 없는 경우)</span>
<span class="c"># refactor: 코드 리팩토링</span>
<span class="c"># test: 테스트 (테스트 코드 추가, 수정, 삭제: 코드 로직에 변경 없는 경우)</span>
<span class="c"># chore: 기타 변경사항 (스크립트 수정 등)</span>
<span class="c">#</span>
<span class="c"># 제목 첫 글자는 대문자</span>
<span class="c"># 제목은 명령문</span>
<span class="c"># 제목 끝에 마침표(.) 금지</span>
<span class="c"># 제목과 본문을 한 줄 띄워 분리</span>
<span class="c"># 본문은 "어떻게" 보다 "무엇을"과 "왜"를 설명</span>
<span class="c"># 본문에 여러 줄의 메시지를 작성할 땐 "-" 혹은 "번호"로 구분</span>
<span class="c">##########################</span></code></pre></figure>

<p>작성을 했으면 git 설정에 템플릿 파일을 추가한다.</p>

<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c"># global하게 적용하는 경우</span>
<span class="nv">$ </span>git config <span class="nt">--global</span> commit.template ~/.gitmessage.txt

<span class="c"># 특정 프로젝트만 적용하는 경우</span>
<span class="nv">$ </span>git config commit.template .gitmessage.txt</code></pre></figure>

<p>이렇게 작업하면 앞으로 <code class="language-plaintext highlighter-rouge">git commit</code>으로 입력할 때 자동으로 템플릿이 나타난다.</p>

<p>또한 템플릿의 주석(#)은 실제 커밋시 포함이 되지 않는다.</p>

<h1 id="참고자료">참고자료</h1>
<ul>
  <li><a href="https://djkeh.github.io/articles/How-to-write-a-git-commit-message-kor/">좋은 git 커밋 메시지를 작성하기 위한 8가지 약속</a></li>
  <li><a href="https://git-scm.com/book/ko/v2/Git%EB%A7%9E%EC%B6%A4-Git-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0">[Git 공식문서] Git맞춤 - Git 설정하기</a></li>
  <li><a href="https://www.conventionalcommits.org/en/v1.0.0/">Conventional Commits</a></li>
</ul>]]></content><author><name>Dong Hee</name></author><category term="[&quot;computer&quot;]" /><category term="git" /><summary type="html"><![CDATA[git에서 commit 메시지를 짜임새 있게 적어야 일할 능률이 오를거에요.]]></summary></entry><entry><title type="html">Affective Neuroscience in a digital age</title><link href="https://leedh.github.io/talk/affective-neuroscience/" rel="alternate" type="text/html" title="Affective Neuroscience in a digital age" /><published>2020-07-29T00:00:00+09:00</published><updated>2020-07-29T00:00:00+09:00</updated><id>https://leedh.github.io/talk/affective-neuroscience</id><content type="html" xml:base="https://leedh.github.io/talk/affective-neuroscience/"><![CDATA[<p>성균관대 우충완 교수님이 바이오의공학개론 수업에서 강의하신 내용을 요약정리 했습니다.</p>

<!-- Courtesy of embedresponsively.com //-->

<div class="responsive-video-container">
    <iframe src="https://www.youtube-nocookie.com/embed/FgzQZ4UVE9k" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
  </div>

<h1 id="︎-what-is-emotion">▶︎ What is emotion?</h1>

<p>책 <a href="https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=118383616">&lt;감정은 어떻게 만들어지는가&gt;</a>는 감정을 다음과 같이 바라보고 있다.</p>

<ul>
  <li>“It is widely agreed that emotion refers to a <em>collection</em> of psychological states that include <em>subjective experience, expressive behavior</em> (e.g., facial, bodily, verbal), and <em>peripheral physiological responses</em>(e.g., heart rate, respiration)”</li>
  <li>“It is also widely agreed that emotions are a <em>central feature</em> in any psychological model of the human mind”
    <ul>
      <li>Affect가 먼저 일까? Cognition이 먼저 일까? Affect는 좋고 나쁨(호불호)이고, 이는 세포수준에서부터 고등생명체까지 모두가 갖고 있기 때문에 Affect가 먼저 일거라고 추측!</li>
    </ul>
  </li>
  <li>“Beyond these two points of agreement, however, almost everything else seems to be subject to debate”</li>
  <li>감정이 무엇인지는 감정이 어떻게 만들어지는지에 관한 이론마다 다르게 정의된다. 연구자마다 정의가 다르다.</li>
</ul>

<h1 id="︎-theories-of-emotion">▶︎ Theories of Emotion</h1>

<p><a href="https://journals.sagepub.com/doi/10.1177/1754073910380974">(Gross and Barrett, 2011)</a> 은 감정이론에 관한 리뷰논문이다. 감정이라는 하나의 주제를 놓고 논의된 여러 이론들의 공통점과 차이점을 보기에 큰 도움이 된다.</p>

<p><img src="https://i.imgur.com/82QHgkF.png" alt="afda-1" width="75%" height="75%" class="align-center" /></p>

<p><img src="https://i.imgur.com/DUjIvqI.png" alt="afda-2" width="75%" height="75%" class="align-center" /></p>

<ul>
  <li>감정에 대한 4가지 이론
    <ul>
      <li><strong>Basic 6 Emotions</strong> <em>(Paul Ekman)</em>
        <ul>
          <li>Sadness</li>
          <li>Joy</li>
          <li>Fear</li>
          <li>Disgust</li>
          <li>Anger</li>
          <li>Suprise</li>
        </ul>
      </li>
      <li><strong>Appraisal(평가, 해석)</strong> <em>(James Gross)</em>
        <ul>
          <li>Process를 통해 emotion generation이 일어난다.</li>
          <li>Situation -&gt; Attention -&gt; Appraisal -&gt; Response</li>
          <li>관련 자료 : Clore, Gerald L., and Andrew Ortony. “Cognitive neuroscience of emotion.” (2000).</li>
          <li>Affective Computing이라는 분야도 있다.</li>
        </ul>
      </li>
      <li><strong>Psychological Construction</strong>
        <ul>
          <li><a href="https://psycnet.apa.org/record/2002-08416-007">(Russell, 2003)</a>
            <ul>
              <li>Traditional view: Emotion as a mediator</li>
              <li><strong>Alternative view: Emotion as a construct</strong></li>
              <li>Emotion은 만들어지고 Collection이다. 실체가 없고 사회</li>
            </ul>
          </li>
        </ul>
      </li>
      <li><strong>Social Construction</strong></li>
    </ul>
  </li>
  <li>감정이론 비교. 특정 이론이 절대적으로 옳다고 할 수 없다. 각각의 이론을 지지하는 증거들이 존재하기 때문이다.</li>
</ul>

<p><img src="https://i.imgur.com/RDYCg6g.png" alt="afda-3" width="75%" height="75%" class="align-center" /></p>

<h1 id="︎-what-is-the-common-theme-here">▶︎ What is the common theme here?</h1>

<p>이러한 여러 감정이론 가운데 우충완 교수님은 Appraisal과 Psychological Construction 중간 쯤의 관점을 가지고 있다.</p>

<p>Basic Theories 쪽은 연구 역사가 오래된 만큼 많은 연구가 진행되어 왔다. 그러면 Psychological Construction과 Social Construction쪽에는 어떠한 합의점과 논쟁거리가 있는지 살펴보자.</p>

<ul>
  <li>
    <p>Emotions are more malleable than you think!</p>

    <ul>
      <li>Even for pain</li>
      <li>같은 자극에 대해서도 자주 변한다.</li>
    </ul>
  </li>
  <li>
    <p>Against Dualism(이원론)</p>

    <ol>
      <li>Emotion generation vs. regulation?
        <ul>
          <li>여태껏 generation과 regulation은 서로 다르다고 생각했다. 이분법적인 사고. 하지만, 이러한 접근에는 한계점이 명확하고 이 둘이 다르지 않다는 증거들이 속속 등장하고 있다.</li>
        </ul>
      </li>
      <li>Cognition vs. Emotion?
        <ul>
          <li>이 둘을 꼭 구분해야하는가?</li>
        </ul>
      </li>
      <li>Body vs. mind?</li>
    </ol>
  </li>
</ul>

<p>이제 하나씩 살펴보자.</p>

<h2 id="︎-emotions-are-more-malleable-than-you-think-the-case-of-pain">◼︎ Emotions are more malleable than you think! (The case of pain)</h2>

<h3 id="-pain-pathway-v10">∙ Pain pathway v1.0</h3>
<ul>
  <li>Descartes’ pain pathway (혹은 bell theory, specificity theory라고도 부름)<img src="https://i.imgur.com/jgKukt6.png" alt="afda-4" width="50%" height="50%" /></li>
  <li>외부자극을 받으면 사람은 수동적으로 그 자극에 따른 통증을 느낀다. 데카르트가 처음 주장한 이론이지만 지금까지도 많은 사람들이 이렇게 생각한다.
    <ul>
      <li><img src="https://i.imgur.com/kaxfYFs.jpg" alt="afda-5" width="50%" height="50%" />
        <ul>
          <li>이 그림은 Pain modulatory pathways을 나타낸다. <a href="https://www.nature.com/articles/nrgastro.2014.118">(Zhou &amp; Verne, 2014)</a>
            <ul>
              <li>왼쪽은 <strong>Ascending pain pathway</strong>이며 pain을 passive하고 단순히 response to noxious input으로만 본다. 이것만 보면 데카르트 관점이다.</li>
              <li>오른쪽은 <strong>Descending pain pathways</strong>이다. 이러한 pathway가 새로운 관점이다. passive하지 않고 active하게 pain을 느낀다.</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
  <li>pain pathway 1.0에 따른 치료법(Treatment)
    <ul>
      <li>Pain연구의 기념비적인 논문이 바로<a href="https://science.sciencemag.org/content/150/3699/971">(Melzack, 1965)</a> 이다.</li>
      <li>bell theory에 근거해서 pain pathway를 실제로 잘랐다.</li>
      <li>자른 결과
        <ul>
          <li>Selective benefits (They don’t always work)</li>
          <li>Sometimes makes pain worse</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h3 id="-pain-pathway-v20">∙ Pain pathway v2.0</h3>
<ul>
  <li>Brain filters, selects, and modulates noxious inputs</li>
  <li>Pain은 단순한 response to noxious input이 아니라 그 이상이다!</li>
  <li>Brain의 역할이 굉장히 중요하다.</li>
  <li>그렇다면 brain이 중요하다는 증거는 무엇일까?
    <ul>
      <li><strong>Evidence 1: Endogenous fluctuations in pain experience</strong>
        <ul>
          <li>한 사람에게 동일한 온도의 열자극을 주어도 느끼는 통증 정도는 매번 다르다.</li>
          <li>Woo, C., Schmidt, L., Krishnan, A. <em>et al.</em> Quantifying cerebral contributions to pain beyond nociception. <em>Nat Commun</em> <strong>8,</strong> 14211 (2017). https://doi.org/10.1038/ncomms14211</li>
        </ul>
      </li>
      <li><strong>Evidence 2: Just rethinking (cognitive self-regulation) can change pain</strong>
        <ul>
          <li>단순히 머리로 상상하는 것만으로도 느끼는 통증 정도가 매번 다르다.</li>
          <li>Woo CW, Roy M, Buhle JT, Wager TD (2015) Distinct Brain Systems Mediate the Effects of Nociceptive Input and Self-Regulation on Pain. PLOS Biology 13(1): e1002036. https://doi.org/10.1371/journal.pbio.1002036 -&gt; Brain이 바뀐다</li>
          <li><em>(replication)</em> Matthewson, Gordon M.; Woo, Choong-Wan; Reddan, Marianne C.; Wager, Tor D., Cognitive self-regulation influences pain-related physiology, PAIN: October 2019 - Volume 160 - Issue 10 - p 2338-2349 doi: 10.1097/j.pain.0000000000001621 -&gt; Body(physiology)가 바뀐다.</li>
        </ul>
      </li>
      <li><strong>Evidence 3: How other people rated can change pain</strong>
        <ul>
          <li>다른 사람이 이 자극에 대해서 얼만큼 아팠했는지 보여주고 그 다음 똑같은 자극을 주면, 둘의 차이가 엄청 난다. 즉, 다른 사람에 영향을 많이 받는다는 뜻. -&gt; <strong>social cue effects</strong></li>
          <li>Koban L, Wager TD. Beyond conformity: Social influences on pain reports and physiology. <em>Emotion</em>. 2016;16(1):24-32. doi:10.1037/emo0000087</li>
        </ul>
      </li>
      <li><strong>Evidence 4: Expectation (and placebo effects) can change pain</strong>
        <ul>
          <li>Pain predictive cues는 Low-pain cue와 High pain cue로 나뉘고 Heat intensity는 Low pain/Medium pain/High pain으로 나뉜다. cue를 다르게 주면 같은 온도라도 다르게 느낀다!</li>
          <li>Atlas, L. Y., Bolger, N., Lindquist, M. A., &amp; Wager, T. D. (2010). Brain mediators of predictive cue effects on perceived pain. <em>J Neurosci, 30</em>(39), 12964-12977. doi:10.1523/JNEUROSCI.0057-10.2010</li>
        </ul>
      </li>
      <li><strong>Evidence 5: Perceived control can change pain</strong>
        <ul>
          <li>내가 이 통증을 선택했는지 아닌지에 따라서 느끼는 게 다르다. 상황에 대한 통제력 -&gt; <strong>Perceived control effects</strong></li>
          <li>Woo, C., Schmidt, L., Krishnan, A. <em>et al.</em> Quantifying cerebral contributions to pain beyond nociception. <em>Nat Commun</em> <strong>8,</strong> 14211 (2017). https://doi.org/10.1038/ncomms14211</li>
        </ul>
      </li>
      <li><strong>Evidence 6: Distraction can change pain</strong>
        <ul>
          <li>아플 때 distraction해서 주의(attention)를 환기시키면 덜 아프게 느낀다.</li>
          <li>cognitive load에 높아질 수록 덜 아프게 느낀다.</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Pain as a multidimensional experience
    <ul>
      <li>Melzack이 Pain perception에 3 가지 components가 있다고 주장했다.<a href="https://onlinelibrary.wiley.com/doi/full/10.1111/j.1533-2500.2005.05203.x">(Melzack, 2005)</a>
        <ul>
          <li>Cognitive Components</li>
          <li>Sensory Components</li>
          <li>Affective Components</li>
        </ul>
      </li>
      <li><a href="https://stm.sciencemag.org/content/7/274/274fs6.full">(Wager &amp; Woo, 2015)</a> 에서도 System-level processes를 주장함.
        <ul>
          <li><img src="https://i.imgur.com/jdtiAZ0.jpg" alt="afda-6" width="75%" height="75%" class="align-center" />
            <ul>
              <li>Decision</li>
              <li>Meaning</li>
              <li>Sensory</li>
              <li>Affective or motivational</li>
            </ul>
          </li>
        </ul>
      </li>
      <li>좋은 진통제를 만들기 위하여 nociceptive receptor를 연구하는거 이외에 이러한 component를 어떻게 조절해서 통증을 줄일 수 있을지를 같이 연구해야된다.
        <ul>
          <li>미국에서는 마약성 진통제 중 하나인 opioid에 대한 중독 사례가 급증해서, 사회적 문제로 이어졌다. <a href="https://www.whitehouse.gov/articles/national-take-back-day-time-next-chapter-war-opioid-addiction/">백악관 성명</a>.</li>
        </ul>
      </li>
      <li>대체의학의 효과도 제대로 입증된게 없다. 예를 들면, 침(acupuncture), 명상(meditation), 심리치료(psychotherapy)가 pain을 줄여주긴 하는데 정확히 어떤 component에 의해서 효과를 내는지 제대로 밝혀야한다.</li>
    </ul>
  </li>
  <li>Treating pain by altering multidimensional contexts
    <ul>
      <li><a href="https://www.nature.com/articles/nrn3976?draft=marketing">(Wager &amp; Atlas, 2015)</a></li>
      <li><img src="https://i.imgur.com/AnAxTkr.png" alt="afda-7" width="75%" height="75%" class="align-center" /></li>
      <li>병원에서 치료할 때 contexts가 굉장한 효과를 낸다.</li>
    </ul>
  </li>
</ul>

<h2 id="︎-against-dualism1--emotion-generation-vs-regulation">◼︎ Against Dualism(1) : Emotion generation vs. regulation?</h2>

<h3 id="dominant-view">Dominant view</h3>
<ul>
  <li><em>Dual system</em> : Cortical (regulation) vs. sub-cortical (perception)</li>
  <li>brain의 sub-cortical area 중 특히 limbic system같은 곳에서 NACC나 amygdala 영역이 emotion을 generate한다고 한다. 근데 이때, 이 generation을 prefrontal cortex에서 suppress하거나 regulate한다. 그러던 중 이러한 prefrontal-subcortical circuit이 깨지면 self-regulatory failure가 발생한다.</li>
  <li><a href="https://www.sciencedirect.com/science/article/pii/S136466131000269X?via%3Dihub">(Heatherton &amp; Wagner, 2011)</a>, <a href="https://nyaspubs.onlinelibrary.wiley.com/doi/full/10.1111/j.1749-6632.2012.06751.x">(Ochsner et al, 2012)</a>, <a href="https://www.sciencedirect.com/science/article/pii/S0896627308007538?via%3Dihub">(Wager et al, 2008)</a></li>
  <li>promising view</li>
  <li>이때 뭐가 regulated되는건가? 이때 emtion이 무엇인가?</li>
  <li>Emotion as coordinated brain responses across multiple-systems!</li>
  <li>Emotions are arbitrary “label” for patterns of coordinated brain processes</li>
  <li>(Barrett et al, 2006, 2009, 2013), (Lindquist et al, 2011, 2012), (J. Price, 1999), (Bandler, 2000)</li>
</ul>

<h3 id="our-approach--develop-good-markers-first-then-study-the-effects-of-regulation">Our approach : Develop good markers first, then study the effects of regulation</h3>
<ul>
  <li>두 가지 관점 중에서 우충완 교수님 연구실은 promising view관점인데 biomakers를 개발하는데 집중하고 있다.</li>
  <li>Woo CW, Roy M, Buhle JT, Wager TD (2015) Distinct Brain Systems Mediate the Effects of Nociceptive Input and Self-Regulation on Pain. PLOS Biology 13(1): e1002036. https://doi.org/10.1371/journal.pbio.1002036
    <ul>
      <li>NPS<a href="https://www.nejm.org/doi/full/10.1056/nejmoa1204471">(Wager et al, 2013)</a> 라는 pain biomarker는 local area가 아니라 area간의 networks라는 관점에서 개발됐다. 이렇게 개발한 NPS를 가지고 이 논문의 실험(evidence2; imagination)에 적용해보니까, brain이 변화하긴 하는데 NPS의 pain system이 변화되는게 아니었다!</li>
      <li>오히려, emotion의 value(가치평가)에 중요한 영역이라고 알려진 Nac와 vmPFC가 mediate해서 통증regulated된 것이다.</li>
      <li>즉, Cognitive-self regulation때문에 thalamus와 insula같은 영역이 regulated되서 통증이 낮아진게 아니라, Cognitive self regulation과 pain system이 동시에 통증을 낮추는데 효과를 낸 것이다.
        <ul>
          <li>There can be multiple independent neural pathway(ingredients) to construct pain and emotion experience (more constructionist view)</li>
          <li>감정 조절은 또다른 감정을 만들어낸다.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h2 id="︎-against-dualism2--cognition-vs-emotion">◼︎ Against Dualism(2) : Cognition vs. Emotion?</h2>

<ul>
  <li>How emotions are made?
    <ul>
      <li>“Through Prediction, your brain constructs the world you experience”- Lisa Feldman Barrett.</li>
    </ul>
  </li>
  <li>Pain and pain regulation as predictive coding (Bayesian update)
    <ul>
      <li>prediction이라고 하는게 되게 이성적일거 같지만, 본능적이고 무의식적으로 우리 뇌에서 일어난다.</li>
      <li>Tabor A, Thacker MA, Moseley GL, Körding KP (2017) Pain: A Statistical Account. PLOS Computational Biology 13(1): e1005142. https://doi.org/10.1371/journal.pcbi.1005142</li>
      <li>Büchel C, Geuter S, Sprenger C, Eippert F. Placebo analgesia: a predictive coding perspective. <em>Neuron</em>. 2014;81(6):1223-1239. doi:10.1016/j.neuron.2014.02.042</li>
    </ul>
  </li>
  <li>Treatment context as multidimensional priors
    <ul>
      <li><a href="https://www.annualreviews.org/doi/abs/10.1146/annurev-neuro-072116-031132">Geuter, Koban, &amp; Wager, 2017</a></li>
      <li>treatment context(약을 먹는 상황)</li>
      <li>no-treatment context(약을 안먹는 상황)</li>
    </ul>
  </li>
  <li>Emotion as a meaning construction</li>
  <li>Emotion as visceral-affective-conceptual pattern generation process
    <ul>
      <li><a href="https://www.nature.com/articles/nrn3976?draft=marketing">(Wager &amp; Atlas, 2015)</a></li>
      <li><img src="https://i.imgur.com/qwA2N4j.png" alt="afda-8" width="75%" height="75%" class="align-center" /></li>
    </ul>
  </li>
</ul>

<h2 id="︎-against-dualism3--body-vs-mind">◼︎ Against Dualism(3) : Body vs. Mind?</h2>

<ul>
  <li>Chronic pain? Issues in internal contexts
    <ul>
      <li>chronic pain(만성통증)은 통증이 6개월 이상일 때 만성통증이라고 한다. 3개월 정도면 sub acute  pain이고, 다쳤을 당시에 아픈건 acute pain이라고 한다.</li>
      <li>Javeria A. Hashmi, Marwan N. Baliki, Lejian Huang, Alex T. Baria, Souraya Torbey, Kristina M. Hermann, Thomas J. Schnitzer, A. Vania Apkarian, Shape shifting pain: chronification of back pain shifts brain representation from nociceptive to emotional circuits, <em>Brain</em>, Volume 136, Issue 9, September 2013, Pages 2751–2768, https://doi.org/10.1093/brain/awt211
        <ul>
          <li>subacute pain 환자들을 대상하고 longtitudinal하게 scan을 했다. 즉, 주기적으로 여러번 찍었다.</li>
          <li>처음에는 sensory area가 significant하게 activation됐다고 나왔는데, 나중에는 emotional area가 activation 됐다
            <ul>
              <li>나중에 활성화된 영역은 default mode networks(다른 말로 self-referencial process)이다.</li>
            </ul>
          </li>
          <li>이 말은 Body에서 Mind로 shape shifting된다는 뜻이다. 통증의 원인이 바뀐다는 이야기.</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>The effects of concepts on bodily responses
    <ul>
      <li>COCOAN lab에서 Free-Association Semantic Task(FAST)라는 새로운 task를 개발했다.</li>
      <li>생각의 흐름</li>
    </ul>
  </li>
  <li>CNS control ANS: Visceromotor network
    <ul>
      <li>Saper CB. The central autonomic nervous system: conscious visceral perception and autonomic pattern generation. <em>Annu Rev Neurosci</em>. 2002;25:433-469. doi:10.1146/annurev.neuro.25.032502.111311</li>
      <li>ANS을 CNS가 조절한다. 즉, 뇌가 몸을 조절한다.</li>
      <li>Central Autonomic Nervous System이라는 개념을 만듬!</li>
    </ul>
  </li>
</ul>

<h1 id="︎-cocoan-lab에서-하는-일">▶︎ COCOAN lab에서 하는 일</h1>

<ol>
  <li>Neuroimaging-based pain decoding</li>
  <li>Decoding internal thoughts and emotions</li>
  <li>Translational neuroimaging</li>
  <li>Neural basis of pain and emotion regulation</li>
</ol>

<h2 id="︎-연구-방향">◼︎ 연구 방향!</h2>

<ul>
  <li>
    <p>Emotions are more malleable than you think! -&gt; <strong>Effective self-regulation (science of behavioral changes)</strong></p>
  </li>
  <li>
    <p>Against Dualism</p>
    <ol>
      <li>
        <p>Emotion generation vs. regulation? -<strong>&gt; Developing neuroimaging-based markers for pain emotions</strong></p>
      </li>
      <li>
        <p>Cognition vs. Emotion? -&gt; <strong>Modeling dynamic interactions between cognition and emotion, especially predictive coding and internal thoughts</strong></p>
      </li>
      <li>
        <p>Body vs. mind? -&gt; <strong>Understanding how the mind influences the body (mind-body interaction)</strong></p>
      </li>
    </ol>
  </li>
</ul>]]></content><author><name>Dong Hee</name></author><category term="talk" /><category term="emotion" /><category term="neuroscience" /><summary type="html"><![CDATA[정서신경과학(Affective Neuroscience)을 들어보셨나요]]></summary></entry><entry><title type="html">Statistics 101: part 2</title><link href="https://leedh.github.io/landscape/statistics101_2/" rel="alternate" type="text/html" title="Statistics 101: part 2" /><published>2020-03-02T00:00:00+09:00</published><updated>2020-03-02T00:00:00+09:00</updated><id>https://leedh.github.io/landscape/statistics101_2</id><content type="html" xml:base="https://leedh.github.io/landscape/statistics101_2/"><![CDATA[<h1 id="들어가며">들어가며</h1>
<h2 id="statistics-통계학">Statistics 통계학</h2>

<p>통계학은 관심 또는 연구대상이 되는 집단(모집단)의 특성을 파악하기 위해 모집단으로부터 일부의 자료(표본)를 수집, 정리, 요약, 분석하여 표본의 특성을 파악하고 이를 이용하여 모집단의 특성에 대해 추론하는 원리와 방법을 제공하는 학문이다.</p>

<ul>
  <li>목차는 <a href="http://www.aladin.co.kr/shop/wproduct.aspx?ItemId=103475034">&lt;예제로 배우는 R 데이터 분석 입문&gt;</a>를 참고했습니다.</li>
  <li>용어는 한국어와 영어를 병행 표기했습니다.</li>
</ul>

<h2 id="목차">목차</h2>
<ol>
  <li>데이터의 요약 및 표현</li>
  <li>확률변수와 분포함수</li>
  <li>통계적 추정과 검정</li>
  <li>평균차이 검정(t-test)</li>
  <li>분산분석(ANOVA)</li>
  <li>질적변수들의 연관성</li>
  <li>상관분석</li>
  <li>비모수적 검정</li>
</ol>

<h2 id="참고자료">참고자료</h2>
<ul>
  <li><a href="https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=171238">책 &lt;현대통계학&gt;</a></li>
  <li><a href="(http://www.aladin.co.kr/shop/wproduct.aspx?ItemId=103475034)">책 &lt;예제로 배우는 R 데이터 분석 입문&gt;</a></li>
  <li><a href="https://www.udemy.com/course/statsml_x/">강의 &lt;Master statistics&amp;machine learning: intuition, math, code&gt;</a></li>
  <li><a href="http://www.kocw.net/home/search/kemView.do?kemId=1056974">강의 &lt;확률 및 통계&gt; 이상화 교수</a></li>
  <li><a href="https://youtube.com/playlist?list=PLpIPLT0Pf7IqS4as3nefPyGv94r2aY6IT">강의 &lt;핵심 확률/통계&gt; 김성범 교수</a></li>
  <li><a href="https://statsthinking21.github.io/statsthinking21-core-site/">책 &lt;Statistical Thinking for the 21st Century&gt;</a></li>
</ul>

<h1 id="5-분산분석anova">5. 분산분석(ANOVA)</h1>
<p>독립표본 t-test은 두 집단간 평균을 비교하는데 사용된다. 이를 확장하여 세 개 이상의 집단들에 대한 ‘평균’을 비교하기 위해서 분산분석(analysis of variance: ANOVA)방법을 사용한다. 분산분석은 실험계획법(Experimental Design)에서 많이 사용하는 분석방법으로써 이름이 뜻하는 대로 특성값의 분산 또는 산포를 분석하는 방법이다. 즉, 특성값의 산포를 제곱합(sum of squares)으로 나타내고, 이 제곱합을 실험에 관련된 요인별로 분해하며, 순수한 오차에 의한 영향보다 큰 영향을 주는 요인이 어떤 것인가를 규명하는 분석방법이다.</p>

<p>이때, 실험계획에서는 비교하는 집단을 나누기 위한 집단변수의 범주를 처리(treatment) 혹은 요인수준(factor level, 인자수준)이라고 하고, 집단변수를 요인(factor, 인자)이라고 부른다.</p>

<p>The goal of ANOVA is to determine the effects of discrete independent variables(groups,levels) on a continuous dependent variable.</p>

<h2 id="1-실험연구-개념">(1) 실험연구 개념</h2>
<p>반복: 각 집단(or 처리)의 표본 수</p>

<h2 id="2-분산분석-개념">(2) 분산분석 개념</h2>

<h3 id="anova의-세-가지-가정">ANOVA의 세 가지 가정</h3>
<ul>
  <li>Independence: 샘플 데이터는 모집단에서 각각 독립적으로 추출됐다.</li>
  <li>Normality: residuals(모델에 fitting하고 unexplained variance)는 정규분포를 따른다.</li>
  <li>Homogeneity of variance (a.k.a. Heteroscedasticity): 각 셀마다 분산은 대략적으로 같다. 셀이라는건 아래 예시 테이블의 한 칸을 말한다. factor별, level별로 나눠진 셀들이 모두 같은 분산을 갖고 있다는 뜻이다.</li>
</ul>

<p>Medication이라는 하나의 Factor의 level이 A, B, Placebo 3가지 있다면 아래와 같이 정리 가능하다.</p>

<table>
  <thead>
    <tr>
      <th>Levels</th>
      <th style="text-align: center">A</th>
      <th style="text-align: center">B</th>
      <th style="text-align: center">Placebo</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>samples</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
  </tbody>
</table>

<p>Medication과 Age group이라는 두 개의 Factor가 각각의 levels을 가질 때는 아래와 같이 정리 가능하다.</p>

<table>
  <thead>
    <tr>
      <th>-</th>
      <th style="text-align: center">A</th>
      <th style="text-align: center">B</th>
      <th style="text-align: center">Placebo</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Younger</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
    <tr>
      <td>Older</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
  </tbody>
</table>

<h3 id="분산분석의-4-steps">분산분석의 4 steps</h3>
<ol>
  <li>실험계획을 살펴보고 ANOVA분석이 적절한지 확인한다.</li>
  <li>독립변수와 종속변수를 정한다.</li>
  <li>가능하면 factors와 levels의 ANOVA Table을 만든다.</li>
  <li>모델을 계산하고 결과를 해석한다.</li>
</ol>

<h3 id="여러가지-effects">여러가지 effects</h3>
<p>분산을 통해서 영향을 주는 요인을 구분짓는 분석이 ANOVA이다. 여러가지 영향(effects)이 있다</p>
<ul>
  <li>Fixed effects: The number of levels of a factor is fixed.</li>
  <li>Random effects: The factor is random in the population.</li>
  <li>Mixed effects: Both fixed and random factors</li>
</ul>

<p>mixed-effects ANOVA는 예를 들어 주관적인 행복감을 집 유형(fixed effects)와 연령(random factor)에 의해서 영향받는지 여부를 조사하는 분석이다.</p>

<h2 id="3-분산분석-분류">(3) 분산분석 분류</h2>

<p>집단을 나눠주는 요인의 수 기준으로 분산분석을 나눈다.</p>
<ul>
  <li>요인의 수가 하나이면 일원배치 분산분석(one-way ANOVA)</li>
  <li>요인의 수가 두 개이면 이원배치 분산분석(two-way ANOVA)</li>
</ul>

<p>반복 수가 같은지 여부에 따라서 분산분석을 나눈다.</p>
<ul>
  <li>반복수가 같은 경우 Balanced ANOVA
예를 들어, Age group이란 factor에 level이 younger, older있고, Medication이라는 factor에 A, B, Placebo가 있을 때 아래 표와 같이 모든 셀에 데이터 포인트, 즉 반복수가 같으면 Balanced한 경우다.</li>
</ul>

<table>
  <thead>
    <tr>
      <th>-</th>
      <th style="text-align: center">A</th>
      <th style="text-align: center">B</th>
      <th style="text-align: center">Placebo</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Younger</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
    <tr>
      <td>Older</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
  </tbody>
</table>

<ul>
  <li>반복수가 다른 경우 Unbalanced ANOVA
반면, 셀마다 데이터 포인트가 다르면, Unbalanced한 경우이다.</li>
</ul>

<table>
  <thead>
    <tr>
      <th>-</th>
      <th style="text-align: center">A</th>
      <th style="text-align: center">B</th>
      <th style="text-align: center">Placebo</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Younger</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">23</td>
      <td style="text-align: center">21</td>
    </tr>
    <tr>
      <td>Older</td>
      <td style="text-align: center">18</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
  </tbody>
</table>

<p>적어도 하나의 factor가 같은 individual로부터 multiple measurements를 한다면 그건 Repeated-measures ANOVA(rmANOVA)라고 한다.</p>

<h3 id="일원분류-분산분석one-way-anova">일원분류 분산분석(one-way ANOVA)</h3>
<p>일원배치 분산분석을 하기 위해서는 요인의 각 수준에서 자료의 모집단은 동일한 분산을 가지는 정규분포를 가정한다. 따라서 분산분석을 실행하기 전에 이 가정들이 만족되는지 검토하는 것이 좋다.</p>
<ul>
  <li>요인의 각 수준에서 표본이 대표본인 경우: 정규성의 검토 없이 분산분석이 가능</li>
  <li>요인의 각 수준에서 표본이 소표본인 경우: 정규성 검토가 필요
    <ul>
      <li>정규성 가정을 만족하지 않는 경우: 비모수적인 방법인 Kruskal-Wallis 방법을 사용</li>
    </ul>
  </li>
</ul>

<h4 id="sum-of-squares">Sum of squares</h4>
<p>ANOVA에서의 귀무가설과 대립가설부터 살펴본다.</p>
<ul>
  <li>$H_O: \mu_1=\mu_2=\cdots=\mu_k$
귀무가설은 ‘각 그룹들(위에서 본 테이블의 각 cell)의 평균들이 다 같다’</li>
  <li>$H_A: \mu_i\ne\mu_j$
대립가설은 ‘적어도 한 그룹의 평균이 하나 이상의 다른 그룹의 평균과 다르다’</li>
</ul>

\[SS=\sum_{i=1}^{n} (x_i-\bar{x})^2\]

\[\sigma^2=\frac{1}{n-1} \sum_{i=1}^{n} (x_i-\bar{x})^2\]

<p>sum of squares(SS)는 사실상 variance 공식과 같다. 다만 $\frac{1}{n-1}$이 없는건 각 셀마다 SS의 비율이 중요하기 때문이다.</p>

<p>ANOVA는 이 SS를 구분짓는 작업이다.</p>

<p>Total SS = Within-group SS(a.k.a. Error SS) + Between-group SS</p>

<p>하나의 셀 내에서의 variation을 Within-group SS라고 하고 모든 셀의 모든 sample의 total variation을 between-group SS라고 한다.</p>

<p>ANOVA는 F-검정으로 가설검정을 하는데 이때 필요한게 F-통계량이다. F-통계량은 두 분산의 비율이다.
\(\textrm{F}=\frac{\textrm{Explained\ variance}}{\textrm{Unexplained\ variance}}=\frac{\textrm{Due\ to\ factors}}{\textrm{Natural\ variation}}\)</p>

<p>F는 항상 양수이고 우리는 이 값이 크길 원한다. ⇒ statistically significant</p>

<p>다시 SS를 구분짓는 작업으로 돌아가서, Total SS, Between-group SS, Within-group SS를 아래 수식처럼 표현한다. 일단 factor가 1개이고 levels가 여러개인 경우라고 보자.</p>

\[SS_{\textrm{Total}}=\sum_{j=1}^{\textrm{levels}}\sum_{i=1}^{\textrm{individuals}} (x_{ij}-\bar{x})^2\]

\[SS_{\textrm{Between}}=\sum_{j=1}^{\textrm{levels}} (\bar{x}_{j}-\bar{x})^2n_j\]

\[SS_{\textrm{Within}}=\sum_{j=1}^{\textrm{levels}}\sum_{i=1}^{\textrm{individuals}} (x_{ij}-\bar{x}_j)^2\]

<ul>
  <li>$\textrm{levels}$: 여기서는 factor가 하나라고 가정했으니 levels의 개수는 그룹의 개수이다. $j$가 몇 번째 그룹인지 나타낸다.</li>
  <li>$\textrm{individuals}$: 한 그룹 내 데이터 포인트</li>
  <li>$n_j$ 한 그룹 내 individual의 개수</li>
  <li>$\bar{x}$: 모든 데이터의 평균</li>
  <li>$\bar{x}_j$: 하나의 그룹(셀) 안에서의 평균</li>
</ul>

<p>여기서 헷갈릴만한게 $SS_{\textrm{Between}}$ 에서 한 그룹 내에서 $\bar{x}<em>j$ 과 $\bar{x}$ 은 모든 individual한테 똑같다. 그래서 individual variability가 없어서 $\sum</em>{i=1}^{\textrm{individuals}}$ 를 안쓰고 단순히 $j$ 번째 그룹의 데이터 개수인 $n_j$ 를 곱했다.</p>

<p>세 SS의 degree of freedom(df)는 다음과 같다.</p>

\[df_{\textrm{Total}}=N-1\]

\[df_{\textrm{Between}}=k-1\]

\[df_{\textrm{Within}}=N-k\]

<ul>
  <li>$N$: 모든 데이터 수</li>
  <li>$k$: level의 개수(그룹 개수)</li>
</ul>

<p>여기서도 $df_{\textrm{Between}}$의 경우에 왜 $N$이 없냐면 그룹 내 데이터 포인터에 대해서 똑같은 $\bar{x}_j$를 갖기 때문이다.
No change -&gt; No degree of freedom</p>

<h4 id="f-test">F-test</h4>
<p>본격적인 F-검정을 위하여 계산한 sum of squares와 degree of freedom을 이용해서 Mean of Squares(MS)를 구하자.</p>

\[\textrm{MS}_\textrm{Between} = \frac{\textrm{SS}_\textrm{Between}}{df_\textrm{Between}} = \frac{\sum_{j=1}^{\textrm{levels}} (\bar{x}_{j}-\bar{x})^2n_j}{k-1}\]

\[\textrm{MS}_\textrm{Within} = \frac{\textrm{SS}_\textrm{Within}}{df_\textrm{Within}} = \frac{\sum_{j=1}^{\textrm{levels}}\sum_{i=1}^{\textrm{individuals}} (x_{ij}-\bar{x}_j)^2}{N-k}\]

\[F_{k-1,N-k}=\frac{\textrm{MS}_\textrm{Between}}{\textrm{MS}_\textrm{Within}}\]

<p>$F$-통계량은 2가지 degree of freedome이 있다. 하나는 MS_between의 분모인 $k-1$이고 다른 하나는 MS_within의 분모인 $N-k$이다.</p>

<h5 id="anova-table">ANOVA table</h5>

<table>
  <thead>
    <tr>
      <th style="text-align: center">Source of variance</th>
      <th style="text-align: center">SS</th>
      <th style="text-align: center">df</th>
      <th style="text-align: center">MS</th>
      <th style="text-align: center">F</th>
      <th style="text-align: center">P-value</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: center">Between groups</td>
      <td style="text-align: center">$SS_B$</td>
      <td style="text-align: center">$k-1$</td>
      <td style="text-align: center">$MS_B$</td>
      <td style="text-align: center">$MS_b/MS_W$</td>
      <td style="text-align: center">$p$</td>
    </tr>
    <tr>
      <td style="text-align: center">Within groups</td>
      <td style="text-align: center">$SS_W$</td>
      <td style="text-align: center">$N-k$</td>
      <td style="text-align: center">$MS_W$</td>
      <td style="text-align: center"> </td>
      <td style="text-align: center"> </td>
    </tr>
    <tr>
      <td style="text-align: center">Total</td>
      <td style="text-align: center">$SS_T$</td>
      <td style="text-align: center">$N-1$</td>
      <td style="text-align: center"> </td>
      <td style="text-align: center"> </td>
      <td style="text-align: center"> </td>
    </tr>
  </tbody>
</table>

<p>이게 ANOVA Table이다.</p>

<p>계산한 p-value로는 어떤 그룹끼리 차이가 있는지 알 수 없다. ANOVA로는 다른게 있을 수 있다는 점만 알 수 있다. 어떤 그룹끼리 다른지 알아보려면 추가적으로 t-test를 해야한다. (=post-hoc comparison)</p>

<p>하지만, pairwise t-tests를 하면 multiple comparison problem이 발생한다. 그리고 같은 실험에서 진행됐기 때문에 모든 그룹이 서로 independent하지 않다는 문제가 발생한다.</p>

<p>이 문제는 일반적으로 Tukey test로 해결한다. 새로운 통계량 $q$가 등장한다.
\(q=\frac{\bar{x}_b-\bar{x}_s}{\sqrt{MS_{\textrm{Within}}}\sqrt{2/n}}\)</p>

<p>두 개의 그룹(그룹$b$, 그룹$s$)을 비교할 때, 비교가 6번($_4C_2$) 이뤄 진다고 예를 들면 $q$값도 6개이다.</p>
<ul>
  <li>$\bar{x}_b$ : condition b에서의 평균</li>
  <li>$\bar{x}_s$ : condition s에서의 평균</li>
  <li>$\sqrt{MS_{within}}$ : variance와 관련</li>
  <li>$\sqrt{2/n}$ : sample size와 관련</li>
  <li>$q$는 $j,n-j$의 df를 갖는다.
    <ul>
      <li>$j$: 가능한한 모든 비교개수(6개)가 아니라 실질적으로 비교하고자 하는 비교개수(여기선 4개).</li>
      <li>$n$: 모든 데이터 포인트의 개수</li>
    </ul>
  </li>
</ul>

<p>tukey test는 t-test와 다르지만 개념적으로 유사한 방법이다.</p>

<p>주의할점은 ANOVA에서 post-hoc comparisons는 F-test가 유의미할때만 가능하다. F-test가 유의미하지 않을 때에는 post-hoc comparisons가 의미없다.</p>

<h4 id="balanced-반복수가-같은-경우-집단-간-동일한-표본크기">Balanced: 반복수가 같은 경우 (집단 간 동일한 표본크기)</h4>

<p>처리효과(treatment effect) = 주효과(main effect)</p>

<h4 id="unbalanced-반복수가-다른-경우-집단-간-상이한-표본크기">Unbalanced: 반복수가 다른 경우 (집단 간 상이한 표본크기)</h4>

<h3 id="이원분류-분산분석two-way-anova">이원분류 분산분석(two-way ANOVA)</h3>
<p>요인이 두 개인 경우의 분산분석을 이원배치 분산분석이라 하고 요인이 두 개 이상인 경우는 분산분석을 통하여 각 요인들의 평균 비교와 두 요인 이상의 결합평균 비교(상호작용 파악)를 할 수 있다.</p>

<p>Two-way ANOVA</p>
<blockquote>
  <p>To total variation in the dataset is the sum of the variation across individuals within each group AND the variation across the different levels <em>within each factor AND the variation at the interation between the factors</em></p>
</blockquote>

<p>Two-way ANOVA는 One-way ANOVA에서 더 나아가 factor들 사이의 interaction의 변동성까지 고려한 분석이다.</p>

<p>Factor가 Medication과 Age group 두 가지 있고 각각의 Levels가 있으면 아래와 같이 정리 가능하다.</p>

<table>
  <thead>
    <tr>
      <th>-</th>
      <th style="text-align: center">A</th>
      <th style="text-align: center">B</th>
      <th style="text-align: center">Placebo</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Younger</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
    <tr>
      <td>Older</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
      <td style="text-align: center">20</td>
    </tr>
  </tbody>
</table>

<p>Factor가 A,B인 2개인 Two-way ANOVA의 SS는 아래와 같이 계산한다.</p>

\[SS_{\textrm{Total}}=\sum_{k=1}^{\textrm{levels B}}\sum_{j=1}^{\textrm{levels A}}\sum_{i=1}^{\textrm{individuals}} (x_{ijk}-\bar{x})^2\]

\[SS_{\textrm{Between A}}=bn\sum_{j=1}^{\textrm{levels A}} (\bar{x}_{j}-\bar{x})^2\]

\[SS_{\textrm{Between B}}=an\sum_{k=1}^{\textrm{levels}} (\bar{x}_{k}-\bar{x})^2\]

\[SS_{A\times B}=\sum_{k=1}^{\textrm{levels B}}\sum_{j=1}^{\textrm{levels A}} (x_{jk}-\bar{x}_j-\bar{x}_k-\bar{x})^2\]

\[SS_{\textrm{Within}}=\sum_{k=1}^{\textrm{levels B}}\sum_{j=1}^{\textrm{levels A}}\sum_{i=1}^{\textrm{individuals}} (x_{ijk}-\bar{x}_{jk})^2\]

<ul>
  <li>$SS_{\textrm{Total}}$, $SS_{\textrm{Between A}}$, $SS_{\textrm{Between B}}$, $SS_{\textrm{Within}}$는 one-way ANOVA와 같다. (다만 $SS_{\textrm{Between A}}$, $SS_{\textrm{Between B}}$는 $a,b$ term이 추가됐다.)</li>
  <li>$SS_{A\times B}$는 two-way ANOVA에만 있는 term이다.</li>
</ul>

<p>각 SS의 degree of freedom(df)는 다음과 같다.</p>

\[df_{\textrm{Total}}=N-1\]

\[df_{\textrm{Between A}}=a-1\]

\[df_{\textrm{Between B}}=b-1\]

\[df_{A\times B}=(a-1)(b-1)\]

\[df_{\textrm{Within}}=N-ab\]

<ul>
  <li>$a$: A요소의 데이터 개수</li>
  <li>$b$: B요소의 데이터 개수</li>
</ul>

<h4 id="anova-table-1">ANOVA table</h4>

<table>
  <thead>
    <tr>
      <th style="text-align: center">Source of variance</th>
      <th style="text-align: center">SS</th>
      <th style="text-align: center">df</th>
      <th style="text-align: center">MS</th>
      <th style="text-align: center">F</th>
      <th style="text-align: center">P-value</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: center">Factor A</td>
      <td style="text-align: center">$SS_A$</td>
      <td style="text-align: center">$a-1$</td>
      <td style="text-align: center">$MS_A$</td>
      <td style="text-align: center">$MS_A/MS_W$</td>
      <td style="text-align: center">$p$</td>
    </tr>
    <tr>
      <td style="text-align: center">Factor B</td>
      <td style="text-align: center">$SS_B$</td>
      <td style="text-align: center">$b-1$</td>
      <td style="text-align: center">$MS_B$</td>
      <td style="text-align: center">$MS_b/MS_W$</td>
      <td style="text-align: center">$p$</td>
    </tr>
    <tr>
      <td style="text-align: center">$A\times B$ interact</td>
      <td style="text-align: center">$SS_{A\times B}$</td>
      <td style="text-align: center">$(a-1)(b-1)$</td>
      <td style="text-align: center">$MS_{A\times B}$</td>
      <td style="text-align: center">$MS_{A\times B}/MS_W$</td>
      <td style="text-align: center">$p$</td>
    </tr>
    <tr>
      <td style="text-align: center">Within(errors)</td>
      <td style="text-align: center">$SS_W$</td>
      <td style="text-align: center">$N-ab$</td>
      <td style="text-align: center">$MS_W$</td>
      <td style="text-align: center"> </td>
      <td style="text-align: center"> </td>
    </tr>
    <tr>
      <td style="text-align: center">Total</td>
      <td style="text-align: center">$SS_T$</td>
      <td style="text-align: center">$N-1$</td>
      <td style="text-align: center"> </td>
      <td style="text-align: center"> </td>
      <td style="text-align: center"> </td>
    </tr>
  </tbody>
</table>

<p>one-way ANOVA와 마찬가지로 마찬가지로 two-way ANOVA를 한 다음에 p값이 유의미하게 나오면, 어떤 그룹끼리 차이가나는지 확인하기 위해서 follow-up -t-test를 한다.</p>

<h4 id="반복이-없는-경우">반복이 없는 경우</h4>

<h4 id="반복이-있는-경우">반복이 있는 경우</h4>
<p>교호작용(interaction): 인자수준의 조합에서 생기는 효과. 인자 A의 효과가 인자 B의 수준의 변화에 따라 변하는 모형에서 이 교호작용이 존재한다.</p>

<h2 id="4-공분산분석ancova">(4) 공분산분석(ANCOVA)</h2>
<p>공분산분석은 Analysis of Covariance 로서 흔히 ANCOVA라고 부른다.
자료 형태는 일원배치 분석분석과 비슷하지만 공변량이라는 변수가 추가된 것만 다르다.</p>

<h2 id="5-dummy-coding">(5) Dummy-coding</h2>
<p>Dummy-coding: categorical 변수를 숫자로 변환하는 작업이다. 2개의 category를 숫자 {0,1}로 변환하는게 제일 좋다. 대표적인게 남녀 성별.</p>

<p>“1”이라는 변수가 “0”이라는 변수에 비하여 얼마나 변했는지를 factor의 effect가 보여줌으로써 해석해볼 수 있다.(“0” 변수가 마치 baseline처럼)</p>

<h2 id="6-manovamultivariate-anova">(6) MANOVA(multivariate ANOVA)</h2>
<p>보통 ANOVA는 종속변수가 1개이고 독립변수는 여러개이다.</p>

<p>MANOVA(multivariate ANOVA)는 종속변수도 여러개이고 독립변수도 여러개이다.</p>

<h1 id="6-질적변수들의-연관성">6. 질적변수들의 연관성</h1>

<h2 id="1-다항분포">(1) 다항분포</h2>
<ul>
  <li>범주형변수(categorical variable): 범주(category)를 값으로 갖는 변수</li>
  <li>다항시행 (multinomial trial): 한번의 시행에서 나타날 수 있는 결과가 여러 가지 중의 하나인 시행</li>
  <li>다항분포(multinomial distribution)</li>
</ul>

<h2 id="2-교차분석---카이제곱검정">(2) 교차분석 - 카이제곱검정</h2>
<p>교차분석은 범주형 자료(명목형이나 순서형 변수)인 두 개의 변수들 간의 연관성(association)을 알아보기 위한 분석으로서 이차원 분할표(contingency table)을 먼저 작성하고 두 변수간의 연관성을 분석한다.</p>

<h2 id="3-카이제곱-적합도-검정">(3) 카이제곱 적합도 검정</h2>

<h2 id="4-오즈비-odds-ratio">(4) 오즈비 (Odds Ratio)</h2>
<ul>
  <li>오즈비(Odds Ratio): 이차원 분할표에서 두 변수간 연관성을 나타내는 하나의 측도
    <ul>
      <li>$r=n:m=\frac{n}{m}$</li>
      <li>예) Odds가 6:1 이라는건 $n=6, m=1$이라는 뜻이고 비율이니 분수로도 표현가능하다.</li>
    </ul>
  </li>
</ul>

<h2 id="5-연관성의-측도">(5) 연관성의 측도</h2>
<ul>
  <li>카이제곱 통계량에 근거한 측도
    <ul>
      <li>파이 계수(Phi coefficient)</li>
      <li>크래머 V (Cramer’s V)</li>
      <li>분할계수(Contingency Coefficient)</li>
    </ul>
  </li>
  <li>명목형 변수들의 연관성
    <ul>
      <li>람다(Lambda)</li>
    </ul>
  </li>
  <li>순서형 변수들의 연관성
    <ul>
      <li>감마(Gamma): 분할표에서 두 순서형 변수 사이의 연관도를 재는 측도
        <ul>
          <li>일치쌍(concordant pair): 각 변수에 대한 관측값이 크기 순서에서 같은 방향에 있는 한 쌍의 관측개체</li>
          <li>불일치쌍(discordant pair): 각 변수에 대한 관측값이 크기 순서에서 반대방향에 있는 한 쌍의 관측개체</li>
        </ul>
      </li>
      <li>심슨의 역설(Simpson’s Paradox)
        <ul>
          <li>분할표 분석에 있어 전체분석결과와 세부분석의 결과가 모순되는 현상</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h1 id="7-상관분석">7. 상관분석</h1>
<p>두 개의 수치형 변수 간의 선형적인 연관성을 분석하는 방법이다.
t-test는 평균차이만 보기 때문에 분산은 신경안쓴다. 그래서 개인차를 무시하는 방법이다.</p>

<h2 id="1-상관계수의-개념">(1) 상관계수의 개념</h2>
<ul>
  <li>공분산(Covariance): 편차의 곱의 기대값
    <ul>
      <li>공분산은 측정단위의 변화에 영향을 받는다.</li>
    </ul>
  </li>
  <li>표준화(standardization) = 중심화/척도화
    <ul>
      <li>중심화(centering): 평균이 0이 되도록 함. 중심으로부터의 편차에 관심을 가짐.</li>
      <li>척도화(scaling): 표준편차가 1이 되도록 함. 측정단위 자체를 없앰.</li>
    </ul>
  </li>
  <li>상관계수(Pearson’s Correlation Coefficient)
    <ul>
      <li>표준화된 두 변수의 공분산</li>
      <li>공분산을 두 변수의 표준편차의 곱으로 나눈 것</li>
      <li>두 변수가 가지는 변이에 비하여 공유하는 변이의 양이 어느 정도인지를 나타냄</li>
    </ul>
  </li>
  <li>상관계수의 부호와 크기
    <ul>
      <li>상관계수의 부호는 증감의 방향성을 나타낸다.</li>
      <li>상관계수의 절대값의 크기는 직선의 주변에 자료가 어느정도 집중되어 있는지를 나타낸다.</li>
      <li>정도만 나타내는거지 수치의 배수적인 관계는 없다. 상관계수 2배하고 그러면 안된다.</li>
    </ul>
  </li>
  <li>상관계수 해석의 제약성: 선형성(Linearity)
    <ul>
      <li>상관계수는 두 변수의 ‘선형집중성’만을 재는 측도로서 비선형 연관관계를 반영하지는 못함</li>
      <li>산점도(scatter plot)은 이러한 관계를 직관적으로 판단하기에 좋은 그림이다..</li>
    </ul>
  </li>
</ul>

<h2 id="2-상관계수의-추정과-검정">(2) 상관계수의 추정과 검정</h2>
<h3 id="피어슨pearson의-상관계수">피어슨(Pearson)의 상관계수</h3>
<ul>
  <li>모수적 방법</li>
  <li>적률상관계수(product-moment correlation coefficient) = 모수적 상관계수</li>
  <li>대표본이거나 각 변수의 모집단 분포가 정규분포에 가깝다고 판단되는 경우에 사용</li>
  <li>t분포를 이용해 검정</li>
</ul>

<h3 id="스피어만spearman의-순위상관계수">스피어만(Spearman)의 순위상관계수</h3>
<ul>
  <li>비모수적 방법</li>
  <li>outlier에 robust하다.</li>
  <li>소표본이면서 정규성 가정을 하기가 어려운 경우, 특히 모집단의 분포가 대칭분포가 아니거나 대칭분포이지만 꼬리가 두터운 분포(상대적으로 아주 큰값이나 작은 값이 1% 이상 존재하는 경우)인 경우에 피어슨 상관계수 대신에 스피어만 순위상관계수를 사용</li>
  <li>순위상관계수는 피어슨 상관계수와 계산식의 형태는 동일하지만 자료의 실제 값 대신에 순위(rank)를 이용해 상관계수를 계산한다.</li>
  <li>p-value는 피어슨 상관계수와 같이 구한다.</li>
</ul>

<h3 id="켄달의-타우kendalls-tau">켄달의 타우(Kendall’s tau)</h3>
<ul>
  <li>스피어만 상관계수와 같이 비모수적 방법</li>
  <li>ordinal 데이터 타입에 사용한다. (e.g, 교육수준, 영화평점)</li>
  <li>해석은 피어슨과 스피어만과 같다.</li>
  <li>$\tau=K^{-1}\sum \textrm{sgn}(\tilde{x}<em>i-\tilde{x}</em>{i:})\textrm{sgn}(\tilde{y}<em>i-\tilde{y}</em>{i:})$
    <ul>
      <li>$\tilde{x}_i$: $x$의 rank값</li>
      <li>$\tilde{x}_{i:}$: ‘:’라는 python notation을 그대로 씀</li>
      <li>$K^{-1}$: normalization factor (kendall tau-b version)</li>
    </ul>
  </li>
</ul>

<h2 id="3-편상관계수">(3) 편상관계수</h2>
<h3 id="의사-상관pseudo-correlation">의사 상관(Pseudo Correlation)</h3>
<ul>
  <li>실제적인 연관관계가 없음에도 불구하고 상관계수가 크게 나타나는 경우</li>
  <li>제 3의 변수에 의하여 상관관계가 나타나는 경우</li>
</ul>

<h3 id="편상관계수-partial-correlation-coefficient">편상관계수 (Partial correlation coefficient)</h3>
<p>두 변수간의 관련성에 영향을 미치는 다른 변수를 통제하고 순수한 두 변수간의 상관관계</p>
<ul>
  <li>두 변수에 영향을 미치는 제 3의 변수를 통제한다.</li>
  <li>
    <table>
      <tbody>
        <tr>
          <td>$\rho_{xy</td>
          <td>z}=\frac{r_{xy}-r_{xz}r_{yz}}{\sqrt{(1-r^2<em>{xz})}\sqrt{1-r^2</em>{yz}}}$</td>
        </tr>
      </tbody>
    </table>
    <ul>
      <li>분자에서 $r_{xy}-r_{xz}r_{yz}$는 우리가 관심있는 상관계수에서 관심없는 상관계수를 뺀다.</li>
      <li>
        <table>
          <tbody>
            <tr>
              <td>nothing to partial out일때 어떤지! $z$가 아무런 상관관계가 없을때…즉, $r_{xy}=0,r_{yz}=0$이 될때.. 식을 자세히 보면 결국 $\rho_{xy</td>
              <td>z}=r_{xy}$가 된다.</td>
            </tr>
          </tbody>
        </table>
      </li>
    </ul>
  </li>
</ul>

<h2 id="4-측정도구의-신뢰도분석">(4) 측정도구의 신뢰도분석</h2>
<ul>
  <li>크론바흐의 알파계수</li>
</ul>

<h2 id="5-fisher-z-transformation-for-correlations">(5) Fisher-Z transformation for correlations</h2>
<p>correlation coefficient는 -1과 1사이의 값만 가지는데, 분석방법에 따라 transformation이 필요할 수 있다. 그 때 필요한게 Fisher-Z transformation이다.</p>

\[z_r=\frac{1}{2}\ln(\frac{1+r}{1-r})=\textrm{arctanh}(r)\]

<p>단순히 두 변수 사이의 관계를 선형적 상관성를 보기 위하여 correction를 계산했으면 fisher Z transformation을 고려할 필요 없다.
The fisher Z-Transform은 주로 수 많은 변수별 여러 상관계수를 계산한 다음 이 상관계수값들을 가지고 가우시안 분포를 가정하는 t-test나 ANOVA 분석을 할때 중요하다.</p>

<h2 id="6-cosine-similarity과-상관계수의-관계">(6) Cosine similarity과 상관계수의 관계</h2>

<p>correlation coefficient에서 $\bar{x}=\bar{y}=0$이면 cosine similarity가 된다. 즉, mean-centered되면(=zero mean) 된다.
추가로 linear algebra관점에서 보면 cosine similarity는 dot product를 각각의 norm으로 나눈거다.</p>

<h1 id="8-비모수적-검정">8. 비모수적 검정</h1>

<h2 id="1-정규성에-대한-검토">(1) 정규성에 대한 검토</h2>
<p>non-parametric의 특징은 parametric method에서의 정규성 가정을 하지 않는다.</p>

<h2 id="2-단일-모집단에-대한-검정">(2) 단일 모집단에 대한 검정</h2>
<ul>
  <li>One sample -&gt; Wilcoxon signed-rank test</li>
  <li>Two dependent (paried) samples -&gt; Signed-rank test</li>
</ul>

<h2 id="3-두-모집단에-대한-검정">(3) 두 모집단에 대한 검정</h2>
<ul>
  <li>Two independent samples -&gt; Mann-Whitney U test (a.k.a. Mann-Whitney-Wilcoxon U test, Wilcoxon rank-sum test)</li>
</ul>

<h2 id="4-독립-k-표본에-대한-검정">(4) 독립 k-표본에 대한 검정</h2>
<ul>
  <li>one-way ANOVA 의 대안: Kruskal-Wallis test (KW-ANOVA)
ANOVA자체가 정규성가정에 대해서 일반적으로 robust하기 때문에 Nonparametric ANOVAs는 거의 사용되지 않는다. 더 복잡해질 뿐이다.</li>
</ul>

<h2 id="5-permutation-testing">(5) Permutation testing</h2>
<p><img src="https://drive.google.com/uc?export=view&amp;id=1ZUGQ5aImpsaISQjmHz_p4nmpdjd3zK0F" alt="image" /></p>

<h3 id="permutation-test에서-p-value-구하는-방법">permutation test에서 p-value 구하는 방법</h3>
<p>$obs$: observed statistic이다.</p>
<h4 id="1-z-value-approach">(1) Z-value approach</h4>
<p>\(Z=\frac{obs-E[H_O]}{std[H_O]}\)
여기서는 $H_O$의 분포가 가우시안을 근사적으로 따른다는 가정을 해야한다. 왜냐하면 이 분포의 평균과 표준편차가 valid descriptor가 되어야하기 때문이다.</p>

<h4 id="2-p-avlue-based-on-counts">(2) P-avlue based on counts</h4>
<p>\(p_c = \frac{\sum(H_O&gt;obs)}{N_{N_O}}\)</p>]]></content><author><name>Dong Hee</name></author><category term="landscape" /><category term="math" /><category term="statistics" /><summary type="html"><![CDATA[분산분석(ANOVA) / 질적변수들의 연관성 / 상관분석 / 비모수적 검정]]></summary></entry><entry><title type="html">Statistics 101: part 1</title><link href="https://leedh.github.io/landscape/statistics101_1/" rel="alternate" type="text/html" title="Statistics 101: part 1" /><published>2020-03-01T00:00:00+09:00</published><updated>2020-03-01T00:00:00+09:00</updated><id>https://leedh.github.io/landscape/statistics101_1</id><content type="html" xml:base="https://leedh.github.io/landscape/statistics101_1/"><![CDATA[<h1 id="들어가며">들어가며</h1>
<h2 id="statistics-통계학">Statistics 통계학</h2>

<p>통계학은 관심 또는 연구대상이 되는 집단(모집단)의 특성을 파악하기 위해 모집단으로부터 일부의 자료(표본)를 수집, 정리, 요약, 분석하여 표본의 특성을 파악하고 이를 이용하여 모집단의 특성에 대해 추론하는 원리와 방법을 제공하는 학문이다.</p>

<ul>
  <li>목차는 <a href="http://www.aladin.co.kr/shop/wproduct.aspx?ItemId=103475034">&lt;예제로 배우는 R 데이터 분석 입문&gt;</a>를 참고했습니다.</li>
  <li>용어는 한국어와 영어를 병행 표기했습니다.</li>
</ul>

<h2 id="목차">목차</h2>
<ol>
  <li>데이터의 요약 및 표현</li>
  <li>확률변수와 분포함수</li>
  <li>통계적 추정과 검정</li>
  <li>평균차이 검정(t-test)</li>
  <li>분산분석(ANOVA)</li>
  <li>질적변수들의 연관성</li>
  <li>상관분석</li>
  <li>비모수적 검정</li>
</ol>

<h2 id="참고자료">참고자료</h2>
<ul>
  <li><a href="https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=171238">책 &lt;현대통계학&gt;</a></li>
  <li><a href="(http://www.aladin.co.kr/shop/wproduct.aspx?ItemId=103475034)">책 &lt;예제로 배우는 R 데이터 분석 입문&gt;</a></li>
  <li><a href="https://www.udemy.com/course/statsml_x/">강의 &lt;Master statistics&amp;machine learning: intuition, math, code&gt;</a></li>
  <li><a href="http://www.kocw.net/home/search/kemView.do?kemId=1056974">강의 &lt;확률 및 통계&gt; 이상화 교수</a></li>
  <li><a href="https://youtube.com/playlist?list=PLpIPLT0Pf7IqS4as3nefPyGv94r2aY6IT">강의 &lt;핵심 확률/통계&gt; 김성범 교수</a></li>
  <li><a href="https://statsthinking21.github.io/statsthinking21-core-site/">책 &lt;Statistical Thinking for the 21st Century&gt;</a></li>
</ul>

<h1 id="1-데이터의-요약-및-표현">1. 데이터의 요약 및 표현</h1>
<p>Statistics = state(국가) + ics (학문)</p>

<h2 id="1-자료의-형태">(1) 자료의 형태</h2>

<ul>
  <li>column: 변수(Variable), 속성(Attribute), 필드(Field)</li>
  <li>
    <p>row: 개체(Observation), 레코드(Record)</p>
  </li>
  <li>오류값(Error) : 변수가 가질 수 없는 값, 변수값의 불가능한 조합, 일관성 없는 코드값, 잘못된 코드값</li>
  <li><strong>특이값(Outlier)</strong> : 정상이 아닌 자료값, 특이값은 오류값일 수도 있고 그렇지 않을 수도 있다.
    <ul>
      <li>특이값을 다루는 방법 (dataset에 따라 알맞는 방법 사용)
        <ul>
          <li>전략1: 특이값 찾아서 없애기 (굉장히 신중히)</li>
          <li>전략2: 특이값 냅두고 robust한 분석방법 사용
            <ul>
              <li>non-parametric t-test</li>
              <li>spearman correlations</li>
              <li>permutation testing</li>
              <li>robust weighted regression and iteratively reweighted regression</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
  <li>결측값(Missing) : 알 수 없는 값. 원인과 기록방법을 정밀하게 조사하여 자료를 정정하고 기록방법을 변경해야 하며, 필요 시에는 자료를 보정해야 한다.</li>
</ul>

<table>
  <thead>
    <tr>
      <th>분류</th>
      <th>형태</th>
      <th>설명</th>
      <th>예</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>수치형(numbers)</td>
      <td>구간(등간)(Intrval)</td>
      <td>상대영점</td>
      <td>온도, 성적</td>
    </tr>
    <tr>
      <td>수치형(numbers)</td>
      <td>비율(Ratio)</td>
      <td>절대영점</td>
      <td>길이, 무게</td>
    </tr>
    <tr>
      <td>수치형(numbers)</td>
      <td>이산(Discrete)</td>
      <td>정수형태의 수</td>
      <td>인구</td>
    </tr>
    <tr>
      <td>범주형(labels)</td>
      <td>순서(Ordinal)</td>
      <td>sort 가능</td>
      <td>성적등급</td>
    </tr>
    <tr>
      <td>범주형(labels)</td>
      <td>명목(Nominal)</td>
      <td>sort 불가능</td>
      <td>혈액형, 직업, 지역</td>
    </tr>
  </tbody>
</table>

<h3 id="통계적-분석-방법">통계적 분석 방법</h3>

<table>
  <thead>
    <tr>
      <th>종속변수의 수</th>
      <th>분석기법</th>
      <th>독립변수</th>
      <th>종속변수</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1 개</td>
      <td>t-test (평균차이검정)</td>
      <td>명목</td>
      <td>이산, 연속</td>
    </tr>
    <tr>
      <td>1 개</td>
      <td>ANOVA (분산분석)</td>
      <td>명목</td>
      <td>이산, 연속</td>
    </tr>
    <tr>
      <td>1 개</td>
      <td>회귀분석</td>
      <td>명목, 이산, 연속</td>
      <td>이산, 연속</td>
    </tr>
    <tr>
      <td>1 개</td>
      <td>로지스틱 회귀분석</td>
      <td>명목, 이산, 연속</td>
      <td>명목, 순서</td>
    </tr>
    <tr>
      <td>1 개</td>
      <td>판별분석</td>
      <td>명목, 이산, 연속</td>
      <td>명목, 순서</td>
    </tr>
    <tr>
      <td>1 개</td>
      <td>공분산분석 (ANCOVA)</td>
      <td>명목, 이산, 연속</td>
      <td>이산, 연속</td>
    </tr>
    <tr>
      <td>1 개</td>
      <td>반복측정분산분석</td>
      <td>명목, 이산, 연속</td>
      <td>이산, 연속</td>
    </tr>
    <tr>
      <td>2 개 이상</td>
      <td>MANOVA</td>
      <td>명목</td>
      <td>이산, 연속</td>
    </tr>
  </tbody>
</table>

<table>
  <thead>
    <tr>
      <th>분석기법</th>
      <th>자료 (척도)</th>
      <th>대안적 분석기법</th>
      <th>자료(척도)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>독립성검정</td>
      <td>명목</td>
      <td>Kolmogorov-Smirnov 검정 (단일, 독립 두 표본)</td>
      <td>이산, 연속</td>
    </tr>
    <tr>
      <td>상관관계분석</td>
      <td>명목, 순서, 이산, 연속</td>
      <td>Mann-Whitney 검정</td>
      <td>순서, 이산, 연속</td>
    </tr>
    <tr>
      <td>요인분석</td>
      <td>이산, 연속</td>
      <td>Kruskal-Wallis 검정</td>
      <td>순서, 이산, 연속</td>
    </tr>
    <tr>
      <td>군집분석</td>
      <td>명목, 순서, 이산, 연속</td>
      <td>Wilcoxon 검정</td>
      <td>순서, 이산, 연속</td>
    </tr>
    <tr>
      <td>다차원척도법(MDS)</td>
      <td>순서, 구간</td>
      <td>Friedman 검정</td>
      <td>순서, 이산, 연속</td>
    </tr>
    <tr>
      <td>신뢰성분석</td>
      <td>이산, 연속</td>
      <td>Kendall 검정</td>
      <td>순서, 이산, 연속</td>
    </tr>
    <tr>
      <td>비율(차이)검정</td>
      <td>명목</td>
      <td>RUN 검정</td>
      <td>순서, 이산, 연속</td>
    </tr>
    <tr>
      <td>적합도 검정</td>
      <td>명목</td>
      <td>-</td>
      <td>-</td>
    </tr>
  </tbody>
</table>

<h2 id="2-모수와-통계량">(2) 모수와 통계량</h2>

<ul>
  <li>기술통계학(Descriptive Statistics)</li>
  <li>추측통계학(Inferential Statistics)
    <ul>
      <li>모집단(Population) : 관심의 대상이 되는 전체집단</li>
      <li>모수(Parameter) : 모집단의 특성</li>
      <li>표본(Sample) : 모집단에서 추출된 일부</li>
      <li>통계량(Statistic; 추정량(Estimator), 추정치(Estimate)) : 표본으로부터 관측된 내용</li>
    </ul>
  </li>
</ul>

<h2 id="3-기술통계량">(3) 기술통계량</h2>
<h3 id="대표값-중심경향-measure-of-centrality">대표값 (중심경향, Measure of Centrality)</h3>
<ul>
  <li>평균(Mean; 일반적으로 산술평균)</li>
  <li>중앙값(Median; 중위수)</li>
  <li>최빈값(Mode)</li>
</ul>

<h3 id="산포도-measure-of-dispersion">산포도 (Measure of Dispersion)</h3>
<ul>
  <li>편차(Deviation)</li>
  <li>분산(Variance) : 편차(평균고의 차이)의 제곱합을 자유도 n-1로 나눈 것</li>
  <li>표준편차(Standard Deviation) : 분산에 제곱근을 취한 것</li>
  <li>
    <p>변동계수(CV; Coefficient of Variation; 변이계수)</p>
  </li>
  <li>표준화(Standardization) = Z-transformation
    <ul>
      <li>$Z=\frac{x-\bar{x}}{s}=\frac{\textrm{centering}}{\textrm{scaling}}$
        <ul>
          <li>중심화(centering): 평균이 0이 되도록 함. 중심으로부터의 편차에 관심을 가짐</li>
          <li>척도화(scaling): 표준편차가 1이 되도로 함. 측정단위 자체를 없앰.</li>
        </ul>
      </li>
      <li>관측치의 상대적 위치의 척도로 사용됨</li>
      <li>관측치간 상대적인 크기를 비교할 수 있음</li>
      <li>단위가 없는 순수한 수치</li>
      <li>관측치 전체 데이터 내에서의 위치를 나타내는 데 효율적으로 사용됨</li>
    </ul>
  </li>
  <li>0-1 정규화 (normalization)</li>
</ul>

<h3 id="분위수-quantile">분위수 (Quantile)</h3>
<ul>
  <li>백분위수(Percentile)</li>
  <li>십분위수(Decile)</li>
  <li>사분위수(Quartile)</li>
  <li>Box Plot</li>
</ul>

<h3 id="범위-range와-사분위범위-inter-quantile-range">범위 (Range)와 사분위범위 (Inter Quantile Range)</h3>
<ul>
  <li>범위 : 최대값 - 최소값</li>
  <li>사분위범위 : 3사분위수 - 1사분위수</li>
</ul>

<h3 id="왜도-skewness-와-첨도-kurtosis">왜도 (Skewness) 와 첨도 (Kurtosis)</h3>
<ul>
  <li>왜도: 비대칭(asymmetry) 정도. 꼬리쪽 기준
    <ul>
      <li>음수: left or negative skew</li>
      <li>0: 치우침 없음 (ex.정규분포)</li>
      <li>양수: right or positive skew</li>
    </ul>
  </li>
  <li>첨도: 뾰족한(peakedness) 정도
    <ul>
      <li>음수: flat</li>
      <li>0: 정규분포</li>
      <li>양수: steep</li>
    </ul>
  </li>
</ul>

<h2 id="4-그래프를-이용한-양적-데이터의-요약">(4) 그래프를 이용한 양적 데이터의 요약</h2>
<ul>
  <li>히스토그램(Histogram)</li>
  <li>줄기-잎 그림(Stem-and-Leaf plot)</li>
  <li>상자그림(Box Plot)</li>
  <li>다중상자그림(Multiple Box Plot)</li>
</ul>

<h2 id="5-질적-데이터의-요약">(5) 질적 데이터의 요약</h2>
<ul>
  <li>빈도표(Frequency Table)</li>
</ul>

<h2 id="6-그래프를-이용한-질적-데이터의-요약">(6) 그래프를 이용한 질적 데이터의 요약</h2>
<ul>
  <li>막대도표(Bar Chart)</li>
  <li>원도표(Pie Chart)</li>
  <li>파레토 도표(Pareto Chart)</li>
  <li>모자이크 도표(Mosaic Chart)</li>
</ul>

<h1 id="2-확률변수와-분포함수">2. 확률변수와 분포함수</h1>
<p>통계적 조사에서 조사대상의 일부만을 관측하고도 조사대상 전체에 대한 결론을 이끌어 내는 데에 논리적 근거가 되는 것은 확률의 개념이다. 통계학에서 확률론(Probability Theory)이 여기서 활용된다.</p>

<h2 id="1-표본공간과-사건">(1) 표본공간과 사건</h2>
<ul>
  <li>표본공간(Sample Space): 통계적 실험이나 조사에서 가능한 모든 실험결과(outcome)의 집합
    <ul>
      <li>보통 S로 표현</li>
    </ul>
  </li>
  <li>사건 or 사상 (event): 표본공간 S의 임의의 부분집합
    <ul>
      <li>보통 A, B, C 등의 대문자로 표현</li>
      <li>근원사건(elementary event) = 단순사건(simple event): 한 개의 원소로 이루어진 사건
        <ul>
          <li>사건 A의 한 원소를 관측하면 사건 A가 일어났다고 한다.</li>
        </ul>
      </li>
      <li>합사건(union event), 곱사건(product event), 여사건(complementary  event), 배반사건(disjoint events)</li>
    </ul>
  </li>
</ul>

<h2 id="2-확률">(2) 확률</h2>
<h3 id="확률의-정의">확률의 정의</h3>
<ul>
  <li>고전적 정의: P.Laplace(1749~1827)가 정의
    <ul>
      <li>예를 들어 “4개에서 2개를 뽑는다”라는 표현에는 “뽑힐 가능성을 같게 하여”라는 뜻이 함축적으로 포함된 것으로 간주한다. 이러한 의미를 명확히 하기 위해 “랜덤하게 추출한다”라는 표현을 사용한다.</li>
      <li>표본공간에서 근원사건의 개수가 유한개이며, 각 근원사건이 일어날 가능성이 같은 경우에 대하여 확률을 정의하였다. 그러나 실제 문제에서는 이와 같은 고전적 정의에 의한 확률만으로는 설명되지 않는 현상이 많다. 예를 들어, 특정한 치료법에 의해 질병이 치료될 확률을 구하는 경우에는 전체조사의 결과의 개수가 유한이 아니며, 각 근원사건이 일어날 가능성도 같지 않다. 따라서 좀 더 일반화된 확률의 정의를 필요로 한다.</li>
    </ul>
  </li>
  <li>공리적 정의: A.N.Kolmogorov가 정의
    <ul>
      <li>통계적 실험을 반복적으로 행하면, 한 사상이 발생하는 것은 일정한 법칙을 따른다는 것을 경험을 통하여 알 수 있다. 특히, 한 사건의 상대도수는 흔히 일정한 상수로 가까이 가는 것을 경험적으로 알 수 있다. 이러한 경우에 우리는 ‘통계적 규칙성이 있다’고 한다.</li>
      <li>상대도수의 극한적 개념으로 확률을 정의함으로써 상대도수가 가지는 기본적 성질을 확률이 갖도록 요구하는 것은 당연하다고 할 수 있다.</li>
      <li>이러한 확률의 정의는 고전적 정의를 특수한 경우로 포함한 일반적인 정의임을 알 수 있다. 즉, $N$개의 실현결과로 구성된 표본공간에서 각각의 실현결과가 같은 정도로 가능하다면, (b), (c)로부터 각각의 실현결과의 확률은 $1/N$이고, $m$개의 원소로 구성된 사건의 확률은 (c)로부터 $m/N$이 되어 고전적 정의에 의한 확률과 같아진다.</li>
    </ul>
  </li>
</ul>

<h3 id="확률에-관한-성질">확률에 관한 성질</h3>

<h3 id="조건부-확률">조건부 확률</h3>
<ul>
  <li>비복원추출(sampling without replacement), 복원추출(sampling with replacement), 분할(partition)</li>
  <li>전확률공식</li>
  <li>베이즈 정리
    <ul>
      <li>사전확률 (prior probability): 사건 $A_1$, …, $A_n$을 $n$가지의 ‘원인’이라고 한다면 사전확률은 ‘원인’의 가능성이라 할 수 있다.</li>
      <li>
        <table>
          <tbody>
            <tr>
              <td>사후확률 (posterior probability): $P(A_k</td>
              <td>B)$는 B가 관측된 후에 ‘원인’ $A_k$의 가능성이라 할 수 있다.</td>
            </tr>
          </tbody>
        </table>
      </li>
      <li>베이즈정리가 뜻하는 것은 관측 전의 원인에 대한 가능성과 관측 후의 원인의 가능성 사이의 관계라고 할 수 있다.</li>
    </ul>
  </li>
</ul>

<h3 id="독립사건independent-events-종속사건dependent-events">독립사건(independent events), 종속사건(dependent events)</h3>

<h2 id="3-확률변수와-확률분포">(3) 확률변수와 확률분포</h2>
<ul>
  <li><strong>확률변수(Random Variable)</strong> : 표본공간 S에서 정의된 실수값 함수</li>
  <li>확률분포(Probability Distribution) : 확률변수 X와 확률을 대응시켜 주는 관계
    <ul>
      <li>확률분포표</li>
      <li>확률분포도</li>
      <li>확률밀도함수</li>
    </ul>
  </li>
  <li>확률분포함수(Probability Distribution Function)</li>
  <li>이산확률변수(Discrete Random variable)</li>
  <li>확률질량함수(Probability Mass function)</li>
  <li>연속확률변수(Continuous Random variable)</li>
  <li><strong>확률밀도함수(Probability Density Function)</strong></li>
</ul>

<h2 id="4-기대값과-분산">(4) 기대값과 분산</h2>
<ul>
  <li>기대값(Expected value) : 확률변수 X에 대해 확률을 가중치로 하여 계산된 가중평균</li>
  <li>분산(Variance)</li>
  <li>기대값의 성질</li>
  <li>분산의 성질</li>
</ul>

<h2 id="5-이산형-확률분포">(5) 이산형 확률분포</h2>
<h3 id="초기하분포hyper-geometric-distribution">초기하분포(Hyper Geometric Distribution)</h3>
<ul>
  <li>유한모집단에서의 단순랜덤추출법 or 단순임의추출법 (simple random sampling): 크기가 N인 유한모집단에서 크기 n의 표본을 비복원으로 뽑는 법(조합)으로 구한 경우의 수가 모두 동일한 확률로 뽑힐 수 있도록 표본을 추출하는 방법</li>
  <li>크기 N인 유한모집단에서 M개가 특별한 속성 A를 갖고 있고, 나머지 N-M개는 속성 A를 갖고 있지 않다고 가정하자. 이러한 모집단에서 크기 n의 표본을 단순랜덤추출할 때, 추출된 표본에서 속성 A를 갖고 있는 것의 개수를 X의 확률분포를 초기하분포라 부른다.</li>
</ul>

<h3 id="베르누이분포bernoulli-distribution">베르누이분포(Bernoulli Distribution)</h3>
<ul>
  <li>베르누이 시행(Bernoulli trial): 어느 실험이 오직 두 가지 가능한 결과만을 가질 때의 시행</li>
  <li>베르누이 확률변수: 베르누이시행의 표본공간 {success, fail}에서 Y(success)=1, Y(fail)=0인 확률변수를 베르누이확률변수라 한다.</li>
</ul>

<h3 id="이항분포binomial-distribution">이항분포(Binomial Distribution)</h3>
<ul>
  <li>성공률이 p인 베르누이시행이 n번 독립적으로 반복시행되었을 때, 확률변수 X를 “성공횟수”라고 하자. 이 때 X의 확률분포를 시행횟수 n과 성공률 p를 갖는 이항분포라 한다.</li>
</ul>

<h3 id="포아송분포poisson-distribution">포아송분포(Poisson Distribution)</h3>
<ul>
  <li>포아송분포는 단위시간이나 단위공간에서 희귀하게 일어나는 사건(rare event)의 ‘횟수’ 등에 유용하게 사용될 수 있다.</li>
  <li>ex) 단위시간 내의 전화신청 횟수, 단위길이의 철선의 결함수, 어느 지역에서의 1일 교통사고 사망자수 등</li>
  <li>포아송분포는 이항분포의 근사분포로서 정의할 수도 있다.</li>
</ul>

<h2 id="6-연속형-확률분포">(6) 연속형 확률분포</h2>
<h3 id="정규분포normal-distribution">정규분포(Normal Distribution)</h3>
<ul>
  <li>다른 말로 ‘가우스분포(Gauss distribution)’</li>
</ul>

<h3 id="표준정규분포standard-normal-distribution">표준정규분포(Standard Normal Distribution)</h3>
<ul>
  <li>평균이 0이고 표준편차가 1인 정규분포</li>
</ul>

<h3 id="다른-분포">다른 분포</h3>
<ul>
  <li>지수분포</li>
  <li>와이블분포</li>
  <li>베타분포</li>
  <li>감마분포</li>
</ul>

<h2 id="7-표본분포">(7) 표본분포</h2>
<h3 id="확률표본">확률표본</h3>
<ul>
  <li>확률표본(random sample): 서로 독립이고 동일한 모집단 분포를 따르는 여러개의 확률변수들. 아직 관측전!
    <ul>
      <li>확률표본은 특정한 확률변수들의 집합</li>
      <li>확률변수임을 명확히 하기 위해 대문자 사용 ($X_1$, $X_2$, …)</li>
    </ul>
  </li>
  <li>표본(sample): 확률표본이 실제값으로 관측된게 표본이다. 이제 관측 후!
    <ul>
      <li>실현(realization) 혹은 <strong>표본화(sampling)</strong>: 표본공간의 표본이 현실 세계의 데이터로 선택되는 것을 라고 한다. 표본화는 문맥에 따라 다른 의미로도 사용되는데 많은 수의 데이터 집합에서 일부 데이터만 선택하는 과정도 표본화라고 한다.</li>
      <li>소문자를 사용한다. ($x_1$, $x_2$, …)</li>
    </ul>
  </li>
  <li>통계량(statistics): 관측 가능한 확률표본의 함수. 통계량은 모집단의 어떤 특성에 관심있는가에 따라 여러 가지를 생각할 수 있다.
    <ul>
      <li>통계량의 정의에 따라 통계량은 확률변수임을 알 수 있다.</li>
      <li>통계량은 확률변수이므로 그 분포를 갖게 된다.</li>
    </ul>
  </li>
</ul>

<h3 id="표본분포">표본분포</h3>
<ul>
  <li>표본분포 (sample distribution): 통계량이 확률분포를 갖게 될 때, 통계량의 확률분포를 표본분포라고 한다.</li>
</ul>

<h3 id="표본평균의-분포">표본평균의 분포</h3>
<ul>
  <li><strong>중심극한정리(Central Limit Theorem; CLT)</strong></li>
  <li>모분포의 분포모양과 무관하게 ‘표본평균’의 분포는 표본의 크기가 커질수록 정규분포를 따른다.
    <h3 id="이항분포의-정규근사">이항분포의 정규근사</h3>
  </li>
  <li>연속성 수정(Continuity Correction): 정규근사의 핵심. 이산형분포를 연속형 분포로 변환시 최소단위의 절반을 포함시켜주어야 한다.</li>
</ul>

<h3 id="정규모집단에서의-표본분포">정규모집단에서의 표본분포</h3>
<p>여러 가지 통계적 추론에서 다양하게 사용되는 정규모집단에서의 몇 가지 중요한 표본분포들이 있다.</p>

<h4 id="t-분포students-t-distribution">t-분포(Student’s t-Distribution):</h4>
<h4 id="카이제곱분포chi-square-distribution">카이제곱분포(Chi-square Distribution)</h4>
<h4 id="f-분포f-distribution">F-분포(F-Distribution)</h4>

<h3 id="monte-carlo-sampling">Monte Carlo sampling</h3>
<p><a href="https://ko.wikipedia.org/wiki/%EB%AA%AC%ED%85%8C%EC%B9%B4%EB%A5%BC%EB%A1%9C_%EB%B0%A9%EB%B2%95">Monte carlo(=Money Carlo) methods(simulation)</a>는 여러 종류의 sampling 기법들을 포괄적으로 표현하는 용어이다. 이를 응용한 방법 중 하나가 Markov Chain Monte Carlo (MCMC) sampling기법이다.
Monte Carlo sampling은 시행 횟수가 늘어남에 따라 통계적 확률은 수학적 확률에 한없이 가까워진다라는 사실을 활용한 것이다. 이를 통해 수학 공식을 적용하지 않고도 확률을 계산할 수 있다. 모집단에서 데이터를 무작위로 sampling해서 미지의 모수나 함수를 추정 혹은 근사하는 방법이다.</p>

<h1 id="3-통계적-추정과-검정">3. 통계적 추정과 검정</h1>
<h2 id="1-통계적-추정">(1) 통계적 추정</h2>
<p>통계처리의 중요한 목적 중 하나는 통계량을 근거로 해서 모집단의 특성을 파악하는 것이다. 즉, 표본평균, 표본분산, 표본비율과 같은 통계량을 통해 이에 대응되는 모평균, 모분산, 모비율과 같은 모수들에 대한 통계적 추론을 하는 것이다.</p>

<h3 id="모집단과-표본">모집단과 표본</h3>
<ul>
  <li>모집단(Population): 관심의 대상이 되는 전체집단</li>
  <li>모수(Parameter): 모집단의 특성을 나타내는 미지의 ‘상수’값. 확률분포를 표현하는 값.</li>
  <li>표본(Sample): 모집단에서 추출되서 실제 관측된 값들의 집합. 일반적으로 확률표본(무작위 추출)</li>
  <li>통계량(Statistic; 추정량(Estimator), 추정치(Estimate)) : 표본으로부터 관측된 내용
    <ul>
      <li>추정량(Estimator): 미지의 모수를 추정하기 위해 사용되는 통계량. 알파벳. ($\bar{X}$)</li>
      <li>추정치(Estimate): 추정량이 관측되어 얻어진 값. 실제 숫자값</li>
    </ul>
  </li>
</ul>

<h3 id="단순임의추출에서-주요-모수에-대한-불편추정량">단순임의추출에서 주요 모수에 대한 불편추정량</h3>
<p>하나의 모수에 대해 단 하나의 추정량만 존재하는 것은 아니다. 예를 들어 모평균에 대한 추정량으로 표본평균만 있는 것이 아니라 중앙값, 최빈값 등이 있다. 이러한 추정량 중 어떤 추정량이 모수에 대한 좋은 추정량인지 판단해야 한다. 이를 판단하는 기준으로 아래 4가지 기준이 있다. 덧붙여 분명한 사실은 표본에서 얻은 통계량 또는 추정량은 표본을 추출할 때마다 변하게 되므로 확률변수라는 것이다. 아래 4 가지 성격은 모수에 대한 추정량으로서 우리가 바라는 성격일 뿐 필수불가결한 성격은 아니다. 하지만 이러한 성격이 충족될수록 좋은 추정량이라고 판단할 수 있다.</p>
<ul>
  <li>불편성(Unbiasedness)</li>
  <li>일치성(Consistency)</li>
  <li>효율성(Efficiency): 최소분산</li>
  <li>충분성(Sufficiency)</li>
</ul>

<h3 id="점추정과-구간추정">점추정과 구간추정</h3>
<ul>
  <li>통계적 추정(Statistical Estimation)</li>
  <li>점추정(Point Estimation): 하나의 값으로 모수를 추정하는 것</li>
  <li>구간추정(Interval Estimation): 일정한 신뢰수준 하에서 모수가 포함되어 있으리라고 기대되는 적절한 구간을 설정하여 모수를 추정하는 것
    <ul>
      <li>신뢰구간(confidence interval)</li>
      <li>신뢰구간 = 추정값 +- 표본오차(신뢰계수 * 표준오차) = $\bar{x}\pm t(k)\frac{s}{\sqrt{n}}$
        <ul>
          <li>표본오차(standard error): 자료 전체가 아닌 일부의 표본을 뽑아 조사함에 따라 발생하는 오차로서 표본조사의 정확성을 나타내는 척도이다.
            <ul>
              <li>표본오차는 추출방법에 따라 여러 가지 형식으로 나타날 수 있지만 보통 표본의 크기에 반비례한다. 따라서 표본의 크기가 증가하면 표본오차가 작아져 좀 더 정확한 추정값을 구할 수 있다. 다만, 비표본오차가 존재하므로 표본의 크기가 크다고 반드시 좋은 것만은 아니다. 표본오차는 신뢰계수가 있어야 계산 가능하고 단위에 따라 판단이 어려운 측면이 있어 상대표준오차를 병행 사용한다.</li>
            </ul>
          </li>
          <li>비표본오차: 보통 면접방법이나 질문지 구성방식의 오류, 조사원의 자질, 조사표의 작성 또는 집계, 분석단계 등 조사의 전체 과정에서 발생할 수 있는 오차.</li>
          <li>표준오차(standard error) $\frac{s}{\sqrt{n}}$: 흩어짐의 정도를 나타내는 측도로서, 흔히 추정량의 표준편차를 사용하는데 이를 추정량의 표준오차라고 한다.</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>오차한계(Margin of Error): 모집단의 참값과 표본에서 산출되는 통계량과의 차에 관한 일정한 경계값. 즉 모수 추정치의 표본오차</li>
  <li>신뢰수준(Confidence level): 가능한 모든 표본들 중에서 그 한계를 만족시키는 표본들의 비율. 100$\times$(1 - 유의수준)%
    <ul>
      <li>신뢰수준 95%의 의미는 100번 중 95번은 신뢰구간이 모수를 포함하고 있다는 것이고 이는 95번은 올바른 구간추정이 된다는 의미이다. 다시 말해 구간추정은 실제로 한번 추출된 크기 n의 표본만 가지고 추정하므로 구해진 구간은 모수를 포함하고 있거나 또는 포함하고 있지 않거나 둘 중 하나이다.</li>
    </ul>
  </li>
  <li>오차한계와 신뢰수준의 관계
    <ul>
      <li>신뢰수준을 크게하면 오차한계는 커진다.</li>
      <li>동일한 신뢰수준에서 오차한계를 줄이는 방법: 포본크기를 크게 하거나, 보다 정밀한 방법을 사용한다.</li>
    </ul>
  </li>
</ul>

<h3 id="모평균에-대한-추정">모평균에 대한 추정</h3>

<h3 id="모비율에-대한-추정">모비율에 대한 추정</h3>

<h3 id="모분산과-모표준편차에-대한-추정">모분산과 모표준편차에 대한 추정</h3>

<h3 id="표본크기의-결정">표본크기의 결정</h3>

<h2 id="2-통계적-가설검정">(2) 통계적 가설검정</h2>
<p>표본으로부터 주어지는 정보를 이용하여, 모수에 대한 예상, 주장 또는 단순한 추측 등의 옳고 그름을 판정하는 과정을 통계적 가설검정(statistical hypothesis thesting) 또는 간단히 검정(testing)이라 한다. 추정한걸 검정해야지 비로소 추론이 완성된다.</p>

<h3 id="가설hypothesis">가설(hypothesis)</h3>
<ul>
  <li>정의: a falsifiable claim that requires verification, typically from experimental or observational data, and that allows for predictions about future observations.</li>
  <li>가설이 중요한 이유
    <ul>
      <li>Hypotheses improve experiment design, critical thinking, and data analyses.</li>
      <li>Hypotheses transform loose ideas into concrete and specific claims.</li>
      <li>Hypotheses are used to develop new and more accurate theories, and to dissolve bad theories.</li>
      <li>Most progress in science, engineering, and medicine is the result of hypothesis-testing</li>
    </ul>
  </li>
  <li>strong hypothesis를 만드는 특징들
    <ul>
      <li>clear</li>
      <li>specific</li>
      <li>falsifiable</li>
      <li>based on prior data or theory</li>
      <li>leads to a statistical test</li>
      <li>a statement, not a question</li>
      <li>a prediction about the direction of an effect</li>
      <li>relevant for unobserved data or phenomena</li>
      <li>relevant for understanding nature</li>
    </ul>
  </li>
</ul>

<h3 id="귀무가설과-대립가설">귀무가설과 대립가설</h3>
<ul>
  <li>귀무가설(null hypothesis): 데이터에서 나타나도 전혀 흥미롭지 않은 가설</li>
  <li>대립가설(alternative hypothesis): effect hypothesis라고 부르는게 좋다.
    <ul>
      <li>대립가설의 형태에 따라 단측검정이냐 양측검정이냐가 결정</li>
    </ul>
  </li>
</ul>

<p>모든 추론 통계는 기본적으로 특정 유형의 데이터 및 가정 유형, 귀무 가설을 생성하는 다양한 방법, 분포 등에 채택되는 <em>signal to noise ratio</em>이다.</p>

<p><img src="https://drive.google.com/uc?export=view&amp;id=10Iv3qVZfjl_IjCT3pjy7G7mR7BJu8Dwb" alt="image" />
귀무가설 분포와 대립가설 분포의 차이를 이해하거나 정량화하려면 정규화된(normalized) 방법이 필요하다. 이 방법은 이러한 분포의 중심(centers) 차이를 정량화하는 것이다. (= the means of these two distributions)
이때 문제가 2가지 있다.</p>
<ol>
  <li>이 차이는 scale dependent하다. 길이의 경우 meter, centimeter, milimeter 등이 될 수 있다.</li>
  <li>이러한 분포의 너비(the width of these distributions)가 상당히 중요하다는 것이다.</li>
</ol>

<p>따라서 이러한 문제로 분포 너비의 일부 기능에 의해 조정(scaled)되거나 정규화(normalized)된 중심의 차이(difference of centers)가 필요하다.</p>

<h3 id="검정통계량과-기각역">검정통계량과 기각역</h3>
<ul>
  <li>검정통계량(test statistic) : 귀무가설과 대립가설 중 어느 하나를 채택하는 데 기준이 되는 통계량. ‘통계적으로 비교분석한다’라고 할 때 사용하는 값을 통칭. 통계적 가설의 진위여부를 검정하기 위해 ‘표본으로부터 계산’하는 통계량. 표본통계량을 2차 가공한 것 (표본통계량을 곱하고 더한 것)</li>
  <li>임계값(critical value): 귀무가설을 채택할 것인지 기각할 것인지를 판정하는 기준이 되는 값. 임계값은 유의 수준 $\alpha$, 표본크기 n, 그리고 검정통계량의 분포에 의해 결정된다.</li>
  <li>기각역(rejection region, critical region): 귀무가설을 기각하여 대립가설을 채택하는 검정통계량의 영역. 임계값이 결정되면 만들어지는 영역</li>
</ul>

<h3 id="제1종-오류와-제2종-오류">제1종 오류와 제2종 오류</h3>
<ul>
  <li>제 1종오류 : 귀무가설이 사실일 때 귀무가설을 기각하는 오류</li>
  <li>제 2종오류 : 대립가설이 사실일 때 귀무가설을 채택하는 오류</li>
  <li>유의수준($\alpha$, significance level) : 제1종 오류를 범할 확률의 최대허용한계. 즉, 유의수준이 $\alpha$인 검정법이란 제 1종오류를 범할 확률이 $\alpha$ 이하인 검정법을 뜻한다.</li>
  <li>검정력(power): 1-$\beta$</li>
</ul>

<p><img src="https://drive.google.com/uc?export=view&amp;id=1GQGg3bbYpugjQosCmcCWdZZd--kWVx0C" alt="image" /></p>

<h3 id="양측검정과-단측검정">양측검정과 단측검정</h3>
<ul>
  <li>양측검정(two-sided test)</li>
  <li>단측검정(one-sided test)</li>
</ul>

<h3 id="가설검정순서">가설검정순서</h3>
<ol>
  <li>귀무가설과 대립가설(연구가설) 설정</li>
  <li>유의수준과 임계값 결정</li>
  <li>귀무가설의 채탱영역과 기각영역 결정</li>
  <li>검정통계량의 계산</li>
  <li>검정통계량 값과 임계값의 비교를 통해 결론</li>
</ol>

<h3 id="구간추정과-가설검정-관계">구간추정과 가설검정 관계</h3>
<p>구간추정과 가설검정은 서로 보는 관점이 다를 뿐이지 별개의 것이 아니다.</p>
<ul>
  <li>구간추정은 내부(신뢰구간)에 관심. 모수가 있음직한 신뢰구간을 구하는 것</li>
  <li>가설검정은 외부(기각영역)에 관심. 귀무가설의 모수가 없음직한 기각역을 설정</li>
</ul>

<h3 id="유의확률-p-value">유의확률 (p-value)</h3>
<ul>
  <li>통계적 유의성 검정(statistical significance testing)은 처리효과가 우연에 의한 것인지 통계적으로 유의한 것인지를 결정하는 것</li>
  <li>significance probability</li>
</ul>

<p>모수적 검정에서 귀무가설의 분포($H_O$ distribution)는 공식(방정식)에 의해서 만들 수 있다. 하지만 대립가설의 분포는 우리가 알 수가 없다. 분포 대신 대립가설 통계량 값 하나($H_A$ value)로 검정한다.
<img src="https://drive.google.com/uc?export=view&amp;id=1L2u5YPYEnveSJNznYvhsbpIHCboES2Lq" alt="image" />
이때 관찰된 효과($H_A$ value)가 우연히 발생하였다고 말할 수 없을 정도로 충분히 클 때 그 효과는 통계적으로 유의하다고 말한다.
이때 중요한 점은 우리는 $H_A$가 참인지는 증명할 수 없다. 단지 우리가 할 수 있는건 효과가 없다고 가정했을 때 (=귀무가설이 참이라고 가정했을 때) $H_A$와 관련된 검정통계량이 관찰될 확률을 계산할뿐이다.</p>

<h3 id="모수적-검정과-비모수적-검정">모수적 검정과 비모수적 검정</h3>
<p>비모수적(non-parametric)이라는 말은 가우시안 분포처럼 어떤 특정 분포를 가정하지 않았다는 뜻이다. 추론할 때도 공식(equation)을 사용해서 귀무가설 분포를 만들지 않고 데이터를 통해서 만든다. 비모수적 검정에 대해서는 chapter 8에서 자세히 다룰 예정이다.</p>

<table>
  <thead>
    <tr>
      <th>모수적 검정 (parametric test)</th>
      <th>비모수적 검정 (nonparametric test)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>one-sample t-test</td>
      <td>Wilcoxon sign-rank test</td>
    </tr>
    <tr>
      <td>two-sample t-test</td>
      <td>Mann-Whitney U test</td>
    </tr>
    <tr>
      <td>Pearson correlation</td>
      <td>Spearman correlation</td>
    </tr>
    <tr>
      <td>ANOVA</td>
      <td>Kruskal-Wallis test</td>
    </tr>
    <tr>
      <td>-</td>
      <td>permutation testing</td>
    </tr>
  </tbody>
</table>

<p><img src="https://drive.google.com/uc?export=view&amp;id=198AbG6K9Tm0Dfss-3OjPbHE4T7NN718_" alt="image" /></p>

<h3 id="multiple-comparisons-and-bonferroni-correction">Multiple comparisons and Bonferroni correction</h3>

<h1 id="4-평균차이-검정t-test">4. 평균차이 검정(t-test)</h1>
<h2 id="1-평균차이-검정t-test-개념">(1) 평균차이 검정(t-test) 개념</h2>
<h3 id="t-test의-가정">t-test의 가정</h3>
<ol>
  <li>수치형 데이터 타입(일반적으로 interval이나 ratio)</li>
  <li>데이터는 서로 독립이다.</li>
  <li>데이터는 일반화할 수 있는 모집단으로부터 랜덤으로 뽑혔다.</li>
  <li>평균과 표준편차는 중심과 산포도를 나타낼 수 있는 valid descriptor이다 (즉, 정규분포를 따른다)</li>
</ol>

<h2 id="2-평균차이-검정-분류">(2) 평균차이 검정 분류</h2>
<h3 id="단일-모집단에-대한-검정집단-1개">단일 모집단에 대한 검정(집단 1개)</h3>
<p>다른 표현으로 <em>단일표본 평균차이 검정(one sample t-test)</em>이라고도 한다. 모집단의 평균이 기준이 되는 어떤 평균값과의 차이가 있는지 없는지 살펴보는 검정방법이다. 실질적인 통계분석 문제에서는 모분산도 모르고 소표본인 경우에 주로 행해진다. 이 경우 검정통계량의 분포가 t분포를 따르기 때문에 t-test라고 부른다. 이때 귀무가설은 ‘모집단의 평균과 기준이되는 어떤 평균값과의 차이가 없다’이다.</p>

<ul>
  <li>모평균에 대한 검정
    <ul>
      <li>모분산 $\sigma^2$이 알려져 있는 경우
        <ul>
          <li>검정통계량 : $Z=\frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}$</li>
        </ul>
      </li>
      <li>모분산 $\sigma^2$이 알려져 있지 않은 경우
        <ul>
          <li>검정통계량 : $T=\frac{\bar{x}-\mu_0}{s/\sqrt{n}}=\frac{(\bar{x}-\mu_0)\sqrt{n}}{s}$</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>모비율에 대한 검정
    <ul>
      <li>이항비율 검정(binomial proportion test)
        <ul>
          <li>검정통계량 : $\sum_{k=0}^{x}\binom{n}{k}p_0^k(1-p_0)^{n-k}$</li>
        </ul>
      </li>
      <li>정규근사 검정(표본의 크기가 충분히 큰 경우)
        <ul>
          <li>표본의 크기가 충분히 큰 경우 표본비율 $\hat{p}=x/n$은 평균이 $p$이고 분산이 $p(1-p)/n$인 정규분포를 따른다.</li>
          <li>검정통계량 : $Z=\frac{\hat{p}-p_0}{p_0\sqrt{(1-p_0)/n}}$</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>모분산에 대한 검정
    <ul>
      <li>카이제곱분포를 따른다.</li>
      <li>검정통계량 : $\chi^2=\frac{(n-1)S^2}{\sigma_0^2}$</li>
    </ul>
  </li>
</ul>

<h3 id="두-모집단에-대한-비교-집단-2개">두 모집단에 대한 비교 (집단 2개)</h3>
<p>two sample t-test는 두 데이터 집합이 같은 분포에서 추출된건지 여부를 검정한다.
검정통계량의 분자는 항상 $\bar{x_1}-\bar{x_2}$로 같은데 분모가 검정종류에 아래 3가지 기준에 따라서 나뉜다.</p>
<ul>
  <li>paired vs. unpaired
    <ul>
      <li>paired: paired samples t-test</li>
      <li>unpaired: independent two sample t-test</li>
    </ul>
  </li>
  <li>equal variance vs. unequal Variance (주관적으로 해석하기 나름. 등분산검정을 하기도 한다.)
    <ul>
      <li>equal variance: 같은 모집단에서 나왔을거라 가정하고 같은 분산을 가진다고 가정.</li>
      <li>unequal variance: 다른 그룹에서 나온거 같아서 다른 분산을 가진다고 가정.</li>
    </ul>
  </li>
  <li>equal sample size vs. unequal sample size</li>
</ul>

<h4 id="독립표본에-의한-두-모평균의-비교-독립표본-t-검정">독립표본에 의한 두 모평균의 비교: 독립표본 t-검정</h4>
<p><em>독립표본 평균차이 검정(independent two sample t-test)</em>은 독립적인 두 모집단의 평균이 같은지 틀린지를 살펴보는 검정방법이다. 두 확률표본이 두 모집단으로부터 각기 독립적으로 관측되었다는 것이다. 이때 모집단은 각각 정규분포를 가정한다. 이때 각 집단의 표본크기가 작은 경우 모집단의 정규성 검정을 하는 것이 좋다. 정규성 가정을 만족시키지 못한다고 생각되는 자료는 독립표본 t검정을 시행하기보다는 비모수적 검정방법인 맨-휘트니의 두 표본 검정방법을 사용하는 것이 좋다.</p>

<p>검정통계량의 형태는 두 모집단의 분산을 모르기는 하지만 1) 같다고 가정할 수 있는 경우와 2) 같다고 가정할 수 없는 경우에 따라 다르게 표현한다. 또한 두 모집단의 분산이 같은지 틀린지에 따라 검정통계량의 형태가 달라지기 때문에 두 모분산에 대한 동질성(homogeneity of variance)을 먼저 검정해야 한다. 즉, 등분산검정을 시행한다.</p>

<p>t-test에 앞서 (a) 집단별 기술통계량을 살펴보고 (b) 분산에 대한 검정, 그리고 (c) 분산에 대한 검정 결과에 따라 t-test를 시행한다.</p>

<ul>
  <li>
    <p>모분산 $\sigma_1^2$과 $\sigma_2^2$이 알려진 경우</p>
  </li>
  <li>
    <p>모분산 $\sigma_1^2$과 $\sigma_2^2$을 모르는 경우</p>
    <ul>
      <li>표본크기가 충분히 클 때</li>
      <li>$\sigma_1^2$ = $\sigma_2^2$ (= $\sigma^2$) : 두 모집단은 미지의 동일한 모분산을 갖는다는 조건</li>
      <li>$\sigma_1^2$ ≠ $\sigma_2^2$</li>
    </ul>
  </li>
</ul>

<h4 id="대응표본에-의한-두-모평균의-비교-대응표본-t-검정">대응표본에 의한 두 모평균의 비교: 대응표본 t-검정</h4>
<p>대응표본 t검정(paired samples t-test)는 실험 전후의 결과값 같이 연관성이 존재하는 두 표본에 대해서 실시하는 검정이다. 같은 그룹이 2번 응답한 경우 각각의 응답을 two-sample로 본다.</p>

<h4 id="독립표본에-의한-두-모비율의-비교">독립표본에 의한 두 모비율의 비교</h4>

<h4 id="쌍-관측에-의한-두-모비율의-비교---맥니머-검정">쌍 관측에 의한 두 모비율의 비교 - 맥니머 검정</h4>

<h4 id="모분산의-동일성에-대한-검정">모분산의 동일성에 대한 검정</h4>]]></content><author><name>Dong Hee</name></author><category term="landscape" /><category term="math" /><category term="statistics" /><summary type="html"><![CDATA[데이터의 요약 및 표현 / 확률변수와 분포함수 / 통계적 추정과 검정 / 평균차이 검정(t-test)]]></summary></entry></feed>