Sunum yükleniyor. Lütfen bekleyiniz

Sunum yükleniyor. Lütfen bekleyiniz

Bölüm 3: Doğrusal Gerileme (Regresyon)

Benzer bir sunumlar


... konulu sunumlar: "Bölüm 3: Doğrusal Gerileme (Regresyon)"— Sunum transkripti:

1 Bölüm 3: Doğrusal Gerileme (Regresyon)

2 1. Gerilemenin (Regresyonun) Anlamı

3 Gerilemenin Anlamı Bağımlı ve bağımsız değişkenler arasındaki ilişkileri incelemektedir. Örn:Bir malın miktarı ile fiyatı arasında nasıl bir ilişki vardır? Bağımlı değişkenin popülasyon ortalamasını, veri olan bağımsız değişkenlere dayanarak tahmin etmektedir. Örn: Kesin gelir düzeyi veri iken tüketim düzeyi ne olur?

4 Gerilemenin Anlamı Ayrıca hipotezleri test eder:
Örn:Tüketim ve gelir arasındaki kesin ilişki hakkında Gelir arttığında tüketimin ne kadar artacağını test eder.

5 2. Gerileme (Regresyon)Örneği

6 Gerileme Örneği Toplam popülasyonunu 60 ailenin oluşturduğu bir ülkeyi varsayalım. Gelir ve tüketim arasındaki ilişkiyi inceleyelim. Bazı aileler aynı miktarda gelire sahip olsun. Haftalık geliri ($100, $120, $140, vb.) olacak şekilde gruplara ayıralım.

7 Gerileme Örneği Her grup içerisindeki,aile tüketim alışkanlık sınırları veri olsun. 6 aile 100$’lık gelire sahip olsun.Bunların harcamaları ise 65$, 70$,74$, 80$, 85$, 88$ olsun. Geliri (X) ve harcamaları (Y) bulun. Sonra her kategorinin içerisinde,kesin X koşulu üzerinde,Y dağılımına sahip olalım.

