Showing posts with label ITC-Stock-Price. Show all posts
Showing posts with label ITC-Stock-Price. Show all posts

Sunday, December 8, 2019

ITC Stock Price

 Stock Price ITC.NS

 Stock Price ITC

> chartSeries(Cl(ITC.NS))
> addMomentum()
> addMACD()
> addPoints()
> retitc <- dailyReturn(Cl(ITC.NS), type='log')
> par(mfrow=c(2,2))
> acf(retitc, main="ITC Return ACF");
> pacf(retitc, main="ITC Return PACF");
> acf(retitc^2, main="Squared ITC return ACF");
> pacf(retitc^2, main="Squared ITC return PACF")
> par(mfrow=c(1,1))
 Stock Price ITC

 Stock Price ITC

> plot(density(retitc), main='ITC Return empirical distribution');curve(dnorm(x,mean=m,sd=s), from = -0.3, to = 0.2, add=TRUE, col="red")
> hist(retitc, nclass=40, freq=FALSE, main='Return histogram');curve(dnorm(x,
+  mean=m,sd=s), from = -0.3, to = 0.2, add=TRUE, col="red")
'ITC Return empirical distribution

 Stock Price ITC

 Stock Price ITC

 Stock Price ITC

 Stock Price ITC

 kurtosis(retitc)
[1] 81.70154
attr(,"method")
[1] "excess"
> curve(dnorm(x, mean=m,sd=s), from=-5*s, to=5*s, log="y", add=TRUE,
+       col="red")
> qqnorm(retitc);qqline(retitc);
> chartSeries(retitc)
> garch11.spec = ugarchspec(variance.model = list(model="sGARCH",garchOrder=c(1,1)), mean.model = list(armaOrder=c(0,0)))
> itc.garch11.fit = ugarchfit(spec=garch11.spec, data=retitc)
> coef(itc.garch11.fit)
          mu        omega       alpha1 
7.572865e-04 7.054504e-06 6.574492e-02 
       beta1 
9.199215e-01 
> vcov(itc.garch11.fit) 
              [,1]          [,2]          [,3]
[1,]  6.837256e-08  1.707724e-11 -4.076436e-08
[2,]  1.707724e-11 -1.467594e-12  5.285928e-09
[3,] -4.076436e-08  5.285928e-09  2.924242e-05
[4,] -2.586683e-08  6.830059e-10 -3.873864e-05
              [,4]
[1,] -2.586683e-08
[2,]  6.830059e-10
[3,] -3.873864e-05

[4,]  2.972086e-05
> uncmean(itc.garch11.fit)
[1] 0.0007572865
> uncvariance(itc.garch11.fit)

[1] 0.0004921646
 (itc.garch11.fit) 
                      
Akaike       -5.207977
Bayes        -5.201582
Shibata      -5.207980

Hannan-Quinn -5.205708
> newsimpact(itc.garch11.fit) 
$zy
  [1] 0.0063768498 0.0061401923 0.0059083645
  [4] 0.0056813664 0.0054591981 0.0052418595
  [7] 0.0050293507 0.0048216716 0.0046188223
 [10] 0.0044208027 0.0042276129 0.0040392528
 [13] 0.0038557224 0.0036770218 0.0035031510
 [16] 0.0033341099 0.0031698985 0.0030105169
 [19] 0.0028559650 0.0027062429 0.0025613505
 [22] 0.0024212879 0.0022860550 0.0021556518
 [25] 0.0020300784 0.0019093348 0.0017934209
 [28] 0.0016823367 0.0015760823 0.0014746577
 [31] 0.0013780627 0.0012862976 0.0011993621
 [34] 0.0011172564 0.0010399805 0.0009675343
 [37] 0.0008999179 0.0008371312 0.0007791742
 [40] 0.0007260470 0.0006777496 0.0006342818
 [43] 0.0005956439 0.0005618357 0.0005328572
 [46] 0.0005087085 0.0004893895 0.0004749002
 [49] 0.0004652407 0.0004604110 0.0004604110
 [52] 0.0004652407 0.0004749002 0.0004893895
 [55] 0.0005087085 0.0005328572 0.0005618357
 [58] 0.0005956439 0.0006342818 0.0006777496
 [61] 0.0007260470 0.0007791742 0.0008371312
 [64] 0.0008999179 0.0009675343 0.0010399805
 [67] 0.0011172564 0.0011993621 0.0012862976
 [70] 0.0013780627 0.0014746577 0.0015760823
 [73] 0.0016823367 0.0017934209 0.0019093348
 [76] 0.0020300784 0.0021556518 0.0022860550
 [79] 0.0024212879 0.0025613505 0.0027062429
 [82] 0.0028559650 0.0030105169 0.0031698985
 [85] 0.0033341099 0.0035031510 0.0036770218
 [88] 0.0038557224 0.0040392528 0.0042276129
 [91] 0.0044208027 0.0046188223 0.0048216716
 [94] 0.0050293507 0.0052418595 0.0054591981
 [97] 0.0056813664 0.0059083645 0.0061401923
