Expt1 - Chapter 1 Introduction*= Example 1.1 Keynes's...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 1.  Introduction /*========================================================== Example 1.1. Keynes’s 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 $ Regression line is X = -67.58063 + .97927C X 700 750 800 850 900 950 650 750 800 850 900 950 1000 1050 700 C /*========================================================== Example 1.2. Income and Education - An Econometric Issue */========================================================== ? ? There are no computations in Example 1.2. ?
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 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 .86663 .136 | X X X X | 8 .06528 .93191 .128 | X X X X | 9 .03627 .96817 .120 | X X X X | 10 .01813 .98630 .112 | X X X X - | 11 .00824 .99455 .104 | X X X X X | 12 .00343 .99798 .096 + X X X X X + 13 .00132 .99930 .088 | x X X X X X | 14 .00047 .99977 .080 | X X X X X X | 15 .00016 .99993 .072 | X X X X X X - | 16 .00005 .99998 .064 | X X X X X X X | 17 .00001 .99999 .056 | X X X X X X X | 18 .00000 1.00000 .048 + X X X X X X X + 19 .00000 1.00000 .040 | - X X X X X X X x | 20 .00000 1.00000 .032 | X X X X X X X X X | 21 .00000 1.00000 .024 | X X X X X X X X X - | 22 .00000 1.00000 .016 | X X X X X X X X X X - | 23 .00000 1.00000 .008 |X X X X X X X X X X X X x - - - - - - - | 24 .00000 1.00000 .000 ++---+---+---+---+---+---+---+---+---+---+---+---+--+ 25+ .00000 1.00000 0 2 4 6 8 10 12 14 16 18 20 22 24 x */ /*================================================================== Example 3.2. Approximation to the Chi-Squared Distribution Computes exact and approximate values of chi-squared probabilities. */================================================================== Proc=apxchi(x,d)$ Calc;z=sqr(2*x)-sqr(2*d-1) ;list ;approx=Phi(z) ;exact=chi(x,d)$ Endproc Exec;proc=apxchi(85,70)$ /* APPROX = .89409039431135510D+00 EXACT = .89297135030469340D+00 */ 3
Image of page 3

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

View Full Document Right Arrow Icon
/*================================================================== Example 3.3. Linear Transformation of Normal Variable No computations. */================================================================== /*================================================================== Example 3.4. Linear Transformations Linear transformation of normally distributed variable. No computations. */================================================================== /*================================================================== Example 3.5. Regression in an Exponential Distribution Conditional distribution for an exponential model. No computations. */================================================================== /*================================================================== Example 3.6. Poisson Regression Poisson Regression. Linear conditional mean function. No computations. */================================================================== /*================================================================== Example 3.7. Conditional Variance in a Poisson Model Poisson Regression. Conditional variance function. No computations.
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern