You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
df.plot(x='gdppc', y='life_expectency', kind='scatter', xlabel="GDP per capita", ylabel="Life Expectency (Years)",);
456
+
df.plot(x='gdppc', y='life_expectancy', kind='scatter', xlabel="GDP per capita", ylabel="Life Expectancy (Years)",);
457
457
```
458
458
459
459
This data shows a couple of interesting relationships.
460
460
461
461
1. there are a number of countries with similar GDP per capita levels but a wide range in Life Expectancy
462
-
2. there appears to be a positive relationship between GDP per capita and life expectancy. Countries with higher GDP per capita tend to have higher life expectency outcomes
462
+
2. there appears to be a positive relationship between GDP per capita and life expectancy. Countries with higher GDP per capita tend to have higher life expectancy outcomes
463
463
464
464
Even though OLS is solving linear equations -- one option we have is to transform the variables, such as through a log transform, and then use OLS to estimate the transformed variables
465
465
@@ -470,7 +470,7 @@ ln -> ln == elasticities
470
470
By specifying `logx` you can plot the GDP per Capita data on a log scale
471
471
472
472
```{code-cell} ipython3
473
-
df.plot(x='gdppc', y='life_expectency', kind='scatter', xlabel="GDP per capita", ylabel="Life Expectancy (Years)", logx=True);
473
+
df.plot(x='gdppc', y='life_expectancy', kind='scatter', xlabel="GDP per capita", ylabel="Life Expectancy (Years)", logx=True);
474
474
```
475
475
476
476
As you can see from this transformation -- a linear model fits the shape of the data more closely.
@@ -486,11 +486,11 @@ df
486
486
**Q4:** Use {eq}`eq:optimal-alpha` and {eq}`eq:optimal-beta` to compute optimal values for $\alpha$ and $\beta$
487
487
488
488
```{code-cell} ipython3
489
-
data = df[['log_gdppc', 'life_expectency']].copy() # Get Data from DataFrame
489
+
data = df[['log_gdppc', 'life_expectancy']].copy() # Get Data from DataFrame
Copy file name to clipboardExpand all lines: lectures/time_series_with_matrices.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -504,7 +504,7 @@ print("Sigma_y = ", Sigma_y)
504
504
505
505
Notice that the covariance between $y_t$ and $y_{t-1}$ -- the elements on the superdiagonal -- are **not** identical.
506
506
507
-
This is is an indication that the time series respresented by our $y$ vector is not **stationary**.
507
+
This is is an indication that the time series represented by our $y$ vector is not **stationary**.
508
508
509
509
To make it stationary, we'd have to alter our system so that our **initial conditions** $(y_1, y_0)$ are not fixed numbers but instead a jointly normally distributed random vector with a particular mean and covariance matrix.
0 commit comments