plot.PA_result: Plotting the estimated attachment function

View source: R/plot.pa_result.R

plot.PA_resultR Documentation

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 class '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   ,
     ...)

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.

Value

Outputs the desired plot.

Author(s)

Thong Pham thongphamthe@gmail.com

Examples

  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")

PAFit documentation built on June 22, 2024, 11:06 a.m.