Created
June 23, 2015 13:25
-
-
Save NathanEpstein/979419578007c5faac69 to your computer and use it in GitHub Desktop.
generating skewed normal plots in R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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