Created
August 29, 2015 11:47
How to fit a copula model in R (part 4). Full article at http://www.firsttimeprogrammer.blogspot.com/2015/02/how-to-fit-copula-model-in-r.html
This file contains 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
# Plot data with histograms | |
xhist <- hist(mat[,1], breaks=30, plot=FALSE) | |
yhist <- hist(mat[,2], breaks=30, plot=FALSE) | |
top <- max(c(xhist$counts, yhist$counts)) | |
xrange <- c(-4,4) | |
yrange <- c(-6,6) | |
nf <- layout(matrix(c(2,0,1,3),2,2,byrow=TRUE), c(3,1), c(1,3), TRUE) | |
par(mar=c(3,3,1,1)) | |
plot(mat[,1], mat[,2], xlim=xrange, ylim=yrange, xlab="", ylab="") | |
par(mar=c(0,3,1,1)) | |
barplot(xhist$counts, axes=FALSE, ylim=c(0, top), space=0) | |
par(mar=c(3,0,1,1)) | |
barplot(yhist$counts, axes=FALSE, xlim=c(0, top), space=0, horiz=TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment