text:
In financial markets there are many different types of traders, both human and algorithmic. They are often categorized by their trading time-frame. Alternatively it is possible to categorize based on what kind of strategies they apply.

In general there is one main distinctions to make. There is a difference between technical and fundamental trading. Fundamental trading includes factors outside the price of the security; typically a company’s accounts is used. Technical trading however is only based on the actual price development and its qualities. Technical traders base their strategy on the assumption that historical price data can in some way predict future prices. The degrees to which analysis one employs affect the time-frame, since fundamental analysis is inherently much more static than technical. Price update occur several times per second, while the company results are only published once a quarter. Fundamental data is also more qualitative and thus harder to analyze quickly, e.g., news. Analysis of technical data is purely quantitative, and can thus be readily handled by computers. Generally, the shorter time-frame, the more automated the traders are.

The longest time-frame is often called position trading. It generally consists of all positions held longer than a few months. This is a very reputable strategy, recommended by Warren Buffet himself, but with a limited possibility of return. Since one has plenty of time to do a thorough analysis of the asset, algorithmic methods have less advantage here, but can be used as supplementary guidance. This category also includes more active investors, who are active in a different sense than earlier described. They take an active part in management of the company they’re invested in, like private equity companies.

Positions held over days or weeks include strategies like swing trading and more short-term fundamental analysis strategies. This is generally the shortest time-frame one finds purely fundamental analysis traders. Changes in price on a lower scale than days are often considered noise to these traders. There is some technical analysis done over several days, but it is limited. This is because the primary goal of pure technical analysts is to speculate on price swings. A shorter time frame will give more than enough volatility to do this, due to the fractal nature of the stock market. A fractal is a mathematical concept where roughness exist at whatever resolution you look at. The graph of price a different time periods will tend to have roughly the same kind of volatility.

Intraday trading is trading confined to a single day, most day-traders sell their positions before close. This is mainly speculation and mostly done by technical analysis, though one might supplement with fundamental techniques. Day trading can be a job for human investors, but require much time and is quite close to a zero sum game due to the lack of the long term equity premium. Intraday trading is becoming the realm of machines as they can search through much more data. Most machines are however trading on more or less instant strategies where the aim is to hold an actual position as short as possible; these are called High-frequency traders.

High-frequency trading (HFT) is a poorly defined term. In this paper it is used in its semantic meaning of all trading done at a high frequency instead of meddling with all the contradictory definitions in the literature. With this meaning of the term, HFT will be a broad concept that includes all trading where the trading speed is used as a competitive advantage. In 2010 these systems trade on milli- and microseconds. All HFT is done by algorithms, as the speeds required for this trading type are beyond human capabilities.

Low-latency trading is a subclass of HFT, and can be thought of as a specific strategy of HFT. These are a naive set of simple algorithms which sole advantage is their ultra-low latency, direct market access. An example of a low-latency strategy is to survey the news. The instance good news hits the market, a low-latency trader will buy from slower sellers which have not had time to increase their bid price, and then sell to a new higher price. Most of these tactics revolve around quickly finding and exploiting arbitrage possibilities. There is tough competition in having the fastest algorithms and the lowest latency. This activity is very capital intensive due to the hardware requirements and it needs a certain initial capital. There are few amateurs in this area and most actors are large banks, funds or even specialized algorithmic trading firms.

## Signal Emitter Positioning Using Multilateration

In this post we solve the problem of spatial location of a signal emitter in Euclidian $$\mathbb{R}^3$$ space by means of time difference of arrival (TDOA) at multiple omnidirectional sensors.

## Introduction

Multilateration is a technique that uses multiple omnidirectional sensors in order to isolate the unknown position of a signal emitter in two- or three-dimensional Euclidian space. Two examples of sensors and signals could be microphones listening for sharp noises, or radio receivers listening for radio signals. In any case, these sensors are located at unique known positions where they listen for what is called a signal event. Such events are timestamped based on a synchronized or centralized clock common to all sensors. The signal from an emitter is registered by all sensors only once as the signal wave expands spherically in all directions with constant propagation speed. The time difference between when two sensors register the signal event is called the time difference of arrival (TDOA). Based on the TDOA and the location of each registration, i.e., sensor positions, we can deduce the location of the signal emitter.

## Model definitions

Let sensors $$i=1,\ldots,k$$ at positions $$\vec{p}_{i}$$ be sensors that output a timestamp $$t_{i}$$ for when they register a signal wave with propagation speed $$v$$ from a signal emitter at unknown position $$\vec{x}$$, signal start time $$t$$ and distance $$v\left(t_{i}-t\right)=\|\vec{x}-\vec{p}_{i}\|$$ away. If we define sensor $$c$$ to be the first sensor to register a signal event, then the signal wave has traveled for $$(t_{c}-t)$$ time units and a distance of $$v(t_{c}-t)=\|\vec{x}-\vec{p}_{c}\|$$ before reaching the first sensor. Furthermore, the TDOA between each sensor’s timestamp and the initial sensor’s timestamp is $$(t_{i}-t_{c})$$ yielding the the distance $$v\Delta t_{i}=v(t_{i}-t_{c})$$ traveled by the signal wave since initially being registered and finally reaching the $$i$$th sensor. From the definitions above we have the following important relationships.

\|\vec{x}-\vec{p}_{i}\|=v\left(t_{i}-t\right)\label{eq:main}

and the equivalent formulations

\begin{split}\|\vec{x}-\vec{p}_{i}\|=v(t_{i}-t_{c})+\|\vec{x}-\vec{p}_{c}\|\end{split}
\label{eq:mainSplit}

\|\vec{x}-\vec{p}_{i}\|=v(t_{i}-t_{c})+v(t_{c}-t)\label{eq:mainTime}

The following figure shows the various geometric distance relationships of the multilateration problem.

Distance relationships of the multilateration problem.

## Geometric Interpretation

In general the positions $$\vec{p}_{i},\vec{p}_{c}$$ and TDOA $$t_{i}-t_{c}$$ of a pair of sensors limits the signal emitter’s position to lay on one sheet of a circular two-sheeted hyperboloid with foci at $$\vec{p}_{i}$$ and $$\vec{p}_{c}$$. Given that $$c$$ is the first of the two sensors to register a signal event, then only the sheet at focus $$\vec{p}_{c}$$ is materialized. The associated directrix plane can be found by a known position vector and normal vector. Since the directrix is orthogonal to the vector pointing from sensor $$i$$ to sensor $$c$$, we know that $$p_{c}-p_{i}$$ itself or its unit vector
$\frac{\vec{p}_{c}-\vec{p}_{i}}{\|\vec{p}_{c}-\vec{p}_{i}\|}$
can serve as a normal vector. Next we need a position vector with endpoint on the directrix plane. One such vector can be defined by the point at which the directrix intersects the line segment between $$\vec{p}_{i}$$ and $$\vec{p}_{c}$$. This point lays a length $$v(t_{i}-t_{c})$$ away from $$p_{i}$$ towards $$\vec{p}_{c}$$, that is, it lays at the position vector
$\vec{p}_{i}+v(t_{i}-t_{c})\frac{\vec{p}_{c}-\vec{p}_{i}}{\|\vec{p}_{c}-\vec{p}_{i}\|}$

The following figure illustrates how TDOA can be used to constrain the multilateration problem solution to one sheet of a two-sheeted circular hyperboloid in $$\mathbb{R}^{3}$$.

Given sensor pair i and c the feasible region of emittor position x is constrained to one sheet of a two-sheeted circular hyperboloid.

With enough of these constraints, i.e., having enough sensors, we can isolate the signal emitter position to a single point as in the following figure in $$\mathbb{R}^{2}$$ space.

Given pairings between tre sensors i=1,2,3 with sensor c=4 we can generate three hyperboles which all intersect at emittor possition x.

## Reduction to Linear Form

The most efficient way to solve the multilateration problem is to reduce the problem to linear form. To determining the location of the signal emitter we can use three unique pairs $$i,j$$ of sensors in addtion to an initial discovery sensor $$c$$. This reduces the problem to a linear system of three equations, and requires at least five sensor.

\begin{alignedat}{2}\|\vec{x}-\vec{p}_{i}\| & = & v(t_{i}-t_{c})+\|\vec{x}-\vec{p}_{c}\|\\ \|\vec{x}-\vec{p}_{i}\|^{2} & = & \left(v(t_{i}-t_{c})+\|\vec{x}-\vec{p}_{c}\|\right)^{2}\\ \|\vec{x}-\vec{p}_{i}\|^{2} & = & v^{2}(t_{i}-t_{c})^{2}+2v(t_{i}-t_{c})\|\vec{x}-\vec{p}_{c}\|+\|\vec{x}-\vec{p}_{c}\|^{2} \end{alignedat}

Introducing another sensor $$j$$ we can eliminate the $$\|x-p_{c}\|$$ term.

{2}-2\|\vec{x}-\vec{p}_{c}\|\\ = v(t_{i}-t_{c})+\frac{\|\vec{x}-\vec{p}_{c}\|^{2}-\begin{split}\|\vec{x}-\vec{p}_{i}\|^{2}\end{split}}{v(t_{i}-t_{c})}
\label{eq:tempRes1}

-2\|\vec{x}-\vec{p}_{c}\|\\ = v(t_{j}-t_{c})+\frac{\|\vec{x}-\vec{p}_{c}\|^{2}-\begin{split}\|\vec{x}-\vec{p}_{j}\|^{2}\end{split}}{v(t_{j}-t_{c})}
\label{eq:tempRes2}

v(t_{j}-t_{c})+\frac{\|\vec{x}-\vec{p}_{c}\|^{2}-\begin{split}\|\vec{x}-\vec{p}_{j}\|^{2}\end{split}}{v(t_{j}-t_{c})}\\ = v(t_{i}-t_{c})+\frac{\|\vec{x}-\vec{p}_{c}\|^{2}-\begin{split}\|\vec{x}-\vec{p}_{i}\|^{2}\end{split}}{v(t_{i}-t_{c})}
\label{eq:tempRes3}

Now, expanding the definitions of the squared distances from each of the sensors and the emitter we get the following.

\begin{alignedat}{2}\begin{split}\|\vec{x}-\vec{p}_{i}\|^{2}\end{split}
& = & \left(\vec{x}-\vec{p}_{i}\right)^{T}\left(\vec{x}-\vec{p}_{i}\right)=\vec{x}^{T}\vec{x}-2\vec{p}_{i}^{T}x+\vec{p}_{i}^{T}\vec{p}_{i}\\
\|\vec{x}-\vec{p}_{j}\|^{2} & = & \vec{x}^{T}\vec{x}-2\vec{p}_{j}^{T}\vec{x}+\vec{p}_{j}^{T}\vec{p}_{j}\\
\|\vec{x}-\vec{p}_{c}\|^{2} & = & \vec{x}^{T}\vec{x}-2\vec{p}_{c}^{T}\vec{x}+\vec{p}_{c}^{T}\vec{p}_{c}
\end{alignedat}
\label{eq:xpDefRe}

\begin{alignedat}{2}v(t_{j}-t_{c})+\frac{2\left(\vec{p}_{j}^{T}-\vec{p}_{c}^{T}\right)\vec{x}+\vec{p}_{c}^{T}\vec{p}_{c}-\vec{p}_{j}^{T}\vec{p}_{j}}{v(t_{j}-t_{c})} \\ = v(t_{i}-t_{c})+\frac{2\left(\vec{p}_{i}^{T}-\vec{p}_{c}^{T}\right)\vec{x}+\vec{p}_{c}^{T}\vec{p}_{c}-\vec{p}_{i}^{T}\vec{p}_{i}}{v(t_{i}-t_{c})}\end{alignedat}
\label{eq:systemRaw}

Notice that the quadratic terms have fallen out and we are left with a very solvable linear system of equations

$\vec{a}_{ijc}^{T}\vec{x}=b_{ijc}$

where

\begin{alignedat}{2}\vec{a}_{ijc} & = & 2\left(v(t_{j}-t_{c})(\vec{p}_{i}-\vec{p}_{c})-v(t_{i}-t_{c})(\vec{p}_{j}-\vec{p}_{c})\right)\in\mathbb{R}^{3}\\ b_{ijc} & = & v(t_{i}-t_{c})\left(v^{2}(t_{j}-t_{c})^{2}-\vec{p}_{j}^{T}\vec{p}_{j}\right)\\ & + & \left(v(t_{i}-t_{c})-v(t_{j}-t_{c})\right)\vec{p}_{c}^{T}\vec{p}_{c}\\ & + & v(t_{j}-t_{c})\left(\vec{p}_{i}^{T}\vec{p}_{i}-v^{2}(t_{i}-t_{c})^{2}\right)\in\mathbb{R} \end{alignedat}

