Skip to content

Instantly share code, notes, and snippets.

@NathanEpstein
Created June 23, 2015 13:25
Show Gist options
  • Save NathanEpstein/979419578007c5faac69 to your computer and use it in GitHub Desktop.
Save NathanEpstein/979419578007c5faac69 to your computer and use it in GitHub Desktop.
generating skewed normal plots in R
library(fGarch)
skew_plot = function(skewParam = 1, std=1, color = 'black', xmin = -5, xmax = 5) {
x <- seq(xmin, xmax, length = 200)
y <- dsnorm(x, sd=std, xi = skewParam)
plot(x, y, type = 'l', col = color)
}
add_line = function(skewParam = 1, std=1, color = 'black', xmin = -5, xmax = 5) {
x <- seq(xmin, xmax, length = 200)
y <- dsnorm(x, sd=std, xi = skewParam)
lines(x, y, type = 'l', col = color)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment