File:Okuns law with confidence bands.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 299 × 197 pixels, file size: 95 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: Follow-up for the File:Okuns_law_quarterly_differences.svg file, additionally showing the confidence bands for the regression.
    Source Own work
    Author Stpasha
    Other versions Okuns_law_quarterly_differences.svg

    Source code (Mathematica)

    Refer to the File:Okuns_law_quarterly_differences.svg to see the data set used.

    n = Length[unempch];
    sol = FindFit[data, \[Alpha] + \[Beta] x, {\[Alpha], \[Beta]}, x]
    ts = Quantile[StudentTDistribution[n - 2], 0.975];
    \[Alpha]h = \[Alpha] /. sol;
    \[Beta]h = \[Beta] /. sol;
    xm = Mean[unempch];
    sx2 = Mean[(unempch - xm)^2];
    s\[Epsilon]2 = 1/(n - 2) Total[(gdpch - \[Alpha]h - \[Beta]h unempch)^2];
    s\[Beta] = Sqrt[1/n s\[Epsilon]2/sx2]; 
    s\[Alpha] = s\[Beta] Sqrt[sx2 + xm^2];
    sp = Sqrt[1/n s\[Epsilon]2 (1 + (x - xm)^2/sx2)];
    
    Show[
      ListPlot[{{{-10, 0}}, {{-10, 0}}, data}, PlotMarkers->{Automatic, Small}, PlotStyle->Hue[0.6]],
      Plot[ \[Alpha]h + \[Beta]h x, {x, -1.1, 1.8}, PlotStyle->{GrayLevel[0], Thick}],
      Plot[ {\[Alpha]h + \[Beta]h x - ts sp, \[Alpha]h + \[Beta]h x + ts sp}, {x, -1.1, 1.8}, 
        Filling -> {1 -> {2}}, PlotStyle -> {Blue, Blue}],
      PlotRange -> {{-1.3, 2}, {-3, 5}},
      Axes -> False,
      Frame -> True,
      FrameLabel -> {"Quarterly change in the unemployment rate (\[CapitalDelta]%)", 
                     "Quarterly change in GDP (\[CapitalDelta]%)"},
      FrameStyle -> Directive[FontFamily -> "Arial"]
    ]
    

    Licensing

    Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
    In some countries this may not be legally possible; if so:
    I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    97,070 byte

    image/svg+xml

    52846dea553a8b10f6ff91f5e0c69fa8096cb72d

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current15:33, 26 July 2009Thumbnail for version as of 15:33, 26 July 2009299 × 197 (95 KB)wikimediacommons>Stpasha{{Information |Description={{en|1=Follow-up for the File:Okuns_law_quarterly_differences.svg file, additionally showing the confidence bands for the regression.}} |Source=Own work |Author=Stpasha |Date= |Permission= |other_versions=O

    There are no pages that use this file.