기본 콘텐츠로 건너뛰기

라벨이 regression_model인 게시물 표시

통계관련 함수와 메서드 사전

A B C d E F G H I K L M N O P Q R S T U V W Z A statsmodels.ap.stats.anova_lm(x) statsmodels.formula.api.ols 에 의해 생성되는 모형 즉, 클래스 인스턴스(x)를 인수로 받아 anova를 실행합니다. np.argsort(x, axis=-1, kind=None) 객체 x를 정렬할 경우 각 값에 대응하는 인덱스를 반환합니다. Axis는 기준 축을 지정하기 위한 매개변수로서 정렬의 방향을 조정할 수 있음(-1은 기본값으로 마지막 축) pandas.Series.autocorr(lag=1) lag에 전달한 지연수에 따른 값들 사이의 자기상관을 계산 B scipy.stats.bernoulli(x, p) 베르누이분포에 관련된 통계량을 계산하기 위한 클래스를 생성합니다. x: 랜덤변수 p: 단일 시행에서의 확률 scipy.stats.binom(x, n, p) 이항분포에 관련된 통계량을 계산하기 위한 클래스를 생성합니다. x: 랜덤변수 n: 총 시행횟수 p: 단일 시행에서의 확률 C scipy.stats.chi2.pdf(x, df, loc=0, scale=1) 카이제곱분포의 확률밀도함수를 계산 $$f(x, k) =\frac{1}{2^{\frac{k}{2}−1}Γ(\frac{k}{2})}x^{k−1}\exp\left(−\frac{x^2}{2}\right)$$ x: 확률변수 df: 자유도 pd.concat(objs, axis=0, join=’outer’, …) 두 개이상의 객체를 결합한 새로운 객체를 반환. objs: Series, DataFrame 객체. Axis=0은 행단위 즉, 열 방향으로 결합, Axis=1은 열단위 즉, 행 방향으

회귀분석(Regression analysis): 단순회귀분석

내용 회귀분석(Regression analysis)이란? 단순회귀분석 단순회귀모델 회귀모델에 의한 추정 회귀계수의 추정 최소자승법에 의한 회귀계수 회귀분석(Regression analysis) 회귀분석(Regression analysis)이란? 회귀분석은 변수들간의 관계에 대한 모형을 설정하고 그 모형을 통해 새로운 값을 추정하는 통계적 방법입니다. 그림 1은 일정한 높이(x)에 대응되는 힘(y)에 대한 그래프로서 x가 증가할수록 y가 증가하는 정확한 정비례 관계를 보여줍니다. 이 관계는 일반화되어 있는 물리법칙에 의한 자료를 기반으로 한 것으로 중력이 작용하는 지구내에서 일정한 높이에서 가해지는 힘을 충분히 예측할 수 있습니다. import numpy as np import pandas as pd from scipy import stats import matplotlib.pyplot as plt plt.figure(dpi=100) h=range(7) w=40 F=[w*9.8*i for i in h] plt.plot(h, F, "o-") plt.xlabel("Height(m)", size=13, weight="bold") plt.ylabel("Force(N)", size=13, weight="bold") plt.text(2.5, 1500, 'F=Wgh', color="blue", size=13, weight="bold") plt.text(0, -800, r'w:weight (kg), g: Gravity Acceleration($m/sec^2$)', color="blue", size=12) plt.xticks([]) plt.yticks([]) plt.show() 그림 1. 높이에 따른 힘의 변화. 그림 2는 x가 증가하면서

Evaluation of regression coefficients, model & Estimation

Contents Evaluation of regression coefficients Evaluation of the model Regression Estimation Evaluation of regression coefficients T tests in regression analysis tests for the following null hypothesis (H0) for the regression coefficients of the generated model: H0: No significant difference by coefficient These results indicate that the test statistic, t, is outside the confidence interval and that the p-value is also close to zero, which is much lower than the significance level. Therefore, the results for the above dollor index indicate that the null hypothesis cannot be adopted. This discussion can be generalized as follows: The calculated regression coefficients also form a distribution as probability variables, so you can conduct a test. As mentioned above, the distribution has the same shape as the distribution of errors, so you can calculate the variance of the regression coefficient based on the variance of the error. As shown in Equation 1, the regression