# R-programming-statistics

R is a programming language possesses an extensive catalog of statistical and graphical methods. It includes machine learning algorithm, linear regression, time series, statistical inference to name a few. Most of the R libraries are written in R,but many large companies also use R programming language, including Uber, Google, Airbnb, Facebook and so on

## Email subscriptions

Delivered by FeedBurner

## Stock Price TSLA

[1] "TSLA"
> chartSeries(Cl(TSLA))
> rettsla <- dailyReturn(Cl(TSLA), type='log')
> par(mfrow=c(2,2))
> acf(rettsla, main="Tsla Return ACF");
> pacf(rettsla, main="Tsla Return PACF");
> acf(rettsla^2, main="Tsla Squared return ACF");
> pacf(rettsla^2, main="Tsla Squared return PACF")

> par(mfrow=c(1,1))
> m=mean(ret);s=sd(ret);
> kurtosis(rettsla)
[1] 5.814273
attr(,"method")
[1] "excess"
> plot(density(rettsla), main='Tsla Return EDF - upper tail', xlim = c(0.1, 0.2),
+      ylim=c(0,2));
> curve(dnorm(x, mean=m,sd=s), from = -0.3, to = 0.2, add=TRUE, col="red")

> ret.tsla <- dailyReturn(Cl(TSLA), type='log')
> chartSeries(rettsla)

> garch11.spec = ugarchspec(variance.model = list(model="sGARCH",garchOrder=c(1,1)), mean.model = list(armaOrder=c(0,0)))
> tsla.garch11.fit = ugarchfit(spec=garch11.spec, data=rettsla)