Learn R Programming

PAFit (version 1.2.10)

plot.PA_result: Plotting the estimated attachment function

Description

This function plots the estimated attachment function from the corrected Newman's method or the Jeong's method. Its also plots additional information such as the estimated attachment exponenent (\(\alpha\) when assuming \(A_k = k^\alpha\)).

Usage

# S3 method for PA_result
plot(x, 
     net_stat    = NULL,
     plot_bin    = TRUE   ,
     high_deg    = 1      ,  
     line        = FALSE  , 
     col_point   = "black",
     shade_point = 0.5    , 
     pch         = 16     ,
     max_A       = NULL   , 
     min_A       = NULL   , 
     label_x     = NULL   , 
     label_y     = NULL   ,
     ...)

Value

Outputs the desired plot.

Arguments

x

An object of class PA_result, containing the estimated attachment function and the estimated attachment exponenet from either Newman or Jeong functions.

net_stat

An object of class PA_data, containing the summerized statistics. This object is created from the function get_statistics.

plot_bin

Logical. If TRUE then only the center of each bin is plotted. Default is TRUE.

high_deg

Integer. Specifies the starting degree from which \(A_k\) is plotted. If this parameter is specified, the estimated attachment function is plotted from k = high_deg

line

Logical. Indicates whether to plot the line fitted from the log-linear model or not. Default value is FALSE.

col_point

String. The name of the color of the points. Default value is \("black"\).

shade_point

Numeric. Value between 0 and 1. This is the transparency level of the points. Default value is 0.5.

pch

Numeric. The plot symbol. Default value is 16.

max_A

Numeric. Specify the maximum of the horizontal axis.

min_A

Numeric. Specify the minimum of the horizontal axis.

label_x

String. The label of x-axis. If NULL, then "Degree k" is used.

label_y

String. The label of y-axis. If NULL, then "Attachment function" is used.

...

Other arguments to pass to the underlying plotting function.

Author

Thong Pham thongphamthe@gmail.com

Examples

Run this code
  library("PAFit")
  net        <- generate_net(N = 1000 , m = 1 , mode = 1 , alpha = 1 , s = 0)
  net_stats  <- get_statistics(net)
  result     <- Newman(net, net_stats)
  # true function
  true_A     <- result$center_k
  # plot the estimated attachment function
  plot(result , net_stats)
  lines(result$center_k, true_A, col = "red") # true attachment function
  legend("topleft" , legend = "True function" , col = "red" , lty = 1 , bty = "n")

Run the code above in your browser using DataLab