[100] 0.0063768498

$zx
  [1] -0.300000000 -0.293939394 -0.287878788
  [4] -0.281818182 -0.275757576 -0.269696970
  [7] -0.263636364 -0.257575758 -0.251515152
 [10] -0.245454545 -0.239393939 -0.233333333
 [13] -0.227272727 -0.221212121 -0.215151515
 [16] -0.209090909 -0.203030303 -0.196969697
 [19] -0.190909091 -0.184848485 -0.178787879
 [22] -0.172727273 -0.166666667 -0.160606061
 [25] -0.154545455 -0.148484848 -0.142424242
 [28] -0.136363636 -0.130303030 -0.124242424
 [31] -0.118181818 -0.112121212 -0.106060606
 [34] -0.100000000 -0.093939394 -0.087878788
 [37] -0.081818182 -0.075757576 -0.069696970
 [40] -0.063636364 -0.057575758 -0.051515152
 [43] -0.045454545 -0.039393939 -0.033333333
 [46] -0.027272727 -0.021212121 -0.015151515
 [49] -0.009090909 -0.003030303  0.003030303
 [52]  0.009090909  0.015151515  0.021212121
 [55]  0.027272727  0.033333333  0.039393939
 [58]  0.045454545  0.051515152  0.057575758
 [61]  0.063636364  0.069696970  0.075757576
 [64]  0.081818182  0.087878788  0.093939394
 [67]  0.100000000  0.106060606  0.112121212
 [70]  0.118181818  0.124242424  0.130303030
 [73]  0.136363636  0.142424242  0.148484848
 [76]  0.154545455  0.160606061  0.166666667
 [79]  0.172727273  0.178787879  0.184848485
 [82]  0.190909091  0.196969697  0.203030303
 [85]  0.209090909  0.215151515  0.221212121
 [88]  0.227272727  0.233333333  0.239393939
 [91]  0.245454545  0.251515152  0.257575758
 [94]  0.263636364  0.269696970  0.275757576
 [97]  0.281818182  0.287878788  0.293939394
[100]  0.300000000

$yexpr
expression(sigma[t]^2)

$xexpr

expression(epsilon[t - 1])
 signbias(itc.garch11.fit) 
                     t-value                    prob sig
Sign Bias              1.0290102            0.303538366    
Negative Sign Bias 0.5976512         0.550107217    
Positive Sign Bias 2.6295677           0.008582753 ***

Joint Effect       7.2815860               0.063444166   *
egarch11.spec = ugarchspec(variance.model = list(model="eGARCH",garchOrder=c(1,1)), mean.model = list(armaOrder=c(0,0)))
> itc.egarch11.fit = ugarchfit(spec=egarch11.spec, data=retitc)
> coef(itc.egarch11.fit)
           mu         omega        alpha1 
 0.0007458757 -0.1284922189 -0.0070553000 
        beta1        gamma1 

 0.9824002414  0.1562207989 
> ni.egarch11 <- newsimpact(itc.egarch11.fit)
> plot(ni.egarch11$zx, ni.egarch11$zy, type="l", lwd=2, col="blue",
+      main="EGARCH(1,1) - News Impact",
+      ylab=ni.egarch11$yexpr, xlab=ni.egarch11$xexpr)
> tgarch11.spec = ugarchspec(variance.model = list(model="fGARCH",submodel="TGARCH", garchOrder=c(1,1)),mean.model = list(armaOrder=c(0,0)))

> itc.tgarch11.fit = ugarchfit(spec=tgarch11.spec, data=retitc)
coef(itc.egarch11.fit)
           mu         omega        alpha1 
 0.0007458757 -0.1284922189 -0.0070553000 
        beta1        gamma1 

 0.9824002414  0.1562207989 




Black-Scholes formula-R

 Black-Scholes formula-R > BlackScholes <- function(TypeFlag = c("c", "p"), S, X, Time, r, b, sigma) { TypeFla...