<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>syou6162</author_name>
  <author_url>https://blog.hatena.ne.jp/syou6162/</author_url>
  <blog_title>yasuhisa's blog</blog_title>
  <blog_url>https://www.yasuhisay.info/</blog_url>
  <categories>
    <anon>統計学</anon>
    <anon>R</anon>
    <anon>計量時系列分析</anon>
  </categories>
  <description>正規乱数から相関のあるデータの生成計量時系列分析で正規乱数から相関のあるデータを生成してみようというやつがあったので、遊んでみる。平均0、分散1の正規分布に従う乱数(正規乱数)のベクトルを2つ用意。このままでは2つのベクトルは独立なので、無相関。 x&lt;-rnorm(1000) y&lt;-rnorm(1000) &gt; cor(x,y) [1] 0.02898553 そこで以下のように変数変換を施す。 このような変換を施すと、相関係数を持つようなデータを生成できたことになる。例えばとすると、理論値ではとなる。本当になるかを実験してみよう。 a&lt;-0.75 u=x+a*y v=a*x+y cor(u,v)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.yasuhisay.info%2Fentry%2F20070912%2F1189542400&quot; title=&quot;計量時系列分析で習ったことで遊んでみる - yasuhisa&amp;#39;s blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://chart.apis.google.com/chart?cht=tx&amp;chl=u%3Dx%2B%5Calpha%20y%2Cv%3D%5Calpha%20x%2By</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2007-09-12 05:26:40</published>
  <title>計量時系列分析で習ったことで遊んでみる</title>
  <type>rich</type>
  <url>https://www.yasuhisay.info/entry/20070912/1189542400</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