8 Gerileme Örneği Her dağılım için koşullu ortalamayı hesaplayalım:
E(Y|(X=X i). E(Y|(X=X i)’i nasıl elde ettik ? Koşullu olasılık olan (1/6)’yı Y değeriyle çarptık ve toplamlarını aldık. Bu değer bizim örneğimiz için 77’dir. Bu koşullu dağılımları her gelir seviyesi için çizebiliriz.

9 Gerileme Örneği Popülasyon regresyonu; bağımlı değişkenin koşullu ortalamalarını, açıklayıcı değişkenlerin sabit değerleri için birleştiren doğrudur. Formal olarak: E(Y|Xi) Bu popülasyon regresyon fonksiyonu Y’ye göre ortalamanın X ile nasıl değiştiğini açıklamaktadır.

10 Gerileme Örneği Bu fonksiyon hangi formu alır?
Birçok olasılığa rağmen,onun doğrusal bir fonksiyon olduğunu kabul edelim: E(Y|Xi) = Xi 1 ve 2 regresyon katsayılarıdır. (kesişme ve eğim). Eğim ,X’teki veri bir değişme ile Y’nin ne kadar değişeceğini göstermektedir. Biz 1 ve 2’yi ,X ve Y’nin gerçek gözlemlerine dayanarak hesaplıyoruz.

11 3. Doğrusallık

12 Doğrusallık Doğrusallık değişkenlerde veya parametrelerde olabilir.
Değişkenlerdeki doğrusallık Y’nin koşullu beklentisi X –’in doğrusal bir fonksiyonudur. Regresyon düz doğrudur. Eğim sabittir. Değişken eğimli kare,karekök veya interaktif terimlilerle fonksiyon oluşturamaz.

13 Doğrusallık Biz parametrelerdeki doğrusallıkla ilgilenmekteyiz.
Parametreler sadece birinci kuvvete kadar çıkabilirler. Değişkenler doğrusal olabilir yada olmayabilir.

14 Doğrusallık Parametrelerdeki doğrusallık
Y’deki koşullu beklentiler parametrelerin doğrusal fonksiyonudur. Xs doğrusal olabilir yada olmayabilir. E(Y|Xi) = 1 + 2Xi doğrusaldır. E(Y|Xi) = 1 + 2Xi doğrusal değildir. ’lar birin kuvveti olarak görünüyorsa ve diğer parametreler de çarpılmıyor yada bölünmüyorsa doğrusaldır.

15 4. Stokastik Hata

16 Stokastik Hata Tek tek değerler ,koşullu ortalamadan yukarıda yada aşağıda bir değer alabilir. Belirtirsek; ui = Yi - E(Y|Xi),burada ui tek değerin koşullu ortalamadan sapmasını göstermektedir. Yer değiştirince: Yi = E(Y|Xi) + ui ui stokastik hata terimidir. Bu bir tesadüfi bozulmadır. Bu olmadan model deterministik olacaktır.

17 Stokastik Hata Örneği Aile tüketiminin gelirle doğrusal ilişkisi olduğunu ,artı bozulma terimi olduğunu kabul edelim.Bazı örnekler: 65$’lık harcamaya sahip olan aile bu şekilde gösterilebilir: Yi = 65 = (100) + ui 75$’lık harcamaya sahip olan aile : Yi = 75 = (100) + ui

18 Stokastik Hata Örneği Modelin deterministik ve stokastik bölümleri vardır. Sistematik bölümü fiyat,eğitim vb. ile gösterilir. Bir ekonometrik model tüketim ve gelir arasındaki ilişkiyi ifade etmektedir. İlişki kesin değildir,tek tek varyasyona konu olmakta ve bu varyasyon u’ya yakalanmaktadır.

19 U’nun Beklenen Değeri Yi = E(Y|Xi) + ui
Koşullu beklentileri ele alalım. E(Yi|Xi) = E[(EY|Xi)] + E(ui|Xi) E(Yi|Xi) = E(Y |Xi) + E(ui|Xi ) Bir sabitin beklenen değeri sabittir ve bir kere Xi sabitlenirse, E(Y|Xi) de sabit olur. So E(ui|Xi) = 0 Koşullu ortalama değerleri ui =0

20 Hata Terimi Ne Yakalar? İhmal edilen değişkenler
Tüketimi etkileyebilecek diğer değişkenler modele dahil edilmemiştir. Eğer doğru olarak belirlenecekse modelimiz bunları da içermelidir. Ekonomik ilişkisini bilmiyorsak değişkeni ihmal edebiliriz. Datamız olmayabilir. Kötü hava,grev gibi tesadüfi olaylar düzensizce meydana gelir.

21 Hata Terimi Ne Yakalar? Bağımlı değişkendeki ölçüm hatasını
Tüketimde Friedman modeli Devamlı tüketim devamlı gelirin bir fonksiyonudur. Bu datalar gözlemlenebilir değildir, cari tüketim ve gelir gibi vekiller kullanmak zorundadır. Sonra hata terimi bu ölçüm hatasını temsil eder ve onu yakalar.

22 Hata Terimi Ne Yakalar? İnsan davranışlarının tesadüfiliği
İnsanlar aynı durumlarda bile tamamen aynı şekilde hareket etmezler. Yani hata terimi bu tesadüfiliği yakalamaktadır.

23 5. Örnek Regresyon Fonksiyonu

24 Örnek Regresyon Fonksiyonu
If have whole population, we can determine a regression line by taking conditional means In practice, usually have a sample. Suppose took a sample of population Can’t accurately estimate the population regression line since we have sampling fluctuations.

25 Sample Regression Function
Our sample regression line can be denoted:

26 Sample Regression Function
In stochastic form: We can have several independent variables - this is multivariate regression e.g. consumption may depend on interest rate as well as income.

27 6. Ordinary Least Squares

28 OLS Regression Estimate the PR by the method of ordinary least squares. We have a PRF: Yi = Xi +ui The PRF is not directly observable, so we estimate it from the SRF: Yi = b1 + b2Xi +ei We can rewrite as ei = actual Yi - predicted Yi ei = Yi - b1 - b2Xi

29 OLS Regression We determine the SRF is such a manner that it is a good fit. We make the sum of squared residuals as small as possible. By squaring, we give more weight to larger residuals.

30 OLS Regression Residuals are a function of the betas
Choosing different values for beta gives different values for squared residuals. We choose the beta values that minimize this sum. These are the least-squares estimators.

31 Normal Equations The least squares estimates are derived in the following manner:

32 Normal Equations

33 Normal Equations

34 8. Assumptions of Classical Linear Regression Model

35 Assumptions Using model Y = B1 + B2X + u
Y depends on X and u X values are fixed and u values are random. Thus Y values are random too. Assumptions about u are very important. Assumptions are made that ensure that OLS estimates are BLUE.

36 Linearity Assumption The regression model is linear in the parameters and the error term. Y = B1 + B2X + e. Not necessarily linear in the variables We can still apply OLS to models that are nonlinear in the variables.

37 Specification Assumption
Assume the regression model is correctly specified All variables included (no specification bias). Otherwise, specification error results.

38 Expected Value of Error
Expected value of the error term=0 E(ui) = 0 Its mean value is 0, conditional on the Xs. Add a stochastic error term to equations to explain individual variation. Assume the error term is from a distribution whose mean is zero

39 Expected Value of Error
In practice the mean is forced to be zero by intercept term, which incorporates any difference from zero Intercept represents the fixed portion of Y that cannot be explained by the independent variables. The error term is the random portion

40 No Correlation with Error
Explanatory variables are uncorrelated with the error term There is zero covariance between the disturbance ui and the explanatory variable Xi. Cov(Xi*ui) = 0 Alternatively, X and u have separate influences on Y

41 No Correlation with Error
Suppose the error term and X are positively correlated. Estimated coefficient would be higher than it should because the variation in Y caused by e is attributed to X

42 No Correlation with Error
Consumption function violates this assumption Increase in C leads to increase in income which leads to increase in C. So error term in consumption and income move together If we do not have this assumption - then simultaneous equation estimation

43 Constant Variance of Error
The variance of each ui is the same given a value of Xi. var(ui) = 2 a constant (Homoscedasticity) Ex: variance of consumption is the same at all levels of income Alternative: variance of the error term changes (Heteroscedasticity) Ex: variance of consumption increases as income increases

44 No Correlation Across Error Terms
No correlation between two error terms The covariance between the u's zero Cov (ui, uj) = 0 for i not equal to j

45 No Correlation Across Error Terms
Often shows up in time series - serial correlation Random shock in one period which affects the error term may persist and affect subsequent error terms. Ex: positive error in one period associated with positive error in another:

46 No Perfect Linear Function Among Variables
No explanatory variable is a perfect linear function of other explanatory variables Multicollinearity occurs when variables move together Ex: explain home purchases and include both real and nominal interest rates for a time period in which inflation was constant.

47 9. Properties of OLS Estimators

48 OLS Properties 1)linear (linear functions of Y): Y = b1 + b2X
2)Unbiased: E(b1) = B1and E(b2) = B2 In repeated sampling, the expected values of b1 and b2 will coincide with their true values B1 and B2.

