## What are vector spaces?

Let (F,+,.) be a field. The element of F will be called scalars. Let V be a non-empty set whose elements will be called vector. Then V is a vector space over the field F.
If an internal composition in V called the addition of vectors and denoted by'+'.Also for this composition Vis an abelian group.
An external composition in V over F called scalar multiplication and denoted by multiplicatively so that ax⋿V for all a⋿ F and for all 𝞪⋿V(V is close to scalar multiplication)

## What are Rings?

Let R is non-empty set with two binary operations called addition and multiplication. It is denoted by(+,.),  for all a,b⋿R we have a+b⋿Rand a.b⋿R  then this algebraic structure(R,+,.) is called a ring.

### Ring with unity

If ring R exists by1 such that 1.a=a=a.1 all a⋿R, then R is called a ring with the unit element.

### Commutative Ring

If a ring R, the multiplication composition is also commutative, if we have a.b=b.a all a,b⋿R, then Ris called commutative ring.

### If R is a ring for all a,b,c⋿R

a0=0a=0
a(-b)=-(ab)=(-a)b
(-a)(-b)=ab
a(b-c)=ab-ac
(b-c)a=ba-ca

## How to prove the intersection of two subrings is a subring?

Let S1 and S2  be two subrings of a ring R. Then S1∩S2 is not empty since at least 0⋿ S1∩S2.
Now in order to prove that S1∩S2 is subring, it is sufficient to prove that
1. a⋿ S1∩S2,b⋿ S1∩S2
a-b⋿ S1∩S2
2. a⋿ S1∩S2,b⋿ S1∩S2
ab⋿ S1∩S2
We have
a⋿ S1∩S2
a⋿ S1,a⋿ S2
b⋿ S1∩S2
b⋿ S1,b⋿ S2

### Now S1 and S2  are both subrings.

such that
a⋿ S1,b⋿ S1
a-b⋿ S1 and ab⋿ S1
and a⋿ S2,b⋿ S2
ab⋿ S2.
Now a-b ⋿ S1,a-b⋿ S2
a-b⋿ S1∩S2
ab⋿ S1,ab⋿ S2
ab⋿ S1∩S2.
Thus
a⋿ S1∩S2,
b⋿ S1∩S2
a-b⋿ S1∩S2.and
ab⋿ S1∩S2.
so that
S1∩S2 is a subring of R.

## What are the groups?

Groups are the branch of abstract algebra.

### How does it help?

It has helped in developing chemistry, physics, and computer science.
we define groups
1.Binary Operation
Let S be a non-empty set.Any function*:SxS→S is called binary operation on S.
Example-A binary operation *  on S and (a,b)⋿S xS,we denote *(a,b) by a*b
Now* binary operation on a set S.We say that
1.* is closed on a subset T of S if a*b⋿ T ∀ a,b ⋿ T
2. * is associative if for all a,b,c ⋿ S,(a*b)*c =a*(b*c)
3.* is commutative if for all a,b ⋿ S, a*b=b*a

#### What are semi Group?

An algebraic structure(G,*) is called a semigroup if the binary operation* is associative in G,if(a*b)*c=a*(b*c)  all a,b,cɛG.
The set of N of all-natural number is a semigroup with respect to the operation of addition of natural numbers. Addition is an associative operation on N.

The algebraic structures(N,*),(I,+) and(R,+) are also semigroup.

## How many generators are of the cyclic group G of order 8?

Let ɑ be a generator of G.Then o(ɑ)=8, so we can write
G={ɑ,ɑ^2,ɑ^3,ɑ^4,ɑ^5,ɑ^6,ɑ^7,ɑ^8}.
7is prime to 8, therefore ɑ^7 is also a generator of G.
5 is prime to 8, therefore ɑ^5 is also a generator of G.
3 is prime to 8, therefore ɑ^3 is also a generator of G.

So there are only four generators of G i.e.,ɑ,ɑ^3,ɑ^5,ɑ.

## How to generate the two time series of length 10000

### #fix the random seed

> set.seed(20140629)

### > #define length of simulation

> N <- 10000
> #simulate a normal random walk
> x <- cumsum(rnorm(N))
> #set an initial parameter value
> gamma <- 0.6
> #simulate the cointegrating series
> y <- gamma * x + rnorm(N)
> #plot the two series
> plot(x, type='l')
> lines(y,col="red")

### # Augmented Dickey-Fuller Test Unit Root Test #

###############################################

Test regression none

Call:
lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)

Residuals:
Min      1Q  Median      3Q     Max
-3.7583 -0.6800 -0.0105  0.6604  3.6463

Coefficients:
Estimate Std. Error t value
z.lag.1    -0.0008567  0.0004221  -2.030
z.diff.lag  0.0287582  0.0099989   2.876
Pr(>|t|)
z.lag.1     0.04241 *
z.diff.lag  0.00403 **
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.9956 on 9996 degrees of freedom
Multiple R-squared:  0.001212, Adjusted R-squared:  0.001012
F-statistic: 6.067 on 2 and 9996 DF,  p-value: 0.002328

Value of test-statistic is: -2.0297

Critical values for test statistics:
1pct  5pct 10pct
tau1 -2.58 -1.95 -1.62

#### Augmented Dickey-Fuller Test Unit Root Test #

###############################################

Test regression none

Call:
lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)

Residuals:
Min      1Q  Median      3Q     Max
-5.4824 -0.9477 -0.0207  0.9182  5.1281

Coefficients:
Estimate Std. Error t value
z.lag.1    -0.0032685  0.0009824  -3.327
z.diff.lag -0.4303026  0.0090285 -47.661
Pr(>|t|)
z.lag.1    0.000881 ***
z.diff.lag  < 2e-16 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.392 on 9996 degrees of freedom
Multiple R-squared:  0.1875, Adjusted R-squared:  0.1874
F-statistic:  1154 on 2 and 9996 DF,  p-value: < 2.2e-16

Value of test-statistic is: -3.3269

Critical values for test statistics:
1pct  5pct 10pct
tau1 -2.58 -1.95 -1.62

#### #take a linear combination of the series

> z = y - gamma*x
> plot(z,type='l')
summary(ur.df(z,type="none"))

###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################

Test regression none

Call:
lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)

Residuals:
Min      1Q  Median      3Q     Max
-3.6372 -0.6856 -0.0036  0.6590  3.5004

Coefficients:
Estimate Std. Error t value
z.lag.1    -0.99967    0.01423 -70.250
z.diff.lag -0.01232    0.01000  -1.232
Pr(>|t|)
z.lag.1      <2e-16 ***
z.diff.lag    0.218
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’
0.1 ‘ ’ 1

Residual standard error: 0.9983 on 9996 degrees of freedom
Multiple R-squared:  0.5061, Adjusted R-squared:  0.506
F-statistic:  5121 on 2 and 9996 DF,  p-value: < 2.2e-16

Value of test-statistic is: -70.2499

Critical values for test statistics:
1pct  5pct 10pct
tau1 -2.58 -1.95 -1.62

#### > #regression without intercept

> coin <- lm(y ~ x -1)

> coin\$resid

## How to draw stock charts

getSymbols("BMW.DE", env = bmw_stock, src = "yahoo", from =
+                as.Date("2010-01-01"), to = as.Date("2019-08-05"))
[1] "BMW.DE"
> BMW<-bmw_stock\$BMW.DE
BMW.DE.Open BMW.DE.High
2010-01-04      31.820      32.455
2010-01-05      31.960      32.410
2010-01-06      32.450      33.040
2010-01-07      32.650      33.200
2010-01-08      33.335      33.430
2010-01-11      32.995      33.050
BMW.DE.Low BMW.DE.Close
2010-01-04     31.820       32.050
2010-01-05     31.785       32.310
2010-01-06     32.360       32.810
2010-01-07     32.380       33.100
2010-01-08     32.515       32.655
2010-01-11     32.110       32.170
BMW.DE.Volume
2010-01-04       1808170
2010-01-05       1564182
2010-01-06       2218604
2010-01-07       2026145
2010-01-08       1925894
2010-01-11       2157825
2010-01-04        22.94292
2010-01-05        23.12905
2010-01-06        23.48697
2010-01-07        23.69456
2010-01-08        23.37601
2010-01-11        23.02882
> chartSeries(BMW,multi.col=TRUE,theme="white")