Expt1 - Chapter 1. Introduction

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 1. Introduction /*========================================================== Example 1.1. Keyness Consumption Function */========================================================== ? ? Read data ? Read ; Nobs = 10 ; Nvar = 2 ; Names = C,X ; By Variables $ 672.1 696.8 737.1 767.9 762.8 779.4 823.1 864.3 903.2 927.6 751.6 779.2 810.3 864.7 857.5 874.9 906.8 942.9 988.8 1015.7 ? ? Plot the figure ? Plot ; Lhs = X ; Rhs = C ; Regression Line $ R eg re s s io n lin e is X = -6 7 .5 8 0 6 3 + .9 7 9 2 7 C X 7 0 0 7 5 0 8 0 0 8 5 0 9 0 0 9 5 0 6 5 0 7 5 0 8 0 0 8 5 0 9 0 0 9 5 0 1 0 0 0 1 0 5 0 7 0 0 C /*========================================================== Example 1.2. Income and Education - An Econometric Issue */========================================================== ? ? There are no computations in Example 1.2. ? Chapter 2. Matrix Algebra /*========================================================= Section 2.9.2. /*========================================================= ? ? The unconstrained solution requires computation ? of a - 2Ax = 0, or [x1 x2 x3]' = inv(2*A)a. ? Matrix ; MA = [2,1,3 / 1,3,2 / 3,2,5 ] ; a = [5 / 4 / 2 ] $ Matrix ; list ; x = .5 * <MA> * a $ Calc ; List ; fn = a'x - qfr(x,MA) $ /* Matrix X 1 +-------------- 1| .1125000D+02 2| .1750000D+01 3| -.7250000D+01 FN = .24375000000000010D+02 The constrained solution requires solution of [ -2A C' ] (x ) (-a) [ C 0 ] (lambda) = ( 0) C = [ 1 -1 1 ] [ 1 1 1 ] There are simpler ways to get this solution, but the following is complete and explicit. */ Matrix ; C = [1, -1, 1 / 1, 1, 1] $ Matrix ; MTWOA = -2 * MA ; Minusa = -1 * a $ Matrix ; Zero = [0 / 0] ; Zero22 = [0,0/0,0]$ Matrix ; CT = C' $ Matrix ; D = [MTWOA , CT / C , Zero22 ]$ Matrix ; q = [Minusa / zero ] $ Matrix ; XL = <D> * q $ /* Note that the solution for x(2) is not identically zero because of rounding. */ Matrix ; List ; x = XL(1:3) ; lambda=XL(4:5) $ Calc ; List ; fn = a'x - qfr(x,MA) $ /* Matrix X has 3 rows and 1 columns. 1 +-------------- 1| .1500000D+01 2| .5551115D-15 3| -.1500000D+01 Matrix LAMBDA has 2 rows and 1 columns. 1 +-------------- 1| -.5000000D+00 2| -.7500000D+01 FN = .22499999999999980D+01 2 Chapter 3. Probability and Distribution Theory /*========================================================= Example 3.1 Poisson Model for a Discrete Outcome. No computations needed. To illustrate the distribution, try Calc ; TBP( lambda) $ For example: Calc ; TBP(5) $ produces /*========================================================= Poisson distribution with lambda = 5.0000 [Probability of x occurrences, mean occurrences/pd = lambda.] Mean = 5.00000, Standard deviation = 2.23607 x P(X=x) P(X<=x) P(x) +---------------------------------------------------+ -- ------ ------- .200 | | 0 .00674 .00674 .192 + + 1 .03369 .04043 .184 | | 2 .08422 .12465 .176 | X X | 3 .14037 .26503 .168 | X X | 4 .17547 .44049 .160 | X X | 5 .17547 .61596 .152 | X X - | 6 .14622 .76218 .144 + x X X X + 7 .10444 ....
View Full Document

Page1 / 66

Expt1 - Chapter 1. Introduction

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online