History of lazy_portfolios
The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.
[entries] Add the date when each entry was added, and remove icon_hash beff7c9
The dates are those of the commits that first added the entries' files (2020-08-11 for the entries of the initial commit); renamed entries keep the date of their first name. Changed: none
diff --git a/entries/lazy_portfolios/__init__.py b/entries/lazy_portfolios/__init__.py
index 556fcd0..87f654c 100644
--- a/entries/lazy_portfolios/__init__.py
+++ b/entries/lazy_portfolios/__init__.py
@@ -45,7 +45,7 @@ tags = ['Economic', 'Weighted', 'Temporal', 'Metadata']
url = 'https://doi.org/10.6084/m9.figshare.5700832'
citation = [('S. Aref and M. C. Wilson, "Balance and frustration in signed networks." J. Complex Networks 7(2), 163–189 (2019)', 'https://doi.org/10.1093/comnet/cny015'),
('S. Aref, "Signed networks from sociology and political science, systems biology, international relations, finance, and computational chemistry." Figshare (2017)', 'https://doi.org/10.6084/m9.figshare.5700832')]
-icon_hash = '5e23dd0478691ca4060b62b8'
+date_added = '2026-10-25'
upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
"https://creativecommons.org/licenses/by/4.0/")
upstream_prefix = 'https://ndownloader.figshare.com/files'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) bc3dbbd
The lists of properties at the end of the descriptions marked edge properties with "Edge" but left node properties unmarked, or grouped them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property was often unclear. Every item now starts with (Node), (Edge) or (Graph), followed by the property names, a colon and the explanation, one item per property or group of properties; qualifications (kinds of nodes, networks) follow the names in parentheses. Properties that were only named got a short explanation, and a few items that named the wrong kind of property were corrected.
diff --git a/entries/lazy_portfolios/__init__.py b/entries/lazy_portfolios/__init__.py
index 2f0f284..556fcd0 100644
--- a/entries/lazy_portfolios/__init__.py
+++ b/entries/lazy_portfolios/__init__.py
@@ -34,11 +34,11 @@ There is one network per portfolio and month, named `<portfolio>_<YYYY-MM>` (108
The networks have the following properties:
-- `name` (vertices): the name of the security (e.g. "Vanguard 500 Index Fund").
-- `ticker` (vertices): the ticker symbol of the security (e.g. `VFINX`).
-- `return` (vertices): the return of the security over the month, in percent.
-- `daily_std`, `monthly_std`, `annualized_std` (vertices): the standard deviation of the daily returns during the month, and the monthly and annualized standard deviations of the monthly returns, in percent, as reported by Portfolio Visualizer for the query interval (from the first day of the month to the first day of the next month).
-- `weight` (edges): the correlation coefficient between the daily returns of the two securities during the month.
+- (Node) `name` (vertices): the name of the security (e.g. "Vanguard 500 Index Fund").
+- (Node) `ticker` (vertices): the ticker symbol of the security (e.g. `VFINX`).
+- (Node) `return` (vertices): the return of the security over the month, in percent.
+- (Node) `daily_std`, `monthly_std`, `annualized_std` (vertices): the standard deviation of the daily returns during the month, and the monthly and annualized standard deviations of the monthly returns, in percent, as reported by Portfolio Visualizer for the query interval (from the first day of the month to the first day of the next month).
+- (Edge) `weight` (edges): the correlation coefficient between the daily returns of the two securities during the month.
The source also contains, for each portfolio and year, a document listing the Portfolio Visualizer query URLs used to export the data; these are not included."""
tags = ['Economic', 'Weighted', 'Temporal', 'Metadata']
[entries] Remove unneeded code from the entries 2c69f19
Unneeded "global files" statements, unused imports and variables, f-strings without placeholders, duplicate keys in foodweb_little_rock (keeping the order and the values used), and the second definition of get_lines() in twitter_higgs. Nothing changes in the networks or descriptions. Changed: none
diff --git a/entries/lazy_portfolios/__init__.py b/entries/lazy_portfolios/__init__.py
index 25e7a6c..2f0f284 100644
--- a/entries/lazy_portfolios/__init__.py
+++ b/entries/lazy_portfolios/__init__.py
@@ -91,7 +91,6 @@ def _parse_correlations(f):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fname, alt, fmt in files:
if alts is not None and alt not in alts:
[entries] New entry: lazy_portfolios e12ead5
diff --git a/entries/lazy_portfolios/__init__.py b/entries/lazy_portfolios/__init__.py
new file mode 100644
index 0000000..25e7a6c
--- /dev/null
+++ b/entries/lazy_portfolios/__init__.py
@@ -0,0 +1,101 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "Lazy portfolio security correlations (2008-2016)"
+description = r"""Monthly correlation networks of the securities of six "lazy portfolios", portfolios made of a few well-diversified securities that financial experts recommend for their low risk in most market conditions, from January 2008 to December 2016. The data were collected by S. Aref from the Portfolio Visualizer website, and used by S. Aref and M. C. Wilson to study the structural balance of signed networks of securities (Aref and Wilson, 2019): following Harary et al., they obtained a signed network from each correlation network by keeping the pairs whose correlation exceeds $0.2$ in absolute value, with the sign of the correlation, and found that these portfolio networks are balanced in most months.
+
+Nodes are the securities (mutual funds and exchange-traded funds) of a portfolio, and each network is a complete undirected graph whose edges are weighted by the Pearson correlation coefficient between the daily returns of the two securities during the month.
+
+There is one network per portfolio and month, named `<portfolio>_<YYYY-MM>` (108 per portfolio), with the portfolios (numbered P1 to P6 in the paper):
+
+- `ivy`: Mebane Faber's Ivy Portfolio (5 securities: VTI, VEU, IEF, VNQ, GSG).
+- `simple`: Larry Swedroe's Simple Portfolio (6 securities).
+- `ultimate`: the FundAdvice (Paul Merriman) Ultimate Buy & Hold Portfolio (11 securities).
+- `yale`: David Swensen's Yale Endowment portfolio (6 securities).
+- `swensen`: David Swensen's Lazy Portfolio (6 securities).
+- `coffeehouse`: Bill Schultheis' Coffee House Portfolio (7 securities).
+
+The networks have the following properties:
+
+- `name` (vertices): the name of the security (e.g. "Vanguard 500 Index Fund").
+- `ticker` (vertices): the ticker symbol of the security (e.g. `VFINX`).
+- `return` (vertices): the return of the security over the month, in percent.
+- `daily_std`, `monthly_std`, `annualized_std` (vertices): the standard deviation of the daily returns during the month, and the monthly and annualized standard deviations of the monthly returns, in percent, as reported by Portfolio Visualizer for the query interval (from the first day of the month to the first day of the next month).
+- `weight` (edges): the correlation coefficient between the daily returns of the two securities during the month.
+
+The source also contains, for each portfolio and year, a document listing the Portfolio Visualizer query URLs used to export the data; these are not included."""
+tags = ['Economic', 'Weighted', 'Temporal', 'Metadata']
+url = 'https://doi.org/10.6084/m9.figshare.5700832'
+citation = [('S. Aref and M. C. Wilson, "Balance and frustration in signed networks." J. Complex Networks 7(2), 163–189 (2019)', 'https://doi.org/10.1093/comnet/cny015'),
+ ('S. Aref, "Signed networks from sociology and political science, systems biology, international relations, finance, and computational chemistry." Figshare (2017)', 'https://doi.org/10.6084/m9.figshare.5700832')]
+icon_hash = '5e23dd0478691ca4060b62b8'
+upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
+ "https://creativecommons.org/licenses/by/4.0/")
+upstream_prefix = 'https://ndownloader.figshare.com/files'
+
+_portfolios = {"ivy": "Mebane Faber Ivy Portfolio",
+ "simple": "Larry Swedroe Simple Portfolio",
+ "ultimate": "FundAdvice Ultimate Buy & Hold Portfolio",
+ "yale": "David Swensen Yale Endowment",
+ "swensen": "David Swensen Lazy Portfolio",
+ "coffeehouse": "Bill Schultheis Coffee House"}
+files = [(f"21172485:zip:Financial Networks/Lazy portfolios - Monthly data based on daily returns 2008-2017/{d}/Correlations({y}{m:02d}).csv",
+ f"{k}_{y}-{m:02d}", "csv")
+ for k, d in _portfolios.items() for y in range(2008, 2017) for m in range(1, 13)]
+
+def fetch_upstream(force=False):
+ return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+ force)
+
+def _parse_correlations(f):
+ rows = [r for r in csv.reader(f) if r]
+ i = [j for j, r in enumerate(rows) if r[0] == "Name"][0]
+ body = []
+ for r in rows[i + 1:]:
+ if r[0].startswith("Notes"):
+ break
+ body.append(r)
+ N = len(body)
+ g = Graph(directed=False)
+ g.add_vertex(N)
+ g.vp.name = g.new_vp("string", vals=[r[0].strip() for r in body])
+ g.vp.ticker = g.new_vp("string", vals=[r[1].strip() for r in body])
+ for j, p in enumerate(["return", "daily_std", "monthly_std",
+ "annualized_std"]):
+ g.vp[p] = g.new_vp("double", vals=[float(r[2 + N + j].rstrip("%"))
+ for r in body])
+ g.ep.weight = g.new_ep("double")
+ g.add_edge_list([(u, v, float(body[u][2 + v]))
+ for u in range(N) for v in range(u + 1, N)],
+ eprops=[g.ep.weight])
+ return g
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+ global files
+ name = __name__.split(".")[-1]
+ for fname, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fname, "r", encoding="utf-8-sig") as f:
+ g = _parse_correlations(f)
+ yield alt, g