pooya changes #246
pooya changes #246
Conversation
@@ -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!) |
There was a problem hiding this comment.
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.
rst_files/julia_by_example.rst
Outdated
|
||
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
rst_files/julia_by_example.rst
Outdated
@@ -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): |
There was a problem hiding this comment.
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.
rst_files/julia_by_example.rst
Outdated
|
||
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>`_ |
rst_files/julia_by_example.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
rst_files/julia_by_example.rst
Outdated
@@ -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`` |
There was a problem hiding this comment.
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?
rst_files/julia_by_example.rst
Outdated
|
||
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: |
There was a problem hiding this comment.
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.
rst_files/julia_by_example.rst
Outdated
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Against the style
rst_files/julia_by_example.rst
Outdated
|
||
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 ``.`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Against the style.
rst_files/julia_by_example.rst
Outdated
|
||
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!) |
There was a problem hiding this comment.
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.
@@ -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!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 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 |
rst_files/julia_by_example.rst
Outdated
|
||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
rst_files/julia_by_example.rst
Outdated
|
||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>`_ |
rst_files/julia_by_example.rst
Outdated
@@ -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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#. use the ``InstantiateFromURL`` package (like below): | |
#. use the ``InstantiateFromURL`` package |
rst_files/julia_by_example.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
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)
rst_files/julia_by_example.rst
Outdated
@@ -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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
rst_files/julia_by_example.rst
Outdated
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
rst_files/julia_by_example.rst
Outdated
|
||
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 ``.`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ``.`` |
rst_files/julia_by_example.rst
Outdated
@@ -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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But best of all is to avoid writing code altogether: | |
But best of all is to avoid writing code altogether |
rst_files/julia_by_example.rst
Outdated
|
||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Some changes to the text. Responds to #196