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().

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 transactions ('B') and seller-initiated
# transactions ('S') on that day. To know more, type ?dailytrades

xdata <- dailytrades

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

model <- mpin_ml(xdata, layers = 2, verbose = FALSE)
show(model)
#> ----------------------------------
#> MPIN estimation completed successfully
#> ----------------------------------
#> Likelihood factorization: Ersan (2016)
#> Estimation Algorithm 	: Maximum Likelihood Estimation
#> Initial parameter sets	: Ersan (2016), Ersan and Alici (2016)
#> Info. layers in the data: provided by the user
#> ----------------------------------
#> 15 initial set(s) are used in the estimation 
#> Type object@initialsets to see the initial parameter sets used
#> 
#>  MPIN model   Sequential  
#> 
#> 
#> ==========  ==================
#> Variables   Estimates         
#> ==========  ==================
#> alpha       0.266666, 0.483338
#> delta       0.312498, 0.034482
#> mu          677.93, 1512.38   
#> eps.b       331.06            
#> eps.s       338.2             
#> ----                          
#> Likelihood  (800.379)         
#> mpin(j)     0.114343, 0.462349
#> mpin        0.576692          
#> ==========  ==================
#> 
#> -------
#> Running time: 13.093 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)
#> ----------------------------------
#> MPIN estimation completed successfully
#> ----------------------------------
#> Likelihood factorization: Ersan (2016)
#> Estimation Algorithm 	: Maximum Likelihood Estimation
#> Initial parameter sets	: Ersan (2016), Ersan and Alici (2016)
#> Info. layers in the data: provided by the user
#> ----------------------------------
#> 15 initial set(s) are used in the estimation 
#> Type object@initialsets to see the initial parameter sets used
#> 
#>  MPIN model   Sequential  
#> 
#> 
#> ==========  ============
#> Variables   Estimates   
#> ==========  ============
#> alpha       0.267, 0.483
#> delta       0.312, 0.034
#> mu          678, 1512   
#> eps.b       331         
#> eps.s       338         
#> ----                    
#> Likelihood  (800.38)    
#> mpin(j)     0.114, 0.462
#> mpin        0.577       
#> ==========  ============
#> 
#> -------
#> Running time: 13.093 seconds