Showing posts with label Traditionally these are used to explore relationships between time and another variable. Show all posts
Showing posts with label Traditionally these are used to explore relationships between time and another variable. Show all posts

## Saturday, January 12, 2019

### Traditionally these are used to explore relationships between time and another variable

set.seed(1410)
> dsmall <- diamonds[sample(nrow(diamonds), 100), ]
>
> qplot(carat, price, data = diamonds)

>
> qplot(carat, price,col=101, data = diamonds)
>
> qplot(carat, price,col="red", data = diamonds)
>
> qplot(carat, price,col="green", data = diamonds)
> qplot(carat, price,col="yellow", data = diamonds)
> qplot(carat, price,col=125, data = diamonds)
> qplot(log(carat), log(price), data = diamonds)
>
> qplot(exp(carat), log(price), data = diamonds)
>
> qplot(log(carat), log(price),col=232, data = diamonds)
> qplot(carat, price, data = dsmall, colour = color)
> qplot(carat, price, data = dsmall, shape = cut)

Warning message:
Using shapes for an ordinal variable is not advised
>
> qplot(carat, price, data = diamonds, alpha = I(1/10))
> qplot(carat, price, data = dsmall, geom = c("point", "smooth"))
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
> qplot(carat, price, data = dsmall, geom = c("boxplot", "smooth"))
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
Warning message:
Continuous x aesthetic -- did you forget aes(group=...)?
> qplot(carat, price, data = dsmall, geom = c("path", "line"))

### Black-Scholes formula-R

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