49 OLS Properties 3) They have minimum variance
var b1 is less than the variance of any other unbiased linear estimator of B1 var b2 is less than the variance of any other unbiased linear estimator of B2

50 BLUE Estimator Given the assumptions of the CLRM, OLS estimators, in the class of unbiased linear estimators, have minimum variance They are BLUE.

51 10. Variances and Standard Errors of OLS Estimators

52 Variances and Standard Errors

53 Variances and Standard Errors

54 Variances and Standard Errors
2 is the variance of the error term, assumed constant for each u (homoscedasticity.) If know 2 one can compute all these terms. If don't know it use its estimator. The estimator of 2 is (ei)2/n-2

55 Degrees of Freedom n-2 is degrees of freedom for error
Sum of independent observation To get e, we have to compute predicted Y To compute predicted Y, we must first obtain b1 and b2, so we lose 2 df.

56 Standard Error of Estimate
This is called the standard error of the estimate (the standard deviation of the Y values about the regression line) It is used as a measure of goodness of fit of the estimated regression line.

57 Example Estimated regression line Y = 24.47 + 0.509 X se (6.41) (.036)

58 Example

59 Example The the estimated slope coefficient is and its standard error (standard deviation) is This is a measure of how much 2 varies from sample to sample. We can say our computed 2 lies within a certain number of standard deviations from the true 2.

