Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-xm8r8 Total loading time: 0 Render date: 2024-06-23T02:57:47.263Z Has data issue: false hasContentIssue false
Coming soon

Appendix A - Computer Programs for Beginners

Hideaki Aoyama
Affiliation:
Kyoto University, Japan
Yoshi Fujiwara
Affiliation:
University of Hyogo, Kobe, Japan
Yuichi Ikeda
Affiliation:
Graduate School of Advanced Integrated Studies in Human Survivability, Japan
Hiroshi Iyetomi
Affiliation:
Niigata University, Niigata, Japan
Wataru Souma
Affiliation:
Nihon University, Tokyo
Hiroshi Yoshikawa
Affiliation:
Rissho University, Japan
Get access

Summary

People think that computer science is the art of geniuses but the actual reality is the opposite, just many people doing things that build on each other, like a wall of mini stones.

Donald Knuth

Mathematica Codes for Finance

If you want to start the study of macro-econophysics, economics, finance, physics, statistics, and mathematics, through analysis of real data, Mathematica is a useful tool. Mathematica provides data and tools. We list a few useful commands for finance here.

In[1]:= SetDirectory[NotebookDirectory[]]

In[2]:= FinancialData[“Classes”]

In[3]:= FinancialData[“Exchanges”]

In[4]:= FinancialData[“NYSE*”]

In[5]:= Take[FinancialData[“NYSE*”], 20]

In[6]:= Take[FinancialData[“NASDAQ*”], 20]

In[7]:= Take[FinancialData[“∧*”], 20]

In[8]:= FinancialData[“NASDAQ:AAPL”, “Properties”]

In[9]:= FinancialData[“NASDAQ:AAPL”, “Name”]

In[10]:= FinancialData[“AAPL”, “Exchange”]

In[11]:= FinancialData[“∧DJI”, “Name”]

In[12]:= FinancialData[“SP500”, “Name”]

In[13]:= FinancialData[“∧GSPC”, “Name”]

In[14]:= FinancialData[“NASDAQ:AAPL”, “OHLCV”]

In[15]:= Take[FinancialData[“NASDAQ:AAPL”, “OHLCV”,All],20]

In[16]:= DateListPlot[FinancialData[“NASDAQ:AAPL”, All], PlotRange -> All]

In[17]:= Export[“Apple.csv”, FinancialData[“NASDAQ:AAPL”, “OHLCV”, All]]

In[18]:= DateListPlot[FinancialData[“NASDAQ:AAPL”, “Return”, All], PlotRange -> All]

In[19]:= data = FinancialData[“NASDAQ:AAPL”, “OHLCV”, All]; logret = Table[fdata[[i, 1]], Log[data[[i, 2, 4]]/data[[i, 2, 1]]]g, fi, Length[data]g]; Take[logret, 20] DateListPlot[logret, PlotRange -> All]

In[20]:= data = FinancialData[“NYSE:*“]; Take[data, 10] n = Length[data]

In[21]:= For[i = 1, i < 4, i++, Export[StringReplace[data[[i]], “NYSE:” -> ““] <> ”.csv”, FinancialData[data[[i]], “OHLCV”, All]]]

In[22]:= For[i = 1, i < n + 1, i++, Export[StringReplace[data[[i]], “NYSE:” -> ““] <> ”.csv”, FinancialData[data[[i]], “OHLCV”, All]]]

Tools for Network Analysis

Many tools for network analysis and visualization are available today. Readers are able to find them using a web search. Here we list a limited number of them based on a somewhat biased selection.

Pajek (http://mrvar.fdv.uni-lj.si/pajek)

Netminer (http://www.netminer.com)

UCINET (https://sites.google.com/site/ucinetsoftware)

These three are originally developed in sociology for social network analysis, while recent development enables faster computation for larger networks.

NetworkX (https://networkx.github.io)

Python library; network analysis and visualization, exible as a script language; also applicable to small-scale visualization. anaconda, all scientific libraries in a single package, includes this and the required libraries, and is better for easy installation.

igraph (http://igraph.org)

R library; network analysis and visualization, exible as a script language with abundant tools of R, statistical computing and graphics; easy to install. Python and C versions are also available.

Gephi (https://gephi.org)

Network visualization with basic tools of network analyses included; applicable to relatively large-scale networks.

Type
Chapter
Information
Macro-Econophysics , pp. 337 - 346
Publisher: Cambridge University Press
Print publication year: 2017

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×