you need to complete the r code and a single-page document containing two figures, report the parameters you estimate and discuss how well your power law fits the network data, and explain the finding. Question: images incomplete r code: # IDS 564 - Spring 2023 # Lab 4 R Code - Estimating the Degree Exponent of a Scale-free Network #========================================================================= ===================== # 0. INITIATION ========================================================================== = #========================================================================= ===================== ## You'll need VGAM for the zeta function # install.packages("VGAM") ## When prompted to install from binary version, select no library(VGAM) ## You'll need this when calculating goodness of fit # install.packages("parallel") library(parallel) library(ggplot2) library(ggthemes) library(dplyr) library(tidyr) ##------------------------------------------------------------------------------ ## This function will calculate the zeta function for you. You don't need to worry about it! Run it and continue. ## gen_zeta(gamma , shift) will give you a number gen_zeta <- function (gamma, shift = 1, deriv = 0) { deriv.arg <- deriv rm(deriv) if (!is.Numeric(deriv.arg, length.arg = 1, integer.valued = TRUE)) stop("'deriv' must be a single non-negative integer") if (deriv.arg < 0 || deriv.arg > 2) stop("'deriv' must be 0, 1, or 2") if (deriv.arg > 0) return(zeta.specials(Zeta.derivative(gamma, deriv.arg = deriv.arg, shift = shift), gamma, deriv.arg, shift)) if (any(special <- Re(gamma) <= 1)) { ans <- gamma ans[special] <- Inf special3 <- Re(gamma) < 1 ans[special3] <- NA special4 <- (0 < Re(gamma)) & (Re(gamma) < 1) & (Im(gamma) == 0) # ans[special4] <- Zeta.derivative(gamma[special4], deriv.arg = deriv.arg, shift = shift) special2 <- Re(gamma) < 0 if (any(special2)) { gamma2 <- gamma[special2] cgamma <- 1 - gamma2 ans[special2] <- 2^(gamma2) * pi^(gamma2 - 1) * sin(pi * gamma2/2) * gamma(cgamma) * Recall(cgamma) } if (any(!special)) { ans[!special] <- Recall(gamma[!special]) } return(zeta.specials(ans, gamma, deriv.arg, shift)) } aa <- 12 ans <- 0 for (ii in 0:(aa - 1)) ans <- ans + 1/(shift + ii)^gamma ans <- ans + Zeta.aux(shape = gamma, aa, shift = shift) ans[shift <= 0] <- NaN zeta.specials(ans, gamma, deriv.arg = deriv.arg, shift = shift) } ## example: gen_zeta(2.1, 4) ##------------------------------------------------------------------------------ ## The P_k (the CDF) P_k = function(gamma, k, k_sat){ ### fill the function return(1 - ( gen_zeta(gamma, k) / ... )) } ##------------------------------------------------------------------------------ my_theme <- theme_classic() + theme(legend.position = "bottom", legend.box = "horizontal", legend.direction = "horizontal", title = element_text(size = 18), axis.title = element_text(size = 14), axis.text.y = element_text(size = 16), axis.text.x = element_text(size = 16), strip.text = element_text(size.