Skip to contents

Sets the number of digits to display in the output of the different package functions.

Usage

set_display_digits(digits = list())

Arguments

digits

A list of numbers corresponding to the different display digits. The default value is list().

Value

No return value, called for side effects.

Details

The parameter digits is a named list. It will be containing:

  • d1: contains the number of display digits for the values of probability estimates such as \(\alpha\), \(\delta\), pin, mpin, mpin(j), adjpin, psos, \(\theta\), and \(\theta'\).

  • d2: contains the number of display digits for the values of \(\mu\), \(\epsilon\)b and \(\epsilon\)s, as well as information criteria: AIC, BIC, and AWE.

  • d3: contains the number of display digits for the remaining values such as vpin statistics and likelihood value .

If the function is called with no arguments, the display digits will be reset to the default values, i.e., list(d1 = 6, d2 = 2, d3 = 3)). If the argument digits is not omitted, the function will only accept a list containing exactly three numerical values, each ranging between 0 and 10. The list can be named or unnamed. If the numbers in the argument digits are not integers, they will be rounded.

Examples

# There is a preloaded quarterly dataset called 'dailytrades' with 60
# observations. Each observation corresponds to a day and contains the
# total number of buyer-initiated trades ('B') and seller-initiated
# trades ('S') on that day. To know more, type ?dailytrades

xdata <- dailytrades

# We show the output of the function pin_ea() using the default values
# of display digits. We then change these values using the function
# set_display_digits(), before displaying the same estimate.pin object
# again to see the difference.

model <- pin_ea(xdata, verbose = FALSE)
show(model)
#> ----------------------------------
#> PIN estimation completed successfully
#> ----------------------------------
#> Estimation method 	: Maximum likelihood estimation
#> Initial parameter sets	: Ersan and Alici (2016)
#> Likelihood factorization: Ersan (2016)
#> ----------------------------------
#> 5 initial set(s) are used in the estimation 
#> Type object@initialsets to see the initial parameter sets used
#> 
#>  PIN model  
#> 
#> ==========  ===========
#> Variables   Estimates  
#> ==========  ===========
#> alpha       0.749997   
#> delta       0.133334   
#> mu          1193.52    
#> eps.b       357.27     
#> eps.s       328.63     
#> ----                   
#> Likelihood  (3226.469) 
#> PIN         0.566172   
#> ==========  ===========
#> 
#> -------
#> Running time: 0.537 seconds

# Change the number of digits for d1 to 3, of d2 to 0 and of d3 to 2

set_display_digits(list(3, 0, 2))
#> Display digits updated successfully!

# No need to run the function mpin_ml() again to update the display of an
# estimate.mpin object.This holds for all estimate* S4 objects.

show(model)
#> ----------------------------------
#> PIN estimation completed successfully
#> ----------------------------------
#> Estimation method 	: Maximum likelihood estimation
#> Initial parameter sets	: Ersan and Alici (2016)
#> Likelihood factorization: Ersan (2016)
#> ----------------------------------
#> 5 initial set(s) are used in the estimation 
#> Type object@initialsets to see the initial parameter sets used
#> 
#>  PIN model  
#> 
#> ==========  ===========
#> Variables   Estimates  
#> ==========  ===========
#> alpha       0.75       
#> delta       0.133      
#> mu          1194       
#> eps.b       357        
#> eps.s       329        
#> ----                   
#> Likelihood  (3226.47)  
#> PIN         0.566      
#> ==========  ===========
#> 
#> -------
#> Running time: 0.537 seconds