60 11. Hypothesis Testing

61 Hypothesis Testing Set up the null hypothesis that our parameter values are not significantly different from zero H0:2 = 0 What does this mean?: Income has no effect on spending. So set up this null hypothesis and see if it can be rejected.

62 Hypothesis Testing In problem 5.3, 2= 1.25
This is different from zero, but this is just derived from one sample If we took another sample we might get and a third sample we might get 0 In other words, how do we know that this is significantly different from zero?

63 Hypothesis Testing 2 ~ N(2, (2)2)
Can test either by confidence interval approach, or by test of significance approach. 2 follows the normal distribution with mean and variance as above:

64 Hypothesis Testing However, we do not know the true variance 2
We can estimate 2 Then we have:

65 Hypothesis Testing However, we do not know the true variance 2
We can estimate 2 Then we have: More generally (2 - B2)/ se 2

66 Problem 5.3 Example /se()=1.25/0.039=31.793~t(n-2)
At 95% with 7 df, t=2.365 so reject the null. Also could do a one-tail test Set up the alternative hypothesis that 2>0 Also reject the null since t = for one-tailed test.

67 Problem 5.3 Example Most of the time, we assume a null that the parameter value = 0. There are occasions where we may want to set up a different null hypothesis. In Fisher example, we set up hypothesis that b2 = 1. So now /se = 0.25/.039 = 6.4 So it is significant.

68 Confidence Interval Approach
B2 = 0 and B2 = 1 do not lie in this interval

69 12. Coefficient of Determination--R2

70 Coefficient of Determination
The coefficient of determination, R2, measures the goodness of fit of the regression line overall variation in variation in Y Y from mean= explained by X+ unexplained value around its mean variation

71 Coefficient of Determination
Total variation in observed Y values about their mean is partitioned into 2 parts, one attributable to the regression line and the other to random forces.

72 Coefficient of Determination
If the sample fits the data well, ESS should be much larger than RSS. The coefficient of determination (R2)= ESS/TSS Measures the proportion or percentage of the total variation in Y explained by the regression model.

73 Correlation Coefficient
The correlation coefficient is the square root of R2 Correlation coefficient measures the strength of the relationship between two variables. However, in a multivariate context, R has little meaning.

74 13. Forecasting

75 Forecasting Suppose we want to predict out of sample and know relation between CPI and S&P (Problem 5.2) Have data to 1989 and want to predict 1990 stock prices. Expect inflation in 1990 to be 10% so CPI is = 136.4 Y = CPI Estimated Y for 1990 is = (136.4)

76 Forecasting There will be some error to this forecast - prediction error. This has quite a complicated formula. This error increases as we get further away from the sample mean. Hence, we cannot forecast very far out of sample with a great deal of certainty.


"Bölüm 3: Doğrusal Gerileme (Regresyon)" indir ppt

Benzer bir sunumlar


Google Reklamları