Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

pooya changes #246

Merged
merged 16 commits into from Nov 7, 2018
Merged

pooya changes #246

merged 16 commits into from Nov 7, 2018

Conversation

pooyaravari
Copy link
Contributor

Some changes to the text. Responds to #196

@@ -1,6 +1,6 @@
How to read this lecture...

* If using QuantEcon lectures for the first time on a computer, execute ``] add InstantiateFromURL`` inside of a notebook or the REPL
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab (It is not clear!)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: We can't have things like this in the notes, or we will forget about them.


Level
-------

Our approach is aimed at those who already have at least some knowledge of programming --- perhaps experience with Python, MATLAB, Fortran, C or similar

In particular, we assume you have some familiarity with fundamental programming concepts such as
In particular, we assume you have some familiarity with fundamental programming concepts such as:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't add on colons, it is not the style of the lectures.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In particular, we assume you have some familiarity with fundamental programming concepts such as:
In particular, we assume you have some familiarity with fundamental programming concepts such as

@@ -88,7 +86,7 @@ There are three ways to install packages and versions (where the first two metho

#. directly ``add`` the packages directly into your global installation (e.g. ``Pkg.add("MyPackage")`` or ``] add MyPackage``)
#. download an ``Project.toml`` and ``Manifest.toml`` file in the same directory as the notebook (i.e. from the ``@__DIR__`` argument), and then call ``using Pkg; Pkg.activate(@__DIR__);``
#. use the ``InstantiateFromURL`` package
#. use the ``InstantiateFromURL`` package (like below):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we need this comment.


In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described :ref:`here <jl_jupyter>`
In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described [here](getting_started.ipynb)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is markdown rather than RST links

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described [here](getting_started.ipynb)
In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described ` here <getting_started>`_

@@ -145,17 +143,17 @@ The other packages ``LinearAlgebra`` and ``Statistics`` are base Julia libraries

The arguments to ``plot`` are the numbers ``1,2, ..., n`` for the x-axis, a vector ``ϵ`` for the y-axis, and (optional) settings

The function ``randn(n)`` returns a column vector ``n`` random draws from a normal distribution mean 0 and variance 1
The function ``randn(n)`` returns a column vector with *n* random draws from a normal distribution mean 0 and variance 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is markdown or something similar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Markdown and rST syntax actually agree on this one (italics)

@@ -247,27 +244,25 @@ In Julia you can also loop directly over arrays themselves, like so
end
ϵ_mean = ϵ_sum / m

where ``ϵ[1:m]`` returns the elements of the vector at indices ``1`` to ``m``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was useful. Not sure why you removed it?


Using a Function
---------------------

The first problem with this setup is that it depends on being sequently run--which can be easily remedied with a function
The first problem with this setup is that it depends on being sequently run. Therefore, it can be easily remedied with a function:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs against the style of the lectures, which have no periods or multiple sentences without newline.


Furthermore, a default value may be enabled--so the named parameter ``iv`` is required while ``tolerance`` and ``maxiter`` have default values
Furthermore, a default value may be enabled. So the named parameter ``iv`` is required while ``tolerance`` and ``maxiter`` have default values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Against the style


The return type of the function also has named fields, ``value, normdiff,`` and ``iter``--all accessed intuitively using ``.``
The return type of the function also has named fields, ``value, normdiff,`` and ``iter``. All accessed intuitively using ``.``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Against the style.


In particular, we can use the ``Anderson acceleration`` with a memory of 5 iterations, by changing a setting
For instance, we can use the ``Anderson Acceleration`` (it is a method to calculate fixed points) with a memory of 5 iterations by changing a setting:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to write this a different way.

Copy link
Member

@arnavs arnavs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @PooyaFa, these fixes (typos, links, language, etc.) are exactly what we need.

@@ -1,6 +1,6 @@
How to read this lecture...

* If using QuantEcon lectures for the first time on a computer, execute ``] add InstantiateFromURL`` inside of a notebook or the REPL
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab (It is not clear!)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @PooyaFa, what's not clear here? The goal is to really make sure that these PRs are ready to be turned into HTML.

rst_files/julia_by_example.rst Outdated Show resolved Hide resolved
rst_files/julia_by_example.rst Outdated Show resolved Hide resolved
rst_files/julia_by_example.rst Outdated Show resolved Hide resolved
rst_files/julia_by_example.rst Outdated Show resolved Hide resolved
rst_files/julia_essentials.rst Outdated Show resolved Hide resolved
@arnavs arnavs self-assigned this Nov 7, 2018
@@ -1,6 +1,6 @@
How to read this lecture...

