# 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
# Obtain a dataframe of 20 random initial parameters for the MLE of
# the AdjPIN model using the initials_adjpin_rnd().
initial.sets <- initials_adjpin_rnd(xdata, num_init = 20)
# Use the dataframe to estimate the AdjPIN model using the adjpin()
# function.
estimate <- adjpin(xdata, initialsets = initial.sets, verbose = FALSE)
# Show the value of adjusted PIN
show(estimate@adjpin)
Run the code above in your browser using DataLab