기본 콘텐츠로 건너뛰기

라벨이 Autocorrelation인 게시물 표시

[matplotlib]quiver()함수

[data analysis] 자기상관분석(Autocorrelation Analysis)

자기상관분석 관련된 내용 회귀모델의 오차에 대해 오차제곱평균(Mean of Square Error) 오차의 분산 상관성(correlation) 은 두 변수간의 관계를 나타내는 것에 반해 자기상관(autocorrelation) 은 한 변수내에 시간 차이에 따른 값들 사이의 관계를 파악하는 것입니다. 다시말하면 행렬의 형태로 표현되는 자료에서 자기상관성은 하나의 열 내에 존재하는 값들 사이의 관계를 나타냅니다. 반면에 상관성은 열(column)들 사이의 관계를 의미합니다. 자기상관의 정도는 식 1과 같이 자기상관 계수(R h )로 나타냅니다. \begin{align}R_h& =\frac{ \text{Autocovariance}}{\text{Variance}}\\ &=\frac{\sum^{N-h}_{t=1} (x_t-\bar{x})(x_{t+h}-\bar{x})}{\sum^N_{i=1}(x_t-\bar{x})^2}\\& n\,:\;\text{자료의 크기}\\& h\,:\;\text{시차(lag time)}\end{align} (식 1) 자기상관계수는 함수 pandas.Series.autocorr(lag=1) 에 의해 계산됩니다. 이 함수는 Series 객체 즉, 1개의 열 또는 행으로 이루어진 1차원의 벡터에서만 적용할수 있으며 지정된 lag의 차이로 두 그룹을 분리하여 pearson 상관계수를 계산하는 것입니다. 또는 statsmodels.tsa.stattools.acf() 함수를 적용하여 보다 상세한 정보를 확인할 수 있습니다. 예 1) kospi 지수의 일일 주가 자료중 시가(Open)을 설명변수로 하여 종가(Close)를 추정하는 회귀모델을 작성하고 오차에 대한 자기상관성을 조사합니다. Open Close 0 2874.50 2944.45 ...

Autocorrelation & Mean of Square Error

Contents Autocorrelation analysis Mean of Square Error Residual(Error) The generated regression model needs to be statistically tested, and the main object in the test is an error, the difference between the observations and estimates calculated by Equation 1. $$\begin{align}\tag{1}\text{e}&=y-(b_0+b_1x)\\&=y-\hat{y} \end{align}$$ Errors in the regression model have the following prerequisites: Probability variables that follow a normal distribution Because independent variables are probabilities that follow a normal distribution, the error between the response and the estimate is also a probability variable that follows a normal distribution. This means that the error cannot be artificially adjusted. Homoscedastic of error terms Various regression models are possible, as shown in Figure 1. This means that you can configure the probability distribution for the regression coefficients. This distribution has means and variances. The mean of this distrib...