* If using QuantEcon lectures for the first time on a computer, execute ``] add InstantiateFromURL`` inside of a notebook or the REPL
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab (It is not clear!)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab (It is not clear!)
* For some notebooks, enable content with "Trust" on the command tab of Jupyter lab


Level
-------

Our approach is aimed at those who already have at least some knowledge of programming --- perhaps experience with Python, MATLAB, Fortran, C or similar

In particular, we assume you have some familiarity with fundamental programming concepts such as
In particular, we assume you have some familiarity with fundamental programming concepts such as:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In particular, we assume you have some familiarity with fundamental programming concepts such as:
In particular, we assume you have some familiarity with fundamental programming concepts such as


In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described :ref:`here <jl_jupyter>`
In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described [here](getting_started.ipynb)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described [here](getting_started.ipynb)
In particular, the easiest way to install and precompile all of the Julia packages used in the QuantEcon notes is to go ``] add InstantiateFromURL`` and then work in a Jupyter notebook, as described ` here <getting_started>`_

@@ -88,7 +88,7 @@ There are three ways to install packages and versions (where the first two metho

#. directly ``add`` the packages directly into your global installation (e.g. ``Pkg.add("MyPackage")`` or ``] add MyPackage``)
#. download an ``Project.toml`` and ``Manifest.toml`` file in the same directory as the notebook (i.e. from the ``@__DIR__`` argument), and then call ``using Pkg; Pkg.activate(@__DIR__);``
#. use the ``InstantiateFromURL`` package
#. use the ``InstantiateFromURL`` package (like below):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. use the ``InstantiateFromURL`` package (like below):
#. use the ``InstantiateFromURL`` package

@@ -145,17 +143,17 @@ The other packages ``LinearAlgebra`` and ``Statistics`` are base Julia libraries

The arguments to ``plot`` are the numbers ``1,2, ..., n`` for the x-axis, a vector ``ϵ`` for the y-axis, and (optional) settings

The function ``randn(n)`` returns a column vector ``n`` random draws from a normal distribution mean 0 and variance 1
The function ``randn(n)`` returns a column vector with *n* random draws from a normal distribution mean 0 and variance 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Markdown and rST syntax actually agree on this one (italics)

@@ -591,7 +587,7 @@ Passing a Function

The chief issue is that the algorithm (finding a fixed point) is reusable and generic, while the function we calculate ``p + β * v`` is specific to our problem

A key feature of languages like Julia, is the ability to efficiently handle functions passed to other functions
A key feature of languages like Julia is the ability to efficiently handle functions passed to other functions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A key feature of languages like Julia is the ability to efficiently handle functions passed to other functions:
A key feature of languages like Julia is the ability to efficiently handle functions passed to other functions


Furthermore, a default value may be enabled--so the named parameter ``iv`` is required while ``tolerance`` and ``maxiter`` have default values
Furthermore, a default value may be enabled. So the named parameter ``iv`` is required while ``tolerance`` and ``maxiter`` have default values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Furthermore, a default value may be enabled. So the named parameter ``iv`` is required while ``tolerance`` and ``maxiter`` have default values
Furthermore, a default value may be enabled
So the named parameter ``iv`` is required while ``tolerance`` and ``maxiter`` have default values


The return type of the function also has named fields, ``value, normdiff,`` and ``iter``--all accessed intuitively using ``.``
The return type of the function also has named fields, ``value, normdiff,`` and ``iter``. All accessed intuitively using ``.``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The return type of the function also has named fields, ``value, normdiff,`` and ``iter``. All accessed intuitively using ``.``
The return type of the function also has named fields, ``value, normdiff,`` and ``iter``
All can be accessed intuitively using ``.``

@@ -675,7 +671,7 @@ To show the flexibilty of this code, we can use it to find a fixed-point of the
Using a Package
----------------------------

But best of all is to avoid writing code altogether
But best of all is to avoid writing code altogether:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
But best of all is to avoid writing code altogether:
But best of all is to avoid writing code altogether


In particular, we can use the ``Anderson acceleration`` with a memory of 5 iterations, by changing a setting
For instance, we can use the ``Anderson Acceleration`` (it is a method to calculate fixed points) with a memory of 5 iterations by changing a setting:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For instance, we can use the ``Anderson Acceleration`` (it is a method to calculate fixed points) with a memory of 5 iterations by changing a setting:
The default is an algorithm called ``Anderson acceleration``, with a memory parameter of 5

@arnavs arnavs merged commit ecd2c4e into master Nov 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants