MAP_parameters | R Documentation |
Returns the parameters of each leaf contained in the MAP model.
MAP_parameters(input_data, depth, beta = NULL)
input_data |
the sequence to be analysed. The sequence needs to be a "character" object. See the examples section of BCT/kBCT functions on how to transform any dataset to a "character" object. |
depth |
maximum memory length. |
beta |
hyper-parameter of the model prior. Takes values between 0 and 1. If not initialised in the call function, the default value is 1-2-m+1, where m is the size of the alphabet; for more information see Kontoyiannis et al. (2020). |
list of parameters for each of the context within the MAP model.
BCT
, kBCT
, generate_data
# Use the gene_s dataset: q <- BCT(gene_s, 10) expected_contexts <- q[['Contexts']] expected_contexts # [1] "3" "1" "0" "23" "20" "21" "22" # For default beta: v <- MAP_parameters(gene_s, 10) # For custom beta (e.g. 0.8): MAP_parameters(gene_s, 10, 0.8) # generate a sequence of data using the generate_data function s <- generate_data(v, 20000) # Use BCT: r <- BCT(s, 10) # Check the resulting contexts: r[['Contexts']] # [1] "3" "0" "1" "20" "22" "23" "21" # The resulting contexts are as expected
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.