This can be expressed as just

$\textbf{A}x=b$
where each pair $$i,j$$ creates the matrix $$\textbf{A}$$ and vector $$b$$ defined by $$b_{ijc}\in b\in\mathbb{R}^{3}$$ and $$\vec{a}_{ijc}\in \textbf{A}\in\mathbb{R}^{3\times3}$$ such that $$\vec{a}_{ijc}^{T}$$ are the rows of $$\textbf{A}$$. This can be solved using LP or some other more or less direct method. We will be simply computing the iverse of $$\textbf{A}$$ such that
$\hat{x}=\textbf{A}^{-1}b=\textbf{A}\backslash b$

## Application

In order to aid intuition it might be helpful to translate the problem in to a real world interpretation. The problem analogy is that of submarine localization using passive acoustic sensors.

The submarine, i.e., the signal emitter, is placed somewhere in a six cubic kilometer body of water. The acoustic sensors are placed randomly in a one cubic kilometer body of water. Both bodies of water has the coordinate system origin in its center.

The following MATLAB code embodies this scenario: multilateration.m.


text:
$$\renewcommand{\AA}{\text{Å}}$$

pair_style lj96/cut command¶

Accelerator Variants: lj96/cut/gpu, lj96/cut/omp

Syntax¶

pair_style lj96/cut cutoff
• cutoff = global cutoff for lj96/cut interactions (distance units)

Examples¶

pair_style lj96/cut 2.5
pair_coeff * * 1.0 1.0 4.0
pair_coeff 1 1 1.0 1.0

Description¶

The lj96/cut style compute a 9/6 Lennard-Jones potential, instead of the standard 12/6 potential, given by

$E = 4 \epsilon \left[ \left(\frac{\sigma}{r}\right)^{9} - \left(\frac{\sigma}{r}\right)^6 \right] \qquad r < r_c$

$$r_c$$ is the cutoff.

The following coefficients must be defined for each pair of atoms types via the pair_coeff command as in the examples above, or in the data file or restart files read by the read_data or read_restart commands, or by mixing as described below:

• $$\epsilon$$ (energy units)

• $$\sigma$$ (distance units)

• cutoff (distance units)

The last coefficient is optional. If not specified, the global LJ cutoff specified in the pair_style command is used.

Styles with a gpu, intel, kk, omp, or opt suffix are functionally the same as the corresponding style without the suffix. They have been optimized to run faster, depending on your available hardware, as discussed on the Accelerator packages page. The accelerated styles take the same arguments and should produce the same results, except for round-off and precision issues.

These accelerated styles are part of the GPU, INTEL, KOKKOS, OPENMP, and OPT packages, respectively. They are only enabled if LAMMPS was built with those packages. See the Build package page for more info.

You can specify the accelerated styles explicitly in your input script by including their suffix, or you can use the -suffix command-line switch when you invoke LAMMPS, or you can use the suffix command in your input script.

See the Accelerator packages page for more instructions on how to use the accelerated styles effectively.

Mixing, shift, table, tail correction, restart, rRESPA info¶

For atom type pairs I,J and I != J, the epsilon and sigma coefficients and cutoff distance for all of the lj/cut pair styles can be mixed. The default mix value is geometric. See the “pair_modify” command for details.

This pair style supports the pair_modify shift option for the energy of the pair interaction.

The pair_modify table option is not relevant for this pair style.

This pair style supports the pair_modify tail option for adding a long-range tail correction to the energy and pressure of the pair interaction.

This pair style writes its information to binary restart files, so pair_style and pair_coeff commands do not need to be specified in an input script that reads a restart file.

This pair style supports the use of the inner, middle, and outer keywords of the run_style respa command, meaning the pairwise forces can be partitioned by distance at different levels of the rRESPA hierarchy. See the run_style command for details.

Restrictions¶

This pair style is part of the EXTRA-PAIR package. It is only enabled if LAMMPS was built with that package. See the Build package page for more info.

none

format: plain


text:
The vector sum of two vectors $\stackrel{\to }{\mathrm{A}}$ and $\stackrel{\to }{\mathrm{B}}$ is maximum, then the angle $\mathrm{\theta }$ between two vectors is -

(A)  $0°$

(B)  $30°$

(C)  $45°$

(D)  $60°$

Concept Questions :-

Resultant of Vectors
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Given: $\stackrel{\to }{\mathrm{C}}=\stackrel{\to }{\mathrm{A}}+\stackrel{\to }{\mathrm{B}}$. Also, the magnitude of  and $\stackrel{\to }{\mathrm{C}}$ are 12, 5 and 13 units respectively. The angle between $\stackrel{\to }{\mathrm{A}}$ and $\stackrel{\to }{\mathrm{B}}$ is

(A)  $0°$

(B)  $\frac{\mathrm{\pi }}{4}$

(C)  $\frac{\mathrm{\pi }}{2}$

(D)  $\mathrm{\pi }$

Concept Questions :-

Resultant of Vectors

Difficulty Level:

If $\stackrel{\to }{\mathrm{P}}+\stackrel{\to }{\mathrm{Q}}=\stackrel{\to }{\mathrm{P}}-\stackrel{\to }{\mathrm{Q}}$ and $\mathrm{\theta }$ is the angle between $\stackrel{\to }{\mathrm{P}}$ and $\stackrel{\to }{\mathrm{Q}}$, then

(A)  $\mathrm{\theta }=0°$

(B)  $\mathrm{\theta }=90°$

(C)  $\mathrm{P}=0$

(D)  $\mathrm{Q}=0$

Concept Questions :-

Resultant of Vectors
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

What is the torque of a force  Newton acting at a point  metre about the origin?

(A)

(B)

(C)

(D)

Concept Questions :-

Vector Product
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Three non zero vectors  satisfy the relation . Then $\stackrel{\to }{\mathrm{A}}$ can be parallel to:

(A)  $\stackrel{\to }{\mathrm{B}}$

(B)  $\stackrel{\to }{\mathrm{C}}$

(C)  $\stackrel{\to }{\mathrm{B}}·\stackrel{\to }{\mathrm{C}}$

(D)  $\stackrel{\to }{\mathrm{B}}×\stackrel{\to }{\mathrm{C}}$

Concept Questions :-

Scalar Product

Difficulty Level:

The scalar product of two vectors is 8 and the magnitude of vector product is $8\sqrt{3}$. The angle between them is:

(A)  $30°$

(B)  $60°$

(C)  $120°$

(D)  $150°$

Concept Questions :-

Vector Product
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Given: $\stackrel{\to }{\mathrm{a}}+\stackrel{\to }{\mathrm{b}}+\stackrel{\to }{\mathrm{c}}=0$. Out of the three vectors  and $\stackrel{\to }{\mathrm{c}}$ two are equal in magnitude. The magnitude of the third vector is $\sqrt{2}$ times that of either of the two having equal magnitude. The angles between the vectors are:

(A)  90$°$, 135$°$, 135$°$

(B)  30$°$, 60$°$, 90$°$

(C)  45$°$, 45$°$, 90$°$

(D)  45$°$, 60$°$, 90$°$

Concept Questions :-

Resultant of Vectors
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Vector $\stackrel{\to }{\mathrm{A}}$ is of length 2 cm and is 60$°$ above the x-axis in the first quadrant. Vector $\stackrel{\to }{\mathrm{B}}$ is of length 2 cm and 60$°$ below the x-axis in the fourth quadrant. The sum $\stackrel{\to }{\mathrm{A}}$+$\stackrel{\to }{\mathrm{B}}$ is a vector of magnitude -

(A)  2 along + y-axis

(B)  2 along + x-axis

(C)  1 along - x-axis

(D)  2 along - x-axis

Concept Questions :-

Resultant of Vectors
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Six forces, 9.81 N each, acting at a point are coplanar. If the angle between neighboring forces are equal, then the resultant is

(A)  0 N

(B)  9.81 N

(C)  2$×$9.81 N

(D)  3$×$9.81 N

Concept Questions :-

Resultant of Vectors
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Temperature of a body varies with time as , where ${\mathrm{T}}_{0}$ is the temperature in Kelvin at , then the rate of change of temperature $\left(\frac{\mathrm{dT}}{\mathrm{dt}}\right)$ at  is-

1.

2.

3.

4.

Concept Questions :-

Differentiation


text:
# Continuity Tutorials

## Do As I Do

Lets try a simple method. I'll show you code, then I'll talk about it. Here is our first example... it isn't exactly a hello world but it'll do.

#!/usr/bin/perl

use strict;
use Continuity;

use base 'Continuity::Application';

sub main {
my $self = shift; my$a = $self->getNum('Enter first number: '); my$b = $self->getNum('Enter second number: ');$self->disp("
Total of $a +$b is: " . ($a +$b) . ".
So there.
");
}

sub getNum {
my ($self,$msg) = @_;
my $f =$self->disp(qq{
$msg <input name="num"> <input type=submit value="Enter"><br> }); return$f->{'num'};
}

package main;

my $c = new Continuity( appname => 'Addnums', print_html_header => 1, print_form => 1, );$c->go();

Here we have two modules going, and in fact you may want to split this into two scripts. All this program does is prompt for a first number, then prompt for a second number, and then show the sum. Very boring, but lovely for pointing out some features. Lets go by way of execution-flow.

First, besides doing some declaration stuff, lets look at the Main package. Here we create a new Continuity object, and give it some settings. There is only one manditory parameter, appname. This corresponds to the name of our class, the one which actually holds the application. This one is named Addnums, and you can see its definition above. Addnums doesn't want to worry about printing the standard html header, nor does it want to print out the form tags, so we ask Continuity to take care of these things.

Once we have our Continuity object set up, and have named it \$c, we tell it to GO! And that it does.

2019-09-13

2019-08-25

2018-07-02

2018-06-30

2019-08-26

2019-08-25

... more changes


text:
# Basic properties of Logarithms.

Logarithms are important throughout mathematics and science.

Establishing some basic properties or relations of Logarithms helps

us for faster computation of mathematical problems.

Some of the basic properties of Logarithms and proof of them are given below, they are also called theorems of logarithm.

1>  For any positive x ,y and a:

$log_a(xy)=log_ax+log_ay$

Proof:

Suppose: $x=a^b \quad and \quad y=a^c$

then,$log_ax=b$ and $log_ay=c$

so, $xy=a^b.a^c=a^{b+c}$

thus $log_a(xy)=log_ax+log_ay$

2> For any positive a and x:

$log_ax^p=p.log_ax$

Proof:

suppose, $x=a^m$

then $log_ax=m$

and $x^p=a^{p.m}$

thus, $log_ax^p=p.log_ax$

3> For any positive x , y and a:

$log_a(x/y)=log_ax-log_ay$

proof:

$log_a(x/y) =log_ax+log_a(1/y)$
$=log_ax+log_ay^-1$
$=log_ax+log_ay.-1$
$=log_ax-log_ay$

4> For any positive a,b and x:

$log_ax=log_bx.log_ab$

Proof:

suppose , $x=b^m$

then ,$log_bx=m$

thus ,
$log_ax = log_ab^m$
$= m.log_ab$
$= log_bx.log_ab$

Related posts:

1. The Logarithmic Function. There are many ways to describe logarithmic function. One basic...


text:
# I Surface area of inner and outer halves of torus

1. Nov 6, 2017

A torus with major radius, $R$, and minor radius, $r$, has a total surface area given by $4\pi^2 Rr$. If one slices the torus on its midline (i.e. at a line on a poloidal angle of $-\pi/2$ and $\pi/2$), I was told the inner half of the torus has a smaller surface area than the outer half of the torus.

Although I am having some trouble visualizing this. If we were to simply cut the torus at one point and stretch it out, it would simply look like a cylinder, where the inner and outer halves have equal surface areas. But in this case, the curvature supposedly changes that. Any insight on why exactly the surface area changes for the inner and outer halves, and how one can quantify the change in surface area due to curvature in this case, would be greatly appreciated.

2. Nov 6, 2017

### Staff: Mentor

You can't do that while preserving areas and the overall geometry (e. g. keeping the separation between the outer and inner half on opposite sides).

3. Nov 6, 2017

It seems like this is where my misunderstanding lies. Would you happen to have a visualization or any equations describing why the areas are not preserved?

It seems fairly simply that: $A = (2\pi r)(2\pi R) = 2\pi r L$ which is the same equation as the area of a cylinder of length, $L = 2\pi R$, which you would get if the cylinder was fully cut in one toroidal cross-section and made straight. What's the error in this interpretation?

4. Nov 7, 2017

### Nidum

Last edited: Nov 7, 2017
5. Nov 7, 2017

### Staff: Mentor

Alternatively, consider the distance between the small circles on the inside and outside here:

The total area corresponds to a cylinder with 2 pi R length, but the torus doesn't consist of many small cylinders.

6. Nov 7, 2017

### mathman

To simplify the visualization, consider a cut by a plane perpendicular to the torus axis. You get two circles, one from the inner half and one from the outer half. The outer circle is longer than the inner circle. Integrate over all such plane cuts and the small circles total area is smaller than the large circles total area. These correspond to the cut you made.

7. Nov 8, 2017

### lavinia

The inner and outer circles are of different length. If you cut the torus and straightened it out into a cylinder, these two cut circles would become line segments of equal length. That means stretching/shrinking has happened.

- In four dimensions, one can make a torus where the two halves have equal area - although in four dimensions the idea of inner and outer goes away. In this case the cut torus can be straightened into a cylinder without stretching or shrinking. It is truly a geometric double cylinder. This torus has zero Gauss curvature.

Last edited: Nov 8, 2017
8. Nov 8, 2017

### Staff: Mentor

In case someone is wondering how that looks like: Imagine a long strip of paper flat on the ground. If you want to connect its ends in two dimensions, you have to stretch one side or shrink the other to make a shape like this:

In three dimensions, you can produce this without any stretching:

In 4 dimensions you can do the equivalent to the second thing with a cylinder instead of a strip of paper because the cylinder is "flat" in the fourth dimension.


text:
# Do we have infinite number of stresses at a point in a prismatic bar loaded in tenison?

Consider a prismatic bar loaded in tension as shown. I consider a point Q in the bar away from the ends. This point Q can be considered as an infinitesimally small element taken within the body.

We can consider many different elements, representing point Q, which correspond to different rotations about the axis perpendicular to the plane of the screen. On each of these elements the stresses will be different and since we can obtain infinite number of elements by rotating at different angles we can have infinite number of stresses. Since all the elements correspond to point Q does that mean there are infinite number of stresses acting at point Q?

• There is only one physical "stress" tensor. The components can be different depending on the coordinate system. The analogy is a physical vector (which has a unique magnitude and direction). However, the components of the vector will change depending on the coordinate system you use. Nov 1, 2021 at 23:23


text:
## Chapter 5 notes

Chow’s Theorem was proved by independently by Chow [Cho61] and by Tannenbaum [Tan61] in 1961; see also [Elg61].

[...]

[...]

[...]

[...]

## Chapter 5: Majority and threshold functions

This chapter is devoted to linear threshold functions, their generalization to higher degrees, and their exemplar the majority function. The study of LTFs leads naturally to the introduction of the Central Limit Theorem and Gaussian random variables — important tools in analysis of boolean functions. We will first use these tools to analyze [...]


text:
The temperature coefficient for a certain reaction is 2. If the temperature of the reaction was raised by "40 K", what is the approximate factor to which the rate is multiplied?

Apr 26, 2017

I have no idea what this is, so I googled it... The temperature coefficient on Wikipedia is defined as:

Q_(10) = ((r_2(t))/(r_1(t)))^(10^@ "C""/"(T_2 - T_1)

where ${r}_{i} \left(t\right)$ is the initial rate of reaction for the reaction at temperature ${T}_{i}$. Each temperature is in $\text{^@ "C}$ to ensure the units cancel out!

The temperature was increased by $\text{40 K}$, hence it is increased by ${40}^{\circ} \text{C}$, and we have:

$\log {Q}_{10} = \left({10}^{\circ} \text{C")/(40^@ "C}\right) \log \left(\frac{{r}_{2} \left(t\right)}{{r}_{1} \left(t\right)}\right)$

$\implies \log \left(2\right) = \frac{1}{4} \log \left(\frac{{r}_{2} \left(t\right)}{{r}_{1} \left(t\right)}\right)$

$\implies \textcolor{b l u e}{\frac{{r}_{2} \left(t\right)}{{r}_{1} \left(t\right)}} = {10}^{4 \log 2}$

$=$ $\textcolor{b l u e}{16}$

So, when the temperature coefficient is $2$, a ${40}^{\circ} \text{C}$ increase in the reaction temperature accomplishes a reaction that is 16 times faster.


text:
Could you explain the difference between STAR, KALLISTO, SALMON etc. to experimental Biologist/non-bioinformatician
3
12
Entering edit mode
20 months ago
Wox ▴ 470

Could you explain the difference between STAR, KALLISTO, SALMON etc. to experimental Biologist/non-bioinformatician.

If possible, the pros and cons of each pipeline.

Edit below

I ask this because three of my colleagues use this 3 difference tools for RNASeq. Basically to answer the same type of biological questions.

RNA-Seq alignment next-gen R assembly • 10k views
6
Entering edit mode

@Devon has about the best answer for that here: A: Alignment and mapping

STAR is an aligner. Kallisto/salmon are mapping (technically pseudo-aligners as @lieven points out) programs.

For getting a biological answer either of pipelines should be fine. Mappers will save time compared to aligners .

0
Entering edit mode

Well now I get too confused :( .

Mapping is part of the alignment. So why they created new mapping tools like Kallisto/salmon if "For getting a biological answer either of pipelines should be fine" when STAR is already available. Why use mapping, if it is included in alignment?

4
Entering edit mode

Kallisto and salmon are not really mappers in the strict sense of the word (== pseudoaligners) . While star does mapping in the old-school sense of the word (== start with a seed, find exact match and extent) the others work more like 'BAC-fingerprinting' , they create some sort of approximation of the reference and reads (eg. something like a kmer profile) and then they match the profiles rather than the actual sequences.

Speed and accuracy are the major drivers for kallisto/salmon I guess , they are for instance much better suited for isoform quantification

0
Entering edit mode

Thank you very much genomax & Lieven, This is very helpful to understand. Thank you for your time.

0
Entering edit mode

Dear All,

Thank you for your feedback. Based on your answers I decided to use "Kallisto" and have done my analysis.

How I have a confusing outcome. Out of my 5 T-DNA knockout plants, two of them are showing the expressing of the gene (even higher than the WT).

These are published lines and I have already genotyped them by PCR before.

Is this because of the pseudoaligning?

How can I check this? Is there any way of mapping?

P.S. I do not believe there is cross-contamination!

Edit: This comment is linked to this question; How to map RNASeq data to reference genome to check T-DNA insertions?

1
Entering edit mode

When things like that happen it's good to get a BAM file. My guess is that the KO is deleting a single exon and that the recycling of the resulting non-sense transcript is simply lower in some of your samples. Alternatively, if there are paralogs then perhaps they really are messing up the pseudoalignment.

2
Entering edit mode

A good start would be to do a traditional alignment and creation of a browser track to visually examine the reads on a browser such as IGV. deeptools bamCoverage can conveniently create these tracks. Often by eye you can capture what is happening more intuitively than by all these (pseudo)alignment metrics.

0
Entering edit mode

Thank you Devon Ryan & ATpoint. Does this mean I can not rely on Kallisto o/p for my downstream data analysis? Because I can not compare the mutant gene expression with this o/p...... Btw I posted same question How to map RNASeq data to reference genome to check T-DNA insertions? Sory about that.

1
Entering edit mode

Pseudoaligners are generally quite reliable, you may simply have one of the cases where they're not. That remains to be seen.

0
Entering edit mode

But how could I interpret my data if my mutant shows the highest expression than WT by pseudoaligning? Any method?

1
Entering edit mode

How was the KO done? Deleting one exon, the entire gene? That is important to know for interpretation.

1
Entering edit mode

Are you able to make the data public? It'd be much easier to figure out what's going on then.

Note that knocked out genes are often still highly expressed, they're just not translated.

0
Entering edit mode

@ATpoint, This is T-DNA insertions (in one line in Exon and other lines in Intron)

@Devon Ryan, Sorry Devon at this point I can not make data available in public.

I was more irritated because mutant gene >>> WT gene RNASeq data ...

31
Entering edit mode
20 months ago

STAR is an aligner. Its job is to work out where in the genome each sequencing read came from, and that is (primarily) what it outputs - a list of reads and their co-ordinates on the genome (in the form of a BAM file). It is very concerned about getting the the location correct at a base-by-base level.

In order to do expression analysis, you need to turn these locations into gene expression values. There are several ways to do this, but the simplest is just to count the number of reads that come from the location in the genome that overlaps with each gene (an example of a program that does this is featureCounts). The alternate method is to employ statistical models to assign reads to likely transcripts (where several transcripts might overlap on the genome). An example of a program that does this is RSEM.

Both Kallisto and Salmon are quantifiers - they take a file containing sequencing reads and output a gene expression level. Of course working out where in the transcriptome these reads come from is the first step in this process. After locating the read on they employ statistical models to turn this into transcript expression levels that take into account how certain they are about which transcript a read comes from.

It might seem that Kallisto and Salmon are doing more, so they should take longer, but this is not in fact true - it turns out they are much quicker. This generation of tools was originally based on the observation that if you are quantifying genes, you care more about the set of transcripts a read could have come from, rather than its precise location within that transcript/on the genome. They do this in different ways - Kallisto uses "pseudo-alignment" and the lastest version of Salmon uses something called "selective-alignment", which is somewhere between what STAR and Kallisto do (as I understand it), although older versions used something called quasi-alignment.

Pros and Cons:

• Kallisto and Salmon are much quicker and less memory intensive than STAR + stand-alone quantification.
• They give transcript level expression information (where as STAR + counting only give gene-level, although STAR + RSEM gives transcript).
• They gracefully deal with cases where reads map to multiple transcripts or genes.
• Normally Salmon and Kallisto only map the transcriptome (the sequence of the transcripts a cell produces) rather than the genome.
• They have a different set of false positives and negative than alignment based approaches.
• Their results are only as good as the transcript annotation that is input into them. They can't quantify genes or splice-variants that are not in their input. Differences between the real transcriptome and your annotation of the transcriptome will reduce accuracy.
• They cannot be used for finding new genes, transcripts or splice forms, or for any analysis other than quantification.
1
Entering edit mode

Thank you very much i.sudbery , This is very helpful to understand. Thank you for your time.

13
Entering edit mode
20 months ago
Rob 4.8k

STAR is a general purpose aligner. It can align reads to a genome or transcriptome, or whatever you provide. It can perform spliced alignment, and returns base-level alignments for the reads. These alignments can then be used for different purposes like being fed to transcript assembly tools, variant calling pipelines, or transcript quantification tools (e.g. you can use STAR to provide alignments to salmon).

The other tools are both transcript quantification tools. They map reads to the transcriptome and apply statistical inference to determine transcript abundances. They serve a different general purpose compared to STAR. It's worth noting that STAR has the ability to count reads mapping to different genes, and so can be used to estimate gene level abundances, but has no statistical model and so doesnt infer transcript abundance or deal with gene multimapping reads in a principled manner.

1
Entering edit mode

Thank you very much Rob , This is very helpful to understand. Thank you for your time.

5
Entering edit mode
20 months ago
Lior Pachter ▴ 540

Regarding the pros and cons of the programs, you might find this article useful: https://www.nature.com/articles/s41598-017-01617-3 It finds that kallisto and Salmon produce near identical results, and that STAR (with HTseq for producing gene counts) is less accurate (due to some of the reasons explained above). In terms of speed/memory requirements, the difference between programs is substantial. In recent benchmarking of kallisto vs. STAR on workflows for single-cell RNA-seq https://www.biorxiv.org/content/10.1101/673285v2 we found that kallisto was 2.6 times faster than STAR. More importantly, kallisto used much less memory, in some cases 15x less RAM than STAR. This makes it possible to run kallisto on a laptop rather than a server, and facilitates reproducible workflows.

2
Entering edit mode

Toda Raba Prof. Pachter :) Very kind of you.


text:
# Globular clusters as gravitational wave factories

TITLE: Dynamical Formation of the GW150914 Binary Black Hole
AUTHORS: Carl L. Rodriguez, Carl-Johan Haster, Sourav Chatterjee, Vicky Kalogera, Frederic A. Rasio
FIRST AUTHOR INSTITUTION: Center for Interdisciplinary Exploration and Research in Astrophysics, Northwestern University

The recent detection of the first gravitational wave signal (GW150914) produced by a binary black hole merger represents the dawn of a new age in astronomy. While the detection is significant in and of itself, one of the numerous questions yet to be answered is how such a binary black hole (BBH) system formed in the first place.

Previous models of BBH systems suggest that these are formed in the dense cores of globular clusters, where black holes left over from old, collapsed stars eventually become bound together through gravitational processes. After the most massive stars collapse, the resulting black holes tend to sink to the center of clusters due to their higher masses relative to other objects. This leads to a particularly high concentration of black holes near the cluster center, and also increases the rate of close gravitational encounters between these objects. BBH systems are continuously being formed and disrupted through complex interactions with other objects and systems in a globular cluster’s dense central environment, as illustrated in Fig. 1.

Fig. 1: Two possible formation histories for the GW150914 BBH system (indicated by the pair of orbiting black holes). Essentially, this is an example of the complex formation histories that BBH candidates go through within a globular cluster. Before two black holes become bound and merge together, they undergo numerous interactions with other objects (ex. stars and other black holes, indicated by the blue and red spheres).

The authors of today’s paper explore the conditions and environment required to form the system that lead to the detection of GW150914. To do this, the authors refer to their previous models of globular clusters that detail the distribution of stellar masses and number of binary systems. From these models, the authors select binary systems that have physical properties similar to that of GW150914 (ex. in mass and redshift). They find that most of these binary systems come from globular clusters of relatively low metallicities and large cluster masses. Lower metallicity stars tend to have weaker stellar winds, which means that they lose less mass over their lifetimes. These stars then tend to produce more massive black holes once they collapse at the end of their lifetimes. Additionally, more massive clusters tend to have a large number of black holes, which then increases the probability of a BBH system forming. The paper concludes that the globular cluster hosting the GW150914 progenitor system must have been a low metallicity cluster with a mass between $3 \times 10^5 and$6 \times 10^5\$ solar masses.

The masses of the BBH systems that could be detected by Advanced LIGO depends on the sensitivity of its detectors, and the distribution of these types of BBH systems in mass and redshift. Based on their models, the authors find that the median total mass of a detectable BBH during Advanced LIGO’s first observing run is 50 solar masses, which is consistent with the estimated mass of the GW150914 progenitor. While LIGO only has a single definitive BBH detection to its credit so far, future BBH merger detections from LIGO will help contrain the models and dynamical processes involves in these merger events.


text:
## The Annals of Statistics

### Estimating nonquadratic functionals of a density using Haar wavelets

#### Abstract

Z.Consider the problem of estimating $\int \Phi(f)$, where $\Phi$ is a smooth function and f is a density with given order of regularity s. Special attention is paid to the case $\Phi(t) = t^3$. It has been shown that for low values of s the $n^{-1/2}$ rate of convergence is not achievable uniformly over the class of objects of regularity s. In fact, a lower bound for this rate is $n^{-4s/(1+4s)}$ for $0 < s \leq 1/4$. As for the upper bound, using a Taylor expansion, it can be seen that it is enough to provide an estimate for the case $\Phi(x) = x^3$. That is the aim of this paper. Our method makes intensive use of special algebraic and wavelet properties of the Haar basis.

#### Article information

Source
Ann. Statist., Volume 24, Number 2 (1996), 485-507.

Dates
First available in Project Euclid: 24 September 2002

https://projecteuclid.org/euclid.aos/1032894450

Digital Object Identifier
doi:10.1214/aos/1032894450

Mathematical Reviews number (MathSciNet)
MR1394973

Zentralblatt MATH identifier
0860.62033

Subjects
Primary: G2G05 G2G20

#### Citation

Kerkyacharian, Gérard; Picard, Dominique. Estimating nonquadratic functionals of a density using Haar wavelets. Ann. Statist. 24 (1996), no. 2, 485--507. doi:10.1214/aos/1032894450. https://projecteuclid.org/euclid.aos/1032894450

#### References

• BERGH, J. and LOFSTROM, J. 1976. Interpolation Spaces: An Introduction. Springer, Berlin. ¨ ¨ Z.
• BICKEL, P. and RITOV, Y. 1988. Estimating integrated squares density derivatives: sharp best order of convergence estimates. Sankhy a Ser. A 50 381 393. Z.
• BIRGE, L. and MASSART, P. 1995. Estimation of integral functionals of a density. Ann. Statist. ´ 23 11 29. Z.
• DONOHO, D. L., JOHNSTONE, I. M., KERKy ACHARIAN, G. and PICARD, D. 1995. Wavelet shrinkage: Z. asy mptopia? with discussion. J. Roy. Statist. Soc. Ser. B 57 301 369. Z.
• DONOHO, D. and NUSSBAUM, M. 1990. Minimax quadratic estimation of a quadratic functional. J. Complexity 6 290 323.
• GOLDSTEIN, L. and MESSER, K. 1992. Optimal plug-in estimate for nonparametric functional estimation. Ann. Statist. 20 1306 1328. Z.
• HALL, P. and MARRON, S. 1987. Estimation of integrated squared density derivatives. Statist. Probab. Lett. 6 109 115.Z.
• HASMINSKII, R. and IBRAGIMOV, I. 1979. On the non parametric estimation of functionals. In Z Proceedings of the Second Prague Sy mposium in Asy mptotic Statistics P. Mandl and. M. Hushkova, eds. 41 55. North-Holland, Amsterdam. Z.
• JOHNSTONE, I., KERKy ACHARIAN, G. and PICARD, D. 1992. Estimation d'une densite de proba´ bilite par methode d'ondelettes. C. R. Acad. Sci. Paris Ser. I Math. 315 211 216. ´ ´ ´ Z.
• KERKy ACHARIAN, G. and PICARD, D. 1992a. Density estimation in Besov spaces. Statist. Probab. Lett. 13 15 24. Z.
• KERKy ACHARIAN, G. and PICARD, D. 1992b. Density estimation by kernel and wavelet method: link between kernel geometry and regularity constraints. C. R. Acad. Sci. Paris Ser. I ´ Math. 315 79 84. Z.
• KERKy ACHARIAN, G. and PICARD, D. 1993. Density estimation by kernel and wavelet methods: optimality of Besov spaces. Statist. Probab. Lett. 18 327 336. Z.
• LAURENT, B. 1996. Efficient estimation of integral functionals of a density. Ann. Statist. 24 659 681. Z.
• LEVIT, B. 1979. Asy mptotically efficient estimation of non linear functionals. Problems Inform. Transmission 14 65 72. Z.
• MEy ER, Y. 1990. Ondelettes et Operateurs I. Hermann, Paris. ´ Z.
• NEMIROVSKII, A. S. 1990. On necessary conditions for efficient estimation of functional of a non parametric signal in white noise model. Theory Probab. Appl. 35 94 103. Z.
• PEETRE, J. 1975. New Thoughts on Besov Spaces. Dept. Mathematics, Duke Univ., Durham, NC. Z.
• RITOV, Y. and BICKEL, P. 1990. Achieving information bounds in non and semi parametric models. Ann. Statist. 18 925 938.


text:
## Results (displaying matches 1-50 of 25272) Next

curve label base field conductor norm conductor label isogeny class label Weierstrass coefficients
9.1-a1 $$\Q(\sqrt{3})$$ 9 9.1 9.1-a $$\bigl[a + 1$$ , $$a - 1$$ , $$a$$ , $$25 a - 45$$ , $$72 a - 127\bigr]$$
9.1-a2 $$\Q(\sqrt{3})$$ 9 9.1 9.1-a $$\bigl[a + 1$$ , $$a - 1$$ , $$a$$ , $$25 a - 45$$ , $$-117 a + 202\bigr]$$
9.1-a3 $$\Q(\sqrt{3})$$ 9 9.1 9.1-a $$\bigl[a + 1$$ , $$a - 1$$ , $$a$$ , $$0$$ , $$0\bigr]$$
9.1-a4 $$\Q(\sqrt{3})$$ 9 9.1 9.1-a $$\bigl[a + 1$$ , $$a - 1$$ , $$1$$ , $$-7 a + 13$$ , $$6 a - 10\bigr]$$
9.1-a5 $$\Q(\sqrt{3})$$ 9 9.1 9.1-a $$\bigl[a + 1$$ , $$a - 1$$ , $$1$$ , $$88 a - 152$$ , $$564 a - 977\bigr]$$
9.1-a6 $$\Q(\sqrt{3})$$ 9 9.1 9.1-a $$\bigl[a + 1$$ , $$a - 1$$ , $$1$$ , $$88 a - 152$$ , $$-717 a + 1242\bigr]$$
16.1-a1 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[0$$ , $$-a$$ , $$0$$ , $$1$$ , $$-3 a - 5\bigr]$$
16.1-a2 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[0$$ , $$a$$ , $$0$$ , $$1$$ , $$3 a + 5\bigr]$$
16.1-a3 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[a + 1$$ , $$-a - 1$$ , $$a + 1$$ , $$4 a - 13$$ , $$11 a - 21\bigr]$$
16.1-a4 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[a + 1$$ , $$-1$$ , $$a + 1$$ , $$4 a - 13$$ , $$-12 a + 19\bigr]$$
16.1-a5 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[a + 1$$ , $$-a - 1$$ , $$a + 1$$ , $$-a - 3$$ , $$-1\bigr]$$
16.1-a6 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[a + 1$$ , $$-1$$ , $$a + 1$$ , $$-a - 3$$ , $$-a - 1\bigr]$$
16.1-a7 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[a + 1$$ , $$-1$$ , $$a + 1$$ , $$-6 a - 13$$ , $$-12 a - 21\bigr]$$
16.1-a8 $$\Q(\sqrt{3})$$ 16 16.1 16.1-a $$\bigl[a + 1$$ , $$-a - 1$$ , $$a + 1$$ , $$-6 a - 13$$ , $$11 a + 19\bigr]$$
22.1-a1 $$\Q(\sqrt{3})$$ 22 22.1 22.1-a $$\bigl[1$$ , $$a$$ , $$a + 1$$ , $$14261 a - 24701$$ , $$-1229141 a + 2128933\bigr]$$
22.1-a2 $$\Q(\sqrt{3})$$ 22 22.1 22.1-a $$\bigl[1$$ , $$a$$ , $$a + 1$$ , $$-23694 a + 41039$$ , $$-5992615 a + 10379512\bigr]$$
22.1-a3 $$\Q(\sqrt{3})$$ 22 22.1 22.1-a $$\bigl[a$$ , $$-a + 1$$ , $$a$$ , $$18 a - 33$$ , $$83 a - 145\bigr]$$
22.1-a4 $$\Q(\sqrt{3})$$ 22 22.1 22.1-a $$\bigl[a$$ , $$-a + 1$$ , $$a$$ , $$-2 a + 2$$ , $$-a + 1\bigr]$$
22.1-b1 $$\Q(\sqrt{3})$$ 22 22.1 22.1-b $$\bigl[a$$ , $$-a - 1$$ , $$a + 1$$ , $$14261 a - 24702$$ , $$1229140 a - 2128935\bigr]$$
22.1-b2 $$\Q(\sqrt{3})$$ 22 22.1 22.1-b $$\bigl[a$$ , $$-a - 1$$ , $$a + 1$$ , $$-23694 a + 41038$$ , $$5992614 a - 10379514\bigr]$$
22.1-b3 $$\Q(\sqrt{3})$$ 22 22.1 22.1-b $$\bigl[1$$ , $$a + 1$$ , $$0$$ , $$20 a - 32$$ , $$-64 a + 112\bigr]$$
22.1-b4 $$\Q(\sqrt{3})$$ 22 22.1 22.1-b $$\bigl[1$$ , $$a + 1$$ , $$0$$ , $$3$$ , $$1\bigr]$$
22.2-a1 $$\Q(\sqrt{3})$$ 22 22.2 22.2-a $$\bigl[1$$ , $$0$$ , $$1$$ , $$1813 a - 3142$$ , $$-55168 a + 95554\bigr]$$
22.2-a2 $$\Q(\sqrt{3})$$ 22 22.2 22.2-a $$\bigl[a$$ , $$a + 1$$ , $$a$$ , $$-18 a - 33$$ , $$-83 a - 145\bigr]$$
22.2-a3 $$\Q(\sqrt{3})$$ 22 22.2 22.2-a $$\bigl[1$$ , $$0$$ , $$1$$ , $$1688 a - 2922$$ , $$-63194 a + 109458\bigr]$$
22.2-a4 $$\Q(\sqrt{3})$$ 22 22.2 22.2-a $$\bigl[a$$ , $$a + 1$$ , $$a$$ , $$2 a + 2$$ , $$a + 1\bigr]$$
22.2-b1 $$\Q(\sqrt{3})$$ 22 22.2 22.2-b $$\bigl[a$$ , $$-1$$ , $$a$$ , $$1813 a - 3143$$ , $$55168 a - 95555\bigr]$$
22.2-b2 $$\Q(\sqrt{3})$$ 22 22.2 22.2-b $$\bigl[1$$ , $$-a + 1$$ , $$0$$ , $$-20 a - 32$$ , $$64 a + 112\bigr]$$
22.2-b3 $$\Q(\sqrt{3})$$ 22 22.2 22.2-b $$\bigl[a$$ , $$-1$$ , $$a$$ , $$1688 a - 2923$$ , $$63194 a - 109459\bigr]$$
22.2-b4 $$\Q(\sqrt{3})$$ 22 22.2 22.2-b $$\bigl[1$$ , $$-a + 1$$ , $$0$$ , $$3$$ , $$1\bigr]$$
24.1-a1 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[a + 1$$ , $$1$$ , $$0$$ , $$1035 a - 1791$$ , $$-23450 a + 40617\bigr]$$
24.1-a2 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[a + 1$$ , $$1$$ , $$0$$ , $$-15 a + 29$$ , $$322 a - 557\bigr]$$
24.1-a3 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[0$$ , $$a - 1$$ , $$0$$ , $$-38 a + 66$$ , $$-168 a + 291\bigr]$$
24.1-a4 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[a + 1$$ , $$1$$ , $$0$$ , $$5 a - 6$$ , $$-3 a + 6\bigr]$$
24.1-a5 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[a + 1$$ , $$1$$ , $$0$$ , $$25 a - 41$$ , $$92 a - 159\bigr]$$
24.1-a6 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[a + 1$$ , $$1$$ , $$0$$ , $$65 a - 111$$ , $$-348 a + 603\bigr]$$
24.1-a7 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[a + 1$$ , $$1$$ , $$0$$ , $$385 a - 671$$ , $$5582 a - 9681\bigr]$$
24.1-a8 $$\Q(\sqrt{3})$$ 24 24.1 24.1-a $$\bigl[a + 1$$ , $$1$$ , $$0$$ , $$55 a - 111$$ , $$-406 a + 717\bigr]$$
24.1-b1 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[a + 1$$ , $$-a$$ , $$a + 1$$ , $$1033 a - 1794$$ , $$24484 a - 42410\bigr]$$
24.1-b2 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[a + 1$$ , $$-a$$ , $$a + 1$$ , $$-17 a + 26$$ , $$-338 a + 584\bigr]$$
24.1-b3 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[0$$ , $$-a + 1$$ , $$0$$ , $$-38 a + 66$$ , $$168 a - 291\bigr]$$
24.1-b4 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[a + 1$$ , $$-a$$ , $$a + 1$$ , $$3 a - 9$$ , $$7 a - 14\bigr]$$
24.1-b5 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[a + 1$$ , $$-a$$ , $$a + 1$$ , $$23 a - 44$$ , $$-68 a + 116\bigr]$$
24.1-b6 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[a + 1$$ , $$-a$$ , $$a + 1$$ , $$63 a - 114$$ , $$412 a - 716\bigr]$$
24.1-b7 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[a + 1$$ , $$-a$$ , $$a + 1$$ , $$383 a - 674$$ , $$-5198 a + 9008\bigr]$$
24.1-b8 $$\Q(\sqrt{3})$$ 24 24.1 24.1-b $$\bigl[a + 1$$ , $$-a$$ , $$a + 1$$ , $$53 a - 114$$ , $$460 a - 830\bigr]$$
33.1-a1 $$\Q(\sqrt{3})$$ 33 33.1 33.1-a $$\bigl[a + 1$$ , $$a + 1$$ , $$a$$ , $$22986 a - 39809$$ , $$-2497992 a + 4326651\bigr]$$
33.1-a2 $$\Q(\sqrt{3})$$ 33 33.1 33.1-a $$\bigl[a + 1$$ , $$1$$ , $$1$$ , $$6 a - 8$$ , $$12 a - 19\bigr]$$
33.1-a3 $$\Q(\sqrt{3})$$ 33 33.1 33.1-a $$\bigl[a + 1$$ , $$-a + 1$$ , $$a$$ , $$15 a - 28$$ , $$96 a - 167\bigr]$$
33.1-a4 $$\Q(\sqrt{3})$$ 33 33.1 33.1-a $$\bigl[a + 1$$ , $$1$$ , $$1$$ , $$57891 a - 100269$$ , $$-25338895 a + 43888254\bigr]$$

Next


text:
# [Numpy-discussion] Toward release 1.0 of NumPy

Charles R Harris charlesr.harris at gmail.com
Thu Apr 13 17:14:32 CDT 2006

On 4/13/06, Tim Hochberg <tim.hochberg at cox.net> wrote:
>
> Charles R Harris wrote:
>
> >
> >
> > On 4/13/06, *Tim Hochberg* <tim.hochberg at cox.net
> > <mailto:tim.hochberg at cox.net>> wrote:
> >
> >     Charles R Harris wrote:
> >
> >     > Tim,
> >     >
> >     > On 4/13/06, *Tim Hochberg* <tim.hochberg at cox.net
> >     <mailto:tim.hochberg at cox.net>
> >     > <mailto:tim.hochberg at cox.net <mailto:tim.hochberg at cox.net>>>
> wrote:
> >     >
> >     >     Alan G Isaac wrote:
> >     >
> >     >     >On Thu, 13 Apr 2006, Charles R Harris apparently wrote:
> >     >     >
> >     >     >
> >     >     >>The Kronecker product (aka Tensor product) of two
> >     >     >>matrices isn't a matrix.
> >     >     >>
> >     >     >>
> >     >     >
> >     >     >That is an unusual way to describe things in
> >     >     >the world of econometrics.  Here is a more
> >     >     >common way:
> >     >     >http://planetmath.org/encyclopedia/KroneckerProduct.html
> >     >     < http://planetmath.org/encyclopedia/KroneckerProduct.html>
> >     >     >I share Sven's expectation.
> >     >     >
> >     >     >
> >     >     mathworld also agrees with you. As does the documentation
> >     (as best
> >     >     as I
> >     >     can tell) and the actual output of kron. I think Charles must
> be
> >     >     thinking of the tensor product instead.
> >     >
> >     >
> >     > It *is* the tensor product, A \tensor B, but it is not the most
> >     > general tensor with four indices just as a bivector is not the
> most
> >     > general tensor with two indices. Numerically, kron chooses to
> >     > represent the tensor product of two vector spaces a, b with
> >     dimensions
> >     > n,m respectively as the direct sum of n copies of b, and
> the  tensor
> >     > product of two operators takes the given form. More generally, the
> B
> >     > matrix in each spot could be replaced with an arbitrary matrix
> >     of the
> >     > correct dimensions and you would recover the general tensor with
> >     four
> >     > indices.
> >     >
> >     > Anyway, it sounds like you are proposing that the tensor (outer)
> >     > product of two matrices be reshaped to run over two indices. It
> >     seems
> >     > that likewise the tensor (outer) product of two vectors should be
> >     > reshaped to run over one index ( i.e. flat). That would do the
> >     trick.
> >
> >     I'm not proposing anything. I don't care at all what kron does. I
> >     just
> >     want to fix the return type if that's feasible so that people stop
> >     complaining about it. As far as I can tell, kron already returns a
> >     flattened tensor product of some sort. I believe the general tensor
> >     product that you are talking about is already covered by
> >     multiply.outer,
> >     but I'm not sure so correct me if I'm wrong. Here's what kron does
> as
> >     present:
> >
> >     >>> a
> >     array([[1, 1],
> >            [1, 1]])
> >     >>> kron(a,a) # => 4x4 matrix
> >     array([[1, 1, 1, 1],
> >            [1, 1, 1, 1],
> >            [1, 1, 1, 1],
> >            [1, 1, 1, 1]])
> >
> >
> > Good at first look. Lets see a simpler version... Nevermind, seems
> > numpy isn't working on this machine (X86_64, fc5 64 bit) at the
> > moment, maybe I need to check out a clean version.
> >
> >     >>> kron(a,a[0]) => 8x1
> >     array([1, 1, 1, 1, 1, 1, 1, 1])
> >
> >
> > Looks broken. a[0] should be an operator (matrix), so either it should
> > be (2,1) or (1,2).
>
> Since a is an array here, a[0] is shape (2,). Let's repeat this
> excercise using matrices, which are always rank-2 and see if they make
> sense.
>
> >>> m
> matrix([[1, 1],
>        [1, 1]])
> >>> kron(m, m[0])
> matrix([[1, 1, 1, 1],
>        [1, 1, 1, 1]])
> >>> kron(m,m[:,0])
> matrix([[1, 1],
>        [1, 1],
>        [1, 1],
>        [1, 1]])
>
> That looks OK.
>
> > In the first case, the return should have shape (4,2), in the latter
> > (2,4). Should probably raise an error as the result strikes me as
> > ambiguous. But I have to admit I am not sure what the point of this
> > particular construction is.
> >
> >     >>> kron(a[0], a[0])
> >     Traceback (most recent call last):
> >       File "<stdin>", line 1, in ?
> >       File "C:\Python24\Lib\site-packages\numpy\lib\shape_base.py", line
> >     577, in kron
> >         result = concatenate(concatenate(o, axis=1), axis=1)
> >     ValueError: 0-d arrays can't be concatenated
> >
> >
> >>> kron(m[0], m[0])
> matrix([[1, 1, 1, 1]])
> >>> kron(m[:,0], m[:,0])
> matrix([[1],
>        [1],
>        [1],
>        [1]])
> >>> kron(m[:,0],m[0])
> matrix([[1, 1],
>        [1, 1]])
>
> > See above. this could be (1,4) or (4,1), depending.
>
> All of these look like they're probably right without thinking about it
> too hard.
>
> >
> >     >>>  b.shape
> >     (2, 2, 2)
> >     >>> kron(b,b).shape
> >     (4, 4, 2, 2)
> >
> >
> > I think this is doing transpose(outer(b,b), axis=(0,2,1,3)) and
> > reshaping the first 4 indices into 2. Again, I am not sure what the
> > point is for these operators. Now another way to get all this
> > functionality is to have a contraction function or method with a list
> > of axis. For instance, consider the matrices A(i,j) and B(k,l)
> > operating on x(j) and y(l) like A(i,j)x(j) and B(k,l)y(l), then the
> > outer product of all of these is
> >
> > A(i,j)B(k,l)x(j)y(l)
> >
> > with the summation convention on the indices j and l. The result
> > should be the same as kron(A,B)*kron(x,y) up to a permutation of rows
> > and columes. It is just a question of which basis is used and how the
> > elements are indexed.
> >
> >     So, it looks like the 2d x 2d product obeys Alan's definition. The
> >     other
> >     products are probably all broken.
> >
> Here's my best guess as to what is going on:
>     1. There is a relatively large group of people who use Kronecker
> product as Alan does (probably the matrix as opposed to tensor math
> folks). I'm guessing it's a large group since they manage to write the
> definitions at both mathworld and planetmath.
>     2. kron was meant to implement this.
>     2.5 People who need the other meaning of kron can just use outer, so
> no real conflict.
>     3. The implementation was either inappropriately generalized or it
> was assumed that all inputs would be matrices (and hence rank-2).

Uh-huh.

Assuming 3. is correct, and I'd like to hear from people if they think
> that the behaviour in the non rank-2 cases is sensible, the next
> question is whether the behaviour in the rank-2 cases makes sense. It
> seem to, but I'm not a user of kron. If both of the preceeding are true,
> it seems like a complete fix entails the following two things:
>     1. Forbid arguments that are not rank-2. This allows all matrices,
> which is really the main target here I think.
>     2. Fix the return type issue. I have a fix for this ready to commit,
> but I want to figure out the first part as well.

I think it was inappropriately generalized, it is hard to make sense of what
kron means for rank > 2. So I vote for restricting the usage to matrices, or
arrays of rank two. This avoids the both the ambiguity of rank one arrays
and big why that arises for arrays with rank > 2. Note that in tensor
algebra the rank 1 problem is solved by the use of upper or lower indices,
lower index => [1,n], upper index => [n,1].

Hmm, I should to check that kron is associative: kron(kron(a,b),c) ==
kron(a, kron(b,c)) like a good tensor product should be. I suspect it is.

Regards,
>
> -tim

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060413/25f1192f/attachment-0001.html


text:
# Dames, do some math!

The order of operations, PEMDAS, is a basic rule in mathematics telling us which order operations should be performed:

"Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction"

The problem is, PEMDAS is not very versatile! What if you wanted to do it in another order? We won't mess with the parentheses, so we keep them where they are (first).

Create a program that takes two arguments:

• A string, telling which order the operations should follow. Some examples are "DAMES", "SAD, ME", "ME SAD", "MEADS". Yes, spaces and commas are OK, as it makes the order easier to remember.
• Following suggestions in chat: Supporting spaces and commas is now optional.
• If one of the letters is missing, or if there are additional letters that shouldn't be there, you can consider the input invalid and treat it however you like.
• A string, or an expression containing the expression that should be evaluated.

Return the result of the expression as either a decimal number, or an integer. If the answer is not an integer, it has to be returned as a decimal number.

Rules:

• It's OK to combine the two input arguments into one, if that's easier in your language.
• It doesn't have to be a string, but it has to have letters. You can't substitute Addition with 1, Division with 2, etc.
• You can choose which input is first.
• The expression is evaluated right to left left to right. (Change of rule. Any submissions poster the first 12 hours that have this the other way around are accepted).
• The operations use the symbols: ( ) ^ * / + -. For instance, you can't use ¤ instead of + for addition.
• Spaces in the input expression is not valid as input
• Unary +/- is not valid as input if it directly follows + or -. Consider 3+-2 as invalid input. It can be treated however you like (doesn't have to produce an error). If + or - follows any other operator than plus or minus, it's treated the usual way: 3*-3 = -9, sin(-2)=-0.909
• The program must strictly follow the letters, so "EMDAS", 1-3+4 => -6, and "EMDSA", 1-3+4 => 2.

Examples:

Input:   "EMDAS", "3+6*2/4-1"   // -> 3+12/4-1 -> 3+3-1 -> 6-1 -> 5
Output:  5

Input:   "DAMES", "3+6*2/4-1"   // -> 3+6*0.5-1 -> 9*0.5-1 -> 4.5-1 -> 3.5
Output:  3.5

Input:   "SAD, ME", "3+6*2/4-1"  // -> 3+6*2/3 -> 9*2/3 -> 9*0.66667 -> 6
Output:  6

Input:   "ME ADS", "3+5^4/2-3*2 // -> 3+5^4/2-6 -> 3+625/2-6 -> 628/2-6 -> 314-6 -> 308
Output:  308

Input:   "AM EDS", "4*3-sin(0.5^2)*3+1" // -> 4*3-sin(0.5^2)*4 -> 12-sin(0.5^2)*4 -> 4*3-(4*sin(0.5^2)) -> 12-(4*sin(0.5^2)) -> 12-(4*sin(0.25)) -> 12-(4*0.24740) -> 12-0.98961 -> 11.01038
Output:  11.01038

Input:   "DAMES", "4-5-6"   // -> (4-5)-6 -> = -7
Output:  -7                  // NOT: -> 4-(5-6) -> 4-(-1) -> 5

Note, the parentheses where added to show that the multiplication 4*sin(0.5^2) is evaluated before the exponentiation.

This is code golf, so the shortest code in bytes win.

• It's not exactly the same at all but this challenge is about changing to another order of operations and was the inspiration that made me like the idea of doing something similar. I think the Haskell answer could be re-worked to answer this question perhaps... Not sure if a strict duplicate, I quite like the idea of doing this challenge without the native ability to change the operators directly! – Dom Hastings Oct 22 '15 at 13:14
• Bonus for functions removed, but there is still sin() in the examples. – edc65 Oct 22 '15 at 18:01
• Somewhat more evil than the aforementioned challenge, and I'm not going to contest it as duplicate (though a link to the original would have been appreciated). However, it is plain for everyone to see the evil director of The 2560 is none other than @Stewie Griffin. I have to say, I'm not surprised. – JArkinstall Oct 22 '15 at 18:25
• In the UK we are often taught it as BODMAS or BIDMAS at school. B = Brackets, O or I = Order or Indices. – BadHorsie Oct 23 '15 at 11:45
• Is p needed? It isn't in the examples – ev3commander Oct 23 '15 at 19:10

# JavaScript (ES6) 349 353 387 400

... maybe still golfable

This old parser of mine sometimes comes in handy - (already used in other 2 challenges)

E=
(d,x,W=[],Q=['_'],h={'(':1,_:8,')':7},z=1,C=n=>{for(;h[q=Q.pop()]<=h[n];W.push(q=='^'?Math.pow(a,b):eval(a${q}b)))a=W.pop(b=W.pop());Q.push(q,n)})=>([...d].map(l=>h[l='+-/*^'['ASDME'.search(l)]]=(d+=!!l),d=1),(x+')').replace(/\D|\d+/g,t=>(u=~~h[t])-1?u-7?u?z&&t=='-'?z=-z:C(t,z=1):(W.push(z*t),z=0):Q.pop(Q.pop(C(t),z=0)):z=!!Q.push('_')),W.pop()) // TEST console.log=(...x)=>O.innerHTML+=x.join +'\n' console.log(E('MDASE','3+4*5^2')) console.log(E("EMDAS", "3+6*2/4-1")) // 5 console.log(E("DAMES", "3+6*2/4-1")) //3.5 console.log(E("SAD, ME", "3+6*2/4-1")) // 6 console.log(E("ME ADS", "3+5^4/2-3*2")) // 308 console.log(E("AM EDS", "4*3-sin(0.5^2)*3+1")) // 11.01038 sin not supported console.log(E("DAMES", "4-5-6")) // -7 // MORE READABLE U=(d,x,W=[],Q=['_'],h={'(':1,_:8,')':7},z=1, C=n=>{ for(;h[q=Q.pop()]<=h[n]; W.push(q=='^'?Math.pow(a,b):eval(a${q}b)))
a=W.pop(b=W.pop());
Q.push(q,n)
}
)=>(
[...d].map(l=>h[l='+-/*^'['ASDME'.search(l)]]=(d+=!!l),d=1),
(x+')').replace(/\D|\d+/g,t=>
(u=~~h[t])-1
?u-7
?u
?z&&t=='-'?z=-z:C(t,z=1)
:(W.push(z*t),z=0)
:Q.pop(Q.pop(C(t),z=0))
:(Q.push('_'),z=1)
),
W.pop()
)

Ungolfed

Evaluate=(oprec,expr)=>
{
var tokens = expr.match(/\D|\d+/g).concat(')')
var t,a,b,v, SignV
var vstack=[]
var ostack=['_']
var op={ '(':8, _: 1, ')':2}
oprec.match(/\w/g).map((l,p)=>op['+-/*^'['ASDME'.search(l)]]=7-p)
var OPush=o=>ostack.push(o)
var OPop=_=>ostack.pop()
var VPush=v=>vstack.push(v)
var VPop=v=>vstack.pop()

var Scan=i=>
{
SignV = 1
for (; t=tokens[i++]; )
{
if (t == '(')
{
OPush('_')
SignV = 1
}
else if (t == ')')
{
CalcOp(t);
OPop();
OPop();
SignV = 0
}
else if (op[t])
{
if (SignV && t=='-')
SignV = -SignV
else
CalcOp(t), SignV = 1
}
else
{
VPush(SignV*t)
SignV=0
}
}
}
var CalcOp=nop=>
{
for (; op[po = OPop()] >= op[nop];)
b=VPop(), a=VPop(), CalcV(a,b,po);
OPush(po), OPush(nop);
}
var CalcV=(a,b,o)=>
{
//    console.log('CV',a,b,o)
if (o=='+')
a+=b
if (o=='-')
a-=b
if (o=='*')
a*=b
if (o=='/')
a/=b
if (o=='^')
a=Math.pow(a,b)
VPush(a)
}
Scan(0)

return VPop()
}

console.log=(...x)=>O.innerHTML+=x.join +'\n'

console.log(Evaluate('MDASE','3+4*5^2'))
console.log(Evaluate('EMDAS','3+6*2/4-1')) // 5
console.log(Evaluate("DAMES", "3+6*2/4-1")) //3.5
console.log(Evaluate("AM EDS", "4*3-sin(0.5^2)*3+1")) // 11.01038 sin not supported
console.log(Evaluate("DAMES", "4-5-6")) // -7

• I think you can remove the space in (t=>t=='('?(z=1, Q.push('_')), along with all the newlines. – Conor O'Brien Oct 23 '15 at 11:14
• @CᴏɴᴏʀO'Bʀɪᴇɴ working on it. Thanks – edc65 Oct 23 '15 at 16:57
• I think you can change the Math.pow(a,b) to a**b – Cows quack Feb 5 '17 at 13:15
• @KritixiLithos yes but it would not be ES6 anymore – edc65 Feb 5 '17 at 16:11

# R 3.3.2: 209196187 177 bytes

The idea is to "misuse" the non-arithmetic operators <, &, |, ~, ? where we know the precedence (see ?Syntax in R - but before the override ;)) and overriding them with the given arithmetic operators. The mapping is according to the desired order of operations.

Spaces and commas in the input are not supported.

Golfed version

f=function(a,b){s=substr;l=list(E='^',M='*',D='/',A='+',S='-');q="<&|~?";for(i in 1:5){x=s(q,i,i);y=l[[s(a,i,i)]];assign(x,.Primitive(y));b=gsub(y,x,b,,,T)};eval(parse(text=b))}

Ungolfed and commented:

f = function(a,b) {
s = substr
# All arithmetic operators
l = list(E = '^', M = '*', D = '/', A = '+', S = '-')
# Some non-arithmetic R operators in descending precedence
q = "<&|~?"
for (i in 1:5) {
# The substituted symbol
x = s(q, i, i)
# The original operator which has to be substituted
y = l[[s(a, i, i)]]
# Substitute the operator for the R interpreter
assign(x, .Primitive(y))
# Substitute the operator in the input string
b = gsub(y, x, b, , , T)
}
# Parse and evaluate
eval(parse(text = b))
}

Examples:

> f("EMDAS", "3+6*2/4-1")
[1] 5
> f("DAMES", "3+6*2/4-1")
[1] 3.5
[1] 6
[1] 308
> f("AMEDS", "4*3-sin(0.5^2)*3+1")
[1] 11.01038
> f("DAMES", "4-5-6")
[1] -7


text:
# Introduction to Jupyter notebooks¶

###### COMP4670/8600 - Introduction to Statistical Machine Learning - Tutorial 1A¶

The first tutorial will introduce the basic elements for writing Python programs, and using Jupyter notebooks. All tutorials and assignments will be done using this format.

Due to the wide variety of backgrounds that students may have, it is worth recalling some mathematics and statistics that we build upon in this course.

## Basic knowledge¶

IMPORTANT: When using mathematical formulas, provide the precise name for each component.

$\newcommand{\RR}{\mathbb{R}}$

### Random variables¶

Write down the definitions of the following entities, and provide a simple example to illustrate.

1. The expectation of a function $f$ with respect to a
• continuous random variable $X$
• discrete random variable $X$
2. The variance of a random variable $X$.
3. Independence of two random variables $X$ and $Y$

### Discrete probabilities¶

For discrete random variables $X$ and $Y$, define the following, and show an example of how it applies to the example below.

$p(\mathbf{X},\mathbf{Y})$ X=a X=b X=c X=d X=e
Y = red 0.2 0.1 0.1 0.01 0.04
Y = green 0.08 0.07 0.01 0.05 0.05
Y = blue 0.01 0.01 0.07 0.05 0.15
1. The sum rule of probability theory
2. The product rule of probability theory
3. Independence of two random variables $X$ and $Y$

### Linear algebra¶

Write down the definitions, being careful to specify conditions (if needed) when they exist.

1. The eigenvector decomposition of a matrix $C$.
2. The solution of a linear system of equations $Ax=b$.

### Calculus¶

Compute the gradient of the following function $f:\RR\to\RR$ $$f(x) = \frac{1}{1 + \exp(x^2)}$$ What would the gradient be if $x$ was two dimensional (that is $f:\RR^2\to\RR$), and we let $x^2$ be the squared Euclidean norm, $\|x\|^2$?

## Python and Programming for Machine Learning¶

If you already know Python and Jupyter notebooks well, please work on Tutorial 1B "Linear Algebra and Optimisation".

The introduction will focus on the concepts necessary for writing small programs in Python for the purpose of Machine Learning. That means, we expect a user of the code will be a reasonable knowledgeable person. Therefore, we can skip most of the code a robust system would have to contain in order to check the input types, verify the input parameter ranges, and make sure that really nothing can go wrong when somebody else is using the code. Having said this, you are nevertheless encouraged to include some sanity tests into your code to avoid making simple errors which can cost you a lot of time to find. Some of the Python concepts discussed in the tutorial will be

• Data types (bool, int, float, str, list, tuple, set, dict)
• Operators
• Data flow
• Functions
• Classes and objects
• Modules and how to use them

We will be using Python3 in this course.

Some resources:

## Installation¶

The easiest way to get a working Python environment is using one of the following collections:

It is also not too difficult to install python using your favourite package manager and then use conda or pip to manage python packages.

## Jupyter Notebooks¶

To work on a worksheet or assignment, download the notebook and edit it locally.

Jupyter notebooks provide a convenient browser based environment for data analysis in a literate programming environment. The descriptive parts of the notebook implements an enhanced version of markdown, which allows the use of LaTeX for rendering equations.

1. Descriptive notes
• Markdown
• LaTeX
2. Computational code
• numerical python
• numpy
• scipy
• matplotlib

To use a notebook locally:

jupyter notebook name_of_file.ipynb

# Markdown and LaTeX¶

In addition to lists and links which are already shown above, tables are also nice and easy

Title Middle Left aligned Right aligned
Monday 10:00 Sunny 30
Thursday 12:32 Rain 22.3

It is also easy to typeset good looking equations inline, such as $f(x) = x^2$, or on a line by itself. $$g(x) = \sum_{i=1}^n \frac{\prod_{j=1}^d y_j \sqrt{3x_i^4}}{f(x_i)}$$ If you use a symbol often, you can define it at the top of a document as follows (look at source), and use it in equations.

$\newcommand{\amazing}{\sqrt{3x_i^4}}$

$$h(x) = \sum_{i=1}^n \amazing$$

## Computational code¶

Setting up python environment (do not use pylab)

In [ ]:
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp

%matplotlib inline

Some resources:


text:
# Paper published on evolution of grain boundary character distribution during grain growth

A new paper, titled "Influence of anisotropic grain boundary properties on the evolution of grain boundary character distribution during grain growth - A 2D level set study", was recently published in Modelling and Simulation in Materials Science and Engineering and can be found at the publisher's site following this link or here.

# New paper on GPU-accelerated crystal plasticity simulations

A new paper, titled "Accelerating crystal plasticity simulations using GPU multiprocessors", was recently published in International Journal for Numerical Methods in Engineering and can be found at the publisher's site following this link or here.

# Production of very fine grained materials

Since recrystallization is driven by reduction of stored energy, the amount of cold work influences the grain size evolution. Materials with grain sizes down to the nanometer scale can be obtained by exposing the material to severe plastic deformation (SPD). Such SPD processes include Equal Channel Angular Pressing/Extrusion (ECAP/ECAE), Asymmetric Rolling (ASR), Multi-Directional Forging (MDF), High-Pressure Torsion (HPT) and Twist Extrusion (TE). Some of these processes are discussed further below.

During ECAP, studied in Hallberg et al. (2010), the material specimen is pressed through a channel die as illustrated below.

The amount of effective plastic deformation, denoted by $\displaystyle \varepsilon_{\mathrm{eff}}^{\mathrm{p}}$, that is imposed onto the specimen in each pass can be estimated from knowledge of the die geometry according to

$\displaystyle \varepsilon_{\mathrm{eff}}^{\mathrm{p}}=\frac{N_{\mathrm{pass}}}{\sqrt{3}}\left[2\mathrm{cot}\left(\frac{\Phi}{2}+\frac{\Psi}{2}\right)+\Psi\mathrm{cosec}\left(\frac{\Phi}{2}+\frac{\Psi}{2}\right)\right]$

Varying the channel geometry thus allows control of the amount of plastic deformation that is exerted onto the specimen in each pass through the die. If the specimen is rotated between each pass through the die, different standardized processing routes can be obtained.

Another SPD process is asymmetric rolling, discussed in Hallberg (2013), where a conventional rolling process can be made asymmetric by different methods.

The asymmetry of the process can be induced by having different radii $r$ of the rolls, by different roller velocities, i.e. $\omega_{1}\ne\omega_{2}$ or by different friction/lubrication conditions at each side of the sheet. The asymmetry increases the shear deformation of the rolled sheet and hence the total amount of effective plastic deformation.

# Metal forming and materials processing

Beside casting and machining, forming is one of the main processes for manufacturing of components from metallic materials. Forming processes include sheet metal forming as well as bulk metal forging. Metal forming generally involves significant plastic deformations, elevated temperatures, high deformation velocities and an increased risk for initiation of cracks in the material. These macroscopic process conditions are intimately connected to the microstructure evolution inside the material.

In Hallberg et al. (2007) and Hallberg et al. (2010), deep-drawing of stainless steel is used as application examples for constitutive models where martensitic phase transformation is considered, see the illustration below. As the martensite phase is much harder than the parent austenitic phase, the material properties may change dramatically in the presence of this kind of diffusionless - and thus rapid - phase transformation.

The influence of deformation rate and material pre-processing in metal forging is studied in Hallberg et al. 2009. Different behavior of a 100Cr6 steel, due to previous tempering or annealing, was studied in high strain rate axisymmetric compression, experimentally as well as through numerical simulations.

The illustration below is taken from Hallberg et al. 2009. Note the development of a "shear cross" (white lines) in the tempered - and much harder - material. This localized deformation is absent in the annealed specimen.

Another example of metal forming is rolling, for example discussed in Hallberg (2013). A conventional rolling process can be made asymmetric by different methods in order to increase the deformation imposed onto the sheet.

The asymmetry of the process can be induced by having different radii $r$ of the rolls, by different roller velocities, i.e. $\omega_{1}\ne\omega_{2}$ or by different friction/lubrication conditions at each side of the sheet. The asymmetry increases the shear deformation of the rolled sheet and hence the total amount of effective plastic deformation. This is utilized in severe plastic deformation (SPD) processes for production of very fine-grained metals.

# Dislocation and grain boundary interaction

Mesoscale models of microstructure evolution allow studying of heterogeneous dislocation density distributions and related gradient effects. This is closely connected to the well-renowned Hall-Petch effect, stating a proportionality between the yield stress $\sigma_{\mathrm{y}}$ and the inverse of the square-root of the average grain size $d$ according to

$\sigma_{\mathrm{y}}\propto\frac{1}{\sqrt{d}}$

The interaction between dislocation motion and grain boundaries can be modeled by different approaches. Some examples are given below.

In Hallberg and Ristinmaa (2013) (also discussed in this conference presentation), a hybrid finite difference/cellular automaton model is established where dislocation density gradient are modeled in a reaction-diffusion system. This approach results in the expected Hall-Petch behavior of the macroscopic flow stress – without including an explicit dependence on the grain size – in addition to providing a physically sound dislocation density distribution, indicated in the figure below.

By this modeling approach, the dislocation density will be concentrated at grain boundaries and particularly at triple junctions, directly providing the sites for nucleation of recrystallization. This is in contrast to the common modeling approach where nuclei are placed manually at appropriate sites in the microstructure.

Another approach to modeling of dislocation and grain boundary interaction is taken in Hallberg (2013) where a level set formulation is used to model polycrystal grain structures.

# Grain boundaries

Many important aspects of the macroscopic material behavior in metals are controlled by the microlevel grain structure. Strength and ductility depends largely on the size and distribution of the grains. Especially the presence of grain boundaries plays an important role, not least in the macroscopic deformation hardening of the material. Grain boundaries pose obstacles to slip deformation by preventing dislocation motion, resulting in localized dislocation storage and heterogeneous deformation fields within the grains. This is closely related to the classical Hall-Petch relation, where the macroscopic flow stress is porportional to the inverse of the square root of the average grain size. More fine-grained materials will thus exhibit a higher flow stress than more coarse-grained materials.

The Hall-Petch effect will, however, tend to reverse as very small grains are considered. At a grain sizes of approximately 10 nm or below, other mechanisms such as grain boundary sliding usually cause a softening effect instead of the common Hall-Petch hardening.

Grain boundaries also contribute to the material behavior in many other aspects. They are often sites for initiation of defects such as cracks, they influence the material's susceptibility to chemical attack such as through corrosion and they influence the electrical conductivity of the material. In addition, migrating grain boundaries tend to interact with second-phase particles and the presence and arrangement of grain boundaries influence both the electrical conductivity and the diffusion properties of the material.

# Martensitic phase transformation and fracture

As the relatively ductile austenite phase is transformed in to harder and more brittle martensite in the vicinity stress-concentrations, the material conditions change and also the conditions for crack formation and propagation. Fatigue fracture can be considerably influenced by this kind of diffusionless phase transformation due to the higher fracture strength of martensite, compared to that of austenite. In Hallberg et al. (2012) the influence of martensite formation on fracture behavior and crack tip conditions is investigated, as illustrated below.

# Continuum scale modeling of phase transformation

Taking a continuum-mechanical perspective, the isothermal model in Hallberg et al. (2007) introduces the volume fraction of martensite as an internal variable. Along with a transformation condition, dependent on the state of deformation and on temperature, this allows the evolution of the martensitic phase to be traced. The presence of a transformation condition allows establishment of a transformation potential surface, much like the yield condition and yield surface found in plasticity theory. The transformation surface is illustrated in deviatoric stress space and in the meridian plane below.

Depending on which one is active, the yield and transformation conditions determine the response of the material. The relative influence of austenite and martensite on mechanical material properties is considered through a homogenization procedure, based on the phase fractions.

The above isothermal model is further elaborated in Hallberg et. al (2010b), where full thermo-mechanical coupling is considered. These models are suitable for large-scale simulations of metal forming processes involving materials exposed to martensitic phase transformation. The application to sheet metal forming is illustrated below by images from simulations of a deep-drawing process.

# Phase transformations

Phase transformations in metallic materials have a major impact on vital engineering aspects of the material behavior such as ductility, strength and formability. Some phase transformations, such as the formation of pearlite and bainite, occur through diffusion-based processes where the constituents in the microstructure are redistributed. Being based on diffusion, these kinds of phase transformations tend to be relatively slow. On the other hand, phase transformations can also proceed by pure displacements in the crystal lattice structure. This is typical for the very rapid and diffusionless formation of martensite in austenitic steels.

Specifically, the latter kind of materials, undergoing microstructural changes in terms of austenite-martensite transformation, have in recent years gained increasing attention in relation to shape memory alloys (SMAs) and alloys exhibiting transformation-induced plasticity (TRIP steels).

Description of phase transformations is further involved due to the strong temperature-dependence of the process. Combined with significant differences in mechanical properties between the phases and the volumetric deformations accompanying e.g. martensitic phase transformations, strongly thermo-mechanically coupled phenomena arise.

The presence of martensite also changes the fracture behavior of a material since the martensite is considerably harder than the more ductile austenite parent phase. This influences e.g. initiation and propagation of crack and may become detrimental to metal forming and forging processes.

# Impediment of grain boundary migration due to particle drag

Metallic materials used in engineering applications frequently contain some volume fraction of particles. These may be impurity particles or particles that are deliberately added to influence the microstructure behavior.

As grain boundaries migrate through the microstructure, driven by boundary curvature and/or stored energy gradients, any particles present will impede - or even prevent - the movement by exerting drag forces on the passing boundaries. Classically this effect is termed Zener drag or Zener pinning. This pinning pressure is usually written as

$p=-z_{1}\gamma\frac{f_{\mathrm{V}}^{z_{2}}}{r_{\mathrm{p}}}$

where the negative sign indicates a retarding pressure and where $\gamma$ is the boundary energy while $f_{\mathrm{V}}$ and $r_{\mathrm{p}}$ are the volume fraction of particles and the average particle size, respectively. $z_{1}$ and $z_{2}$ are parameters.

In the original model by Zener (published by C.S. Smith in 1948), the formulation is based on the assumption of rigid grain boundaries between the particles, providing $z_{i}=\left\{3/2,1\right\}$. Later studies have tried to incorporate the tendency of the grain boundary to bow out between particles, arriving at other values of the parameters $z_{1}$ and $z_{2}$.

A mesoscale RVE model of dynamic discontinuous recrystallization, considering particle drag, is established in Hallberg et al. (2014). The model is based on a 3D cellular automaton formulation. See illustration below.


text:
# Defining cluster algebras of finite kind \$mathrm{A}\$ by turbines and relations Answer

Hello pricey customer to our community We will proffer you an answer to this query Defining cluster algebras of finite kind \$mathrm{A}\$ by turbines and relations ,and the respond will breathe typical by means of documented data sources, We welcome you and proffer you fresh questions and solutions, Many customer are questioning concerning the respond to this query.

Defining cluster algebras of finite kind \$mathrm{A}\$ by turbines and relations

Consider a cluster algebra of finite kind $$mathrm{A}$$. The clique of all (discrete) cluster variables is of finite cardinality, denote it by $$okay$$, for such algebra. Is it undoubted that, for an capricious altenative of the bottom ring, each such algebra is isomorphic to the polynomial ring (over the bottom ring, I speculate) in (suitably outlined) $$okay$$ variables moded out by the model generated by the trade relations?

we’ll proffer you the answer to Defining cluster algebras of finite kind \$mathrm{A}\$ by turbines and relations query by way of our community which brings all of the solutions from a number of dependable sources.


text:
# [OS X TeX] inputting figures that are pfd files

Bruce Kellogg rbmjk at alltel.net
Sun Apr 9 14:16:43 EDT 2006

I am a TeX user, gradually switching to LaTeX.
In TeX, I often used PiCTeX to generate figures,
so I have tried to do this in LaTeX. For this I have
used TeX and PiCTeX to generate a small figure,
obtaining a pdf file, called fos.pdf. I put the statement

\usepackage{graphics}

near the top of a LaTeX document, and I put the statement

\includegraphics{fos}

somewhere in the file. When processing the file with LaTeX,
I get the usual pdf output up to the point where the
\includegraphics statement is, then nothing else. The logfile
gives the message

<fos.pdf, id=1, 614.295pt x 794.97pt> <use fos.pdf>
Overfull \hbox (159.5385pt too wide) in paragraph at lines 134--135
[][]

and seems to continue processing the file. (Lines 134--135 are at the
\includegraphics statement.) I confess to not understanding
in the book of Kopta and Daly. But, just to try something I modified
the statement to

\includegraphics[0cm,0cm][2cm,2cm]{fos}

Now I got a full set of output, but with a blank space where I would
have expected the figure, and no relevant comments in the log file as
far as I could see. Any suggestions?
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/


text:
# On the Determinants of Risk Aversion

Four years ago, The Economist published a particularly interesting article about the determinants of risk aversion, entitled “Risk off: Why some people are more cautious with their finances than others”. Here are some key takeaways from this article:

1. Economists have long known that people are risk-averse; yet the willingness to run risks varies enormously among individuals and over time.

2. Genetics explains a third of the difference in risk-taking; e.g., a Swedish study of twins finds that identical twins had “… a closer propensity to invest in shares” than fraternal ones.

3. Upbringing, environment and experience also matter; e.g., . “…the educated and the rich are more daring financially. So are men, but apparently not for genetic reasons”.

4. People’s financial history has a strong impact on their taste for risk; e.g., “… people who experienced high (low) returns on the stock market earlier in life were, years later, likelier to report a higher (lower) tolerance for risk, to own (not own) shares and to invest a bigger (smaller) slice of their assets in shares.”

5. “Exposure to economic turmoil appears to dampen people’s appetite for risk irrespective of their personal financial losses.” Furthermore, a low tolerance for risk is linked to past emotional trauma.

# Arrow-Pratt method vis–à–vis the “exact” method for calculating risk premiums

I received an email from a Finance 4335 student asking for further clarification of the two methods for calculating risk premiums which we covered in class last Thursday. Under the so-called “exact” method, one 1) calculates expected utility, 2) sets expected utility equal to the utility of the certainty-equivalent of wealth, 3) solves for the certainty-equivalent of wealth, and 4) obtains the risk premium by calculating the difference between expected wealth and the certainty-equivalent of wealth. A numerical example of this approach is provided on page 3 of the http://fin4335.garven.com/spring2018/lecture6.pdf lecture note. On the other hand, the Arrow-Pratt method is an alternative method for calculating the risk premium which is based upon Taylor series approximations of expected utility of wealth and the utility of the certainty equivalent of wealth (the derivation for which appears on pp. 16-18 of this same lecture note). Both of these approaches for calculating risk premiums are perfectly acceptable for purposes of Finance 4335.

The value added of Arrow-Pratt is that it analytically demonstrates how risk premiums depend upon two factors: 1) the magnitude of the risk itself (as indicated by variance), and 2) the degree to which the decision-maker is risk averse. For example, we showed in class on Thursday that the Arrow-Pratt coefficient for the logarithmic investor (for whom U(W) = ln W) is twice as large as the Arrow-Pratt coefficient for the square root investor (for whom U(W) = W.5); 1/W for the logarithmic investor compared with .5/W for the square root investor. Thus, the logarithmic investor behaves in a more risk averse than the square root investor; other things equal, the logarithmic investor will prefer to allocate less of her wealth to risky assets and buy more insurance than the the square root investor. Another important insight yielded by Arrow-Pratt (at least for the utility functions considered so far in Finance 4335) is the notion of decreasing absolute risk aversion. Other things equal, investors become less (more) risk averse as wealth increases (decreases).

# The Index Fund featured as one of “50 Things That Made the Modern Economy”

Tim Harford also features the index fund in his “Fifty Things That Made the Modern Economy” radio and podcast series. This 9 minute long podcast lays out the history of the development of the index fund in particular and the evolution of so-called of passive portfolio strategies in general. Much of the content of this podcast is sourced from Vanguard founder Jack Bogle’s September 2011 WSJ article entitled “How the Index Fund Was Born” (available at https://www.wsj.com/articles/SB10001424053111904583204576544681577401622). Here’s the description of this podcast:

“Warren Buffett is the world’s most successful investor. In a letter he wrote to his wife, advising her how to invest after he dies, he offers some clear advice: put almost everything into “a very low-cost S&P 500 index fund”. Index funds passively track the market as a whole by buying a little of everything, rather than trying to beat the market with clever stock picks – the kind of clever stock picks that Warren Buffett himself has been making for more than half a century. Index funds now seem completely natural. But as recently as 1976 they didn’t exist.  And, as Tim Harford explains, they have become very important indeed – and not only to Mrs Buffett.”

Warren Buffett is one of the world’s great investors. His advice? Invest in an index fund

# Insurance featured as one of “50 Things That Made the Modern Economy”

From November 2016 through October 2017, Financial Times writer Tim Harford presented an economic history documentary radio and podcast series called 50 Things That Made the Modern Economy. This same information is available in book under the title “Fifty Inventions That Shaped the Modern Economy“. While I recommend listening to the entire series of podcasts (as well as reading the book), I would like to call your attention to Mr. Harford’s episode on the topic of insurance, which I link below. This 9-minute long podcast lays out the history of the development of the various institutions which exist today for the sharing and trading of risk, including markets for financial derivatives as well as for insurance.

“Legally and culturally, there’s a clear distinction between gambling and insurance. Economically, the difference is not so easy to see. Both the gambler and the insurer agree that money will change hands depending on what transpires in some unknowable future. Today the biggest insurance market of all – financial derivatives – blurs the line between insuring and gambling more than ever. Tim Harford tells the story of insurance; an idea as old as gambling but one which is fundamental to the way the modern economy works.”

# It Has Been a Near-Perfect Investing Environment. But It May End Soon.

As this article from today’s WSJ points out, the “near-perfect” environment is in reference to a two decade-long financial market anomaly (dating back to the late 1990s) in which stock and bond  have tended to move in opposite directions.  Thus, investors have been able to (quite effectively) hedge risk by owning both asset classes.
For two decades, government bonds have provided what amounts to free insurance against stock-market struggles. But that’s a historical anomaly.

# Statistical Independence

During last Thursday’s Finance 4335 class meeting, I introduced the concept of statistical independence. This coming Tuesday, much of our class discussion will focus on the implications of statistical independence for probability distributions such as the binomial and normal distributions which we will rely upon throughout the semester.

Whenever risks are statistically independent of each other, this implies that they are uncorrelated; i.e., random variations in one variable are not meaningfully related to random variations in another. For example, auto accident risks are largely uncorrelated random variables; just because I happen to get into a car accident, this does not make it any more likely that you will suffer a similar fate (that is, unless we happen to run into each other!). Another example of statistical independence is a sequence of coin tosses. Just because a coin toss comes up “heads,” this does not make it any more likely that subsequent coin tosses will also come up “heads.”

Computationally, the joint probability that we both get into car accidents or heads comes up on two consecutive tosses of a coin is equal to the product of the two event probabilities. Suppose your probability of getting into an auto accident during 2017 is 1%, whereas my probability is 2%. Then the likelihood that we both get into auto accidents during 2017 is .01 x .02 = .0002, or .02% (1/50th of 1 percent). Similarly, when tossing a “fair” coin, the probability of observing two “heads” in a row is .5 x .5 = 25%. The probability rule which emerges from these examples can be generalized as follows:

Suppose Xi and Xj are uncorrelated random variables with probabilities pi and pj respectively. Then the joint probability that both Xi and Xj occur is equal to pipj.

# The rise and fall of Bitcoin

Excellent insights (and context from economic history) from The Economist about the rise and fall of Bitcoin!

Investors in Bitcoin are learning some very old lessons

# Graph of the day: Daily volatility of Bitcoin (BTC) vis-à-vis other asset classes

Graph of the day – daily volatility of Bitcoin (BTC) vis-à-vis other asset classes (WTI (oil), silver, gold, US stocks (SP500), Euro/Dollar exchange rate, 10 year T-bond, 1 year T-bill, and 1 month T-bill). Source: WSJ Daily Shot, 11-January-2018.

The Wall Street Journal recently published an important article (linked below) which documents the (unprecedented) synchronized compression of implied volatility across multiple asset classes; specifically, US equities, oil, gold, and US interest rates.

# On the relationship between the S&P 500 and the CBOE Volatility Index (VIX)

Besides going over the syllabus during the first day of class on Tuesday, January 9, we will also discuss a “real world” example of financial risk. Specifically, we will look at the relationship between short-term stock market volatility (as indicated by the CBOE Volatility Index (VIX)) and returns (as indicated by the SP500 stock market index).

As indicated by this graph from page 25 of next Tuesday’s lecture note, daily percentage changes on closing prices for VIX and the SP500 are strongly negatively correlated. In the graph above, the y-axis variable is the daily return on the SP500, whereas the x-axis variable is the daily return on the VIX. The blue points represent 7,056 daily observations on these two variables, spanning the time period from January 2, 1990 through December 29, 2017. When we fit a regression line through this scatter diagram, we obtain the following equation:

${R_{SP500}} = 0.00058 - 0.1187{R_{VIX}}$,

where ${R_{SP500}}$ corresponds to the daily return on the SP500 index and ${R_{VIX}}$ corresponds to the daily return on the VIX index. The slope of this line (-0.1187) indicates that on average, daily VIX returns during this time period were inversely related to the daily return on the SP500; i.e., when volatility as measured by VIX went down (up), then the stock market return as indicated by SP500 typically went up (down). Nearly half of the variation in the stock market return during this time period (specifically, 49.2%) can be statistically “explained” by changes in volatility, and the correlation between ${R_{SP500}}$ and ${R_{VIX}}$ comes out to -0.7014. While a correlation of -0.7014 does not imply that ${R_{SP500}}$ and ${R_{VIX}}$ will always move in opposite directions, it does indicate that this will be the case more often than not. Indeed, closing daily returns on ${R_{SP500}}$ and ${R_{VIX}}$ during this period moved inversely 78% of the time.