User Tools

Site Tools


estimated_standard_deviation:rout01

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
estimated_standard_deviation:rout01 [2026/03/10 05:33] – created hkimscilestimated_standard_deviation:rout01 [2026/03/10 05:41] (current) hkimscil
Line 1: Line 1:
 <WRAP group> <WRAP group>
-<WRAP half column>+<WRAP column 60%>
 <code> <code>
 > rm(list=ls()) > rm(list=ls())
Line 27: Line 27:
 </code> </code>
 </WRAP> </WRAP>
-<WRAP half column>+<WRAP column 35%>
 SS = sum(x-mean(x))^2 인데, mean(x)을 즉, x집합의 평균을, x 원소값을 예측하는데 (빼는데) 사용하면 SS값이 최소값이 된다고 하였다. 이것을 R에서 simulation으로 알아보기 위해서 mean(x) 대신에 다른 숫자들을 넣어보려고 한다. 이를 v라고 하면 sum(x-v)^2이라는 SS값들을 구해서 비교하려는 것이다. 대입할 숫자들은 (v) mean(x) +- 3 sd(x) 를 범위로 하고, 그 범위의 시작 숫자에서 (시작은 mean(x)-3sd(x)가 된다) 0.1씩 증가시키면서 대입하고, 각 숫자마다 (처음 숫자는 35, 다음 숫자는 35.1 . . . ) SS값을 구해서 저장하여 그것을 그래프로 그려보고 최소값이 어떤 것인지 보는 것이 진행하려는 작업이다.  SS = sum(x-mean(x))^2 인데, mean(x)을 즉, x집합의 평균을, x 원소값을 예측하는데 (빼는데) 사용하면 SS값이 최소값이 된다고 하였다. 이것을 R에서 simulation으로 알아보기 위해서 mean(x) 대신에 다른 숫자들을 넣어보려고 한다. 이를 v라고 하면 sum(x-v)^2이라는 SS값들을 구해서 비교하려는 것이다. 대입할 숫자들은 (v) mean(x) +- 3 sd(x) 를 범위로 하고, 그 범위의 시작 숫자에서 (시작은 mean(x)-3sd(x)가 된다) 0.1씩 증가시키면서 대입하고, 각 숫자마다 (처음 숫자는 35, 다음 숫자는 35.1 . . . ) SS값을 구해서 저장하여 그것을 그래프로 그려보고 최소값이 어떤 것인지 보는 것이 진행하려는 작업이다. 
  
Line 36: Line 36:
  
 <WRAP group> <WRAP group>
-<WRAP half column>+<WRAP column 60%>
 <code> <code>
 > x.span <- seq(from = mean(x)-3*sd(x),  > x.span <- seq(from = mean(x)-3*sd(x), 
Line 78: Line 78:
 </code> </code>
 </WRAP> </WRAP>
-<WRAP half column>+<WRAP column 35%>
 x-mean(x) = residual = error  x-mean(x) = residual = error 
 sum(residual^2) = SS (sum of square) sum(residual^2) = SS (sum of square)
Line 90: Line 90:
  
 <WRAP group> <WRAP group>
-<WRAP half column>+<WRAP column 60%>
 <code> <code>
  
Line 114: Line 114:
 </code> </code>
 </WRAP> </WRAP>
-<WRAP half column>+<WRAP column 35%>
   * 이 후 쓸 function들. (x-v) = residual이라고 부르니까 이 residual을 모으는 function   * 이 후 쓸 function들. (x-v) = residual이라고 부르니까 이 residual을 모으는 function
   * function ssr = x 집합과 v값 (x.span의 한 숫자)를 인수를 주었을 때 구할 수 있는 Sum of Square값들 (실제로는 사용하지 않는다. 대신 msr 펑션으로 MS값을 구한다).   * function ssr = x 집합과 v값 (x.span의 한 숫자)를 인수를 주었을 때 구할 수 있는 Sum of Square값들 (실제로는 사용하지 않는다. 대신 msr 펑션으로 MS값을 구한다).
Line 122: Line 122:
  
 <WRAP group> <WRAP group>
-<WRAP half column>+<WRAP column 60%>
 <code> <code>
 > ssrs <- c() # sum of square residuals > ssrs <- c() # sum of square residuals
Line 147: Line 147:
 </code> </code>
 </WRAP> </WRAP>
-<WRAP half column>+ 
 +<WRAP column 35%>
 comment comment
   * x.span의 처음값인 35.1을 넣어서 (x-v)를 구한 후    * x.span의 처음값인 35.1을 넣어서 (x-v)를 구한 후 
Line 164: Line 165:
  
 <WRAP group> <WRAP group>
-<WRAP half column>+<WRAP column 60%>
 <code> <code>
 > # v값이 x.span에 따라서 변화하여 대입되었을 때의 > # v값이 x.span에 따라서 변화하여 대입되었을 때의
Line 234: Line 235:
 </code> </code>
 </WRAP> </WRAP>
-<WRAP half column>+<WRAP column 35%>
 comment comment
   * msrs값에 저장된 msr값들 (mean square residual값들) 중에서   * msrs값에 저장된 msr값들 (mean square residual값들) 중에서
Line 244: Line 245:
  
 <WRAP group> <WRAP group>
-<WRAP half column>+<WRAP column 60%>
 <code> <code>
 > # 아래는 위에서 계산한 msr 값들을 저장한 msrs값들 중에서 최소값이 되는 것을 찾은  > # 아래는 위에서 계산한 msr 값들을 저장한 msrs값들 중에서 최소값이 되는 것을 찾은 
Line 270: Line 271:
 </code> </code>
 </WRAP> </WRAP>
-<WRAP half column>+<WRAP column 35%>
 comment comment
   * msrs 의 min(msrs)값을 찾는다 24.975   * msrs 의 min(msrs)값을 찾는다 24.975
estimated_standard_deviation/rout01.1773120789.txt.gz · Last modified: by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki