Home Data Mathematica Data Analysis

Mathematica Data Analysis

By Sergiy Suchok
books-svg-icon Book
eBook $29.99 $20.98
Print $38.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $29.99 $20.98
Print $38.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    First Steps in Data Analysis
About this book
There are many algorithms for data analysis and it’s not always possible to quickly choose the best one for each case. Implementation of the algorithms takes a lot of time. With the help of Mathematica, you can quickly get a result from the use of a particular method, because this system contains almost all the known algorithms for data analysis. If you are not a programmer but you need to analyze data, this book will show you the capabilities of Mathematica when just few strings of intelligible code help to solve huge tasks from statistical issues to pattern recognition. If you're a programmer, with the help of this book, you will learn how to use the library of algorithms implemented in Mathematica in your programs, as well as how to write algorithm testing procedure. With each chapter, you'll be more immersed in the special world of Mathematica. Along with intuitive queries for data processing, we will highlight the nuances and features of this system, allowing you to build effective analysis systems. With the help of this book, you will learn how to optimize the computations by combining your libraries with the Mathematica kernel.
Publication date:
December 2015
Publisher
Packt
Pages
164
ISBN
9781785884931

 

Chapter 1. First Steps in Data Analysis

Wolfram Mathematica is not just a system that can solve almost any mathematical task. It is a Swiss army knife, which allows you to process images, audio, and written text to perform classification and identification of objects, as well as to manage files. It also provides other tremendous capabilities. In Mathematica, you can call functions, as well as receive a call from modules that are written using different programming languages and technologies, such as C, .NET, Java, and others. The system can generate code and compile files. Mathematica includes over 4,500 functions, which go beyond mathematical calculations. Wolfram Mathematica is constantly changing while still maintaining full compatibility with previous versions.

In this chapter, you will learn the following:

  • How to install the Wolfram Mathematica system

  • How to configure it to fit your needs

  • What the Wolfram language kernel is and how to run it

  • Wolfram Mathematica features to write expressions

 

System installation


Depending on your needs, you can work with Mathematica both online and offline. For a deeper understanding of the system and its settings and capabilities, we will use the offline version. In this book, we'll deal with examples of Mathematica, version 10.2 (the current version at the time of writing this book), which are fully compatible with all future versions.

You can install Mathematica on the major operating systems: Windows, Linux, and Mac OS X.

To download a trial version of Mathematica, use this link: https://www.wolfram.com/mathematica/trial. You will be prompted to create a new Wolfram Mathematica ID or sign in with your already registered ID:

After registration, you will receive an e-mail containing the link to activate your Wolfram ID, as well as the link to access Mathematica Online. Activate your account and log in using https://user.wolfram.com/portal/login.html.

On this page, you can choose and download the Mathematica installer for your operating system.

Note

Copy the code in the Activation Key field. You will need it later to activate the product.

Let's download the Windows version of the program (by clicking on the Download for Windows button) and go through the main stages of system installation on a computer. The size of the downloaded file will be slightly larger than 2 GB, so make sure you have enough free space on your computer, both for the installer and for the installation of Mathematica.

Once the Mathematica_10.2.0_WIN.zip file is downloaded to your computer, extract it into a separate directory and run setup.exe:

At this point, the installer will inform us that the installation process of Mathematica 10.2 is about to start. In order to proceed, click on Next in the preceding screenshot.

Note that the system installation requires 6.2 GB of free disk space. In the preceding screenshot, select the directory where you want to install Mathematica and click on Next.

In the next dialog window, as shown in the preceding screenshot, you should choose the components of Mathematica you want to install. The Wolfram Extras package includes plugins for browsers that allow you to preview the Mathematica files embedded in web pages.

To continue the installation, click on the Next button.

As shown in the previous screenshot, you need to select a folder in the Start Menu to place the program's shortcuts. Then click on Next.

After that, we will see the summary of the previously selected options as shown in the preceding screenshot. Click on the Install button to start copying the files. After all files are copied, you will be notified that the installation is finished. You can check off the Launch Wolfram Mathematica checkbox to start learning the system immediately:

Once the system launches, you need to enter the activation key that we copied from the Wolfram website earlier:

Now, click on the Activate button. You will be redirected to the following page:

Read the license agreement and check the I accept the terms of this agreement box. Then click on OK.

Now, the Mathematica system is ready for the first use:

 

Setting up the system


To access the Preferences dialog, you need to select Edit | Preferences… in the application menu.

Note

On Mac OS X, the Preferences menu is located in the Mathematica application menu.

Let's review the most interesting settings of the system, which will be useful for our further work:

In the Appearance | Number | Formatting tab, you can select various numeric formatting options. Will there be a space separator between the digit blocks? What should be the decimal point character? How many digits will be displayed by default in the output?

In the next Multiplication tab, you can select the appearance of the multiplication:

Note

In Mathematica, the space between two expressions means multiplying those expressions.

In this tab, you can choose whether the multiplication symbol between the multiplied numbers appears automatically, as well as choose the symbol type: space, center dot, *, or x.

 

The Mathematica front end and kernel


The Wolfram system has a modular structure and consists of two main parts. The one that directly performs all computations is called the kernel; the other part that interacts with the user is called the front end.

The kernel can be installed on the server, and it processes requests from multiple user interfaces. However, the single user interface can use several connected kernels for its computations.

In order to connect multiple kernels, navigate to Evaluation | Kernel Configuration Options… and click on the Add button.

In the dialog window that opens, you can select whether the kernel will be located on a local computer or on a remote computer in the network. You can also enter the parameters in order to connect to this computer. There is a capability to be always aware of which kernel was used for computations.

The front end has the following interfaces:

  • Notebook: It is the document in which the user enters all the necessary expressions and algorithms.

  • Text-based interface: It is a command-line interface. It is used in text operating systems and not in the graphics operating systems.

  • Wolfram Symbolic Transfer Protocol (WSTP): It is the interface that enables interaction with other programs and modules.

 

Main features for writing expressions


At the beginning, it should be mentioned that Wolfram Mathematica has a very extensive reference system. You can access it by selecting in this menu: Support | Wolfram Documentation:

Let's get acquainted with some distinctions of Mathematica that will help us to understand the source code in the following chapters.

Let's create our first notebook. When Mathematica starts, you should choose New Document and then Notebook.

In order to compute any expression, press Shift + Enter after entering it. The input expression will be denoted by In and the output by Out:

In[1]:= 1 + 4
Out[1]= 5

Note

In this and other samples, all the formulas will start with In[Number]; you shouldn't type this because it is the number of the input that Mathematica calculates automatically.

All built-in functions always start with a capital letter, as shown here:

No variables should start with a number, since it will automatically be treated as a multiplication operation. They cannot end with a $ symbol.

If the variable ends with _, then it is a template expression and it can be substituted with anything, for example:

In Mathematica, there are four types of brackets:

  • Square []: These are used to describe the function parameters

  • Round (): These are used to group expressions and logical elements

  • Curly {}: These are used to describe the elements of arrays, vectors, and data lists

  • Double Square [[ ]]: These are used to allocate a specific item in a data list

In Mathematica, there are two types of assignments: absolute (=) and delayed (:=).

The difference is that in a delayed assignment, the right-hand side of the expression is always recomputed if the function is called. In an absolute assignment, the value that was in place during the assignment is stored.

In this example, we see that at the time of the second call of variables, x2 adopted the current time value. At the same time, x1 remained unchanged.

In order to use the result of the preceding expression, one can use the % symbol:

The basis of the Mathematica language is the functional form of all the expressions. In order to see a complete expression, the FullForm function should be used:

The variables that are not used should be cleared by the Clear function. Otherwise, computation errors will occur:

 

Summary


In this chapter, we learned how to install the Wolfram Mathematica software and reviewed the basic components of the system: front end and kernel. We also gained a knowledge of the Mathematica language features.

In the next chapters, we will review additional features and techniques that facilitate work in Mathematica.

About the Author
  • Sergiy Suchok

    Sergiy Suchok graduated in 2004 with honors from the Faculty of Cybernetics, Taras Shevchenko National University of Kyiv (Ukraine), and since then, he has a keen interest in information technology. He is currently working in the banking sector and has a PhD in Economics. Sergiy is the coauthor of more than 45 articles and has participated in more than 20 scientific and practical conferences devoted to economic and mathematical modeling.

    Browse publications by this author
Latest Reviews (7 reviews total)
excelente libro, lo estoy examinando.
Great Price for a very useful book!
The book matched my needs.
Mathematica Data Analysis
Unlock this book and the full library FREE for 7 days
Start now