Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created August 4, 2023 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantra-go-algo/6e07869f53e8d8b978ac03232aa52fa1 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/6e07869f53e8d8b978ac03232aa52fa1 to your computer and use it in GitHub Desktop.
Create a plot object with 2x3 dimensions
p <- par(mfrow=c(2,3))
# Set the each plot margin sizes
p.par(mar=c(1,1,1,1))
# Create a loop to plot each AR(p) autocorrelation plot
for (i in 1:6) {
# Create the string version of the parameter value
param_string <- as.character(params[i])
# Plot the autocorrelation function
acf(df[,paste0("ARMA_1_0_0",substr(param_string,3,nchar(param_string)),"_0")],plot= TRUE, xlab = "Lag", ylab = 'Autocorrelations',main = "Autocorrelation Functions", font.main=70) }
par(p)
dev.off()
# Create a plot object with 2x3 dimensions
p <- par(mfrow=c(2,3))
# Set the each plot margin sizes
p.par(mar=c(1,1,1,1))
# Create a loop to plot each ARMA autocorrelation plot
for (i in 1:6) {
# Create the string version of the parameter value
param_string <- as.character(params[i])
# Plot the autocorrelation function
acf(df[,paste0("ARMA_1_0_0_0",substr(param_string,3,nchar(param_string)))],plot= TRUE, type = 'partial', xlab = "Lag", ylab = 'Autocorrelations',main = "Autocorrelation Functions", font.main=70) }
par(p)
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment