ExpertMatrix | R Documentation |
This is the library of all the Expert Functions. In another word, it stored all the metadata of the Expert Functions. This object is a singleton, which means it should be only created when the package is loaded. It is also hidden in the global environment. Please do not clear the hidden objects And it you cleared the hidden objects. Please reload the package to fix that.
This is the matrix class of Expert Functions. Users are expected to perform all vector operations through ExpertMatrix to reduce index errors.
continuous_experts
(NULL
)
The names of continuous ExpertFunction
discrete_experts
(NULL
)
The names of discrete ExpertFunction
distribution_names
(NULL
)
The names of all expert functions
Register a new Expert Function
register()
ExpertLibrary$register(expert_name, continuous)
expert_name
(character
)
The name of the expert function
continuous
(logical
)
Is this new expert function continuous?
Is given Expert Function continuous?
is_continous()
ExpertLibrary$is_continous(expert_name)
expert_name
(character
)
The name of the expert function
Is given Expert Function discrete?
is_discrete()
ExpertLibrary$is_discrete(expert_name)
expert_name
(character
)
The name of the expert function
Is given Expert Function got a correct name?
is_valid_expert()
ExpertLibrary$is_valid_expert(expert_name)
expert_name
(character
)
The name of the expert function
clone()
The objects of this class are cloneable with this method.
ExpertLibrary$clone(deep = FALSE)
deep
Whether to make a deep clone.
nrow
(numeric
)
The number of rows of ExpertMatrix
ncol
(numeric
)
The number of columns of ExpertMatrix
expert_matrix
(matrix
)
The matrix object to store all the ExpertFunction R6 objects
penalty_params
(matrix
)
The matrix object to store all the penalty parameters for the Expert Functions
expert_params
(matrix
)
The matrix object to store all the parameters for the Expert Functions
Initialze a Expert Matrix Class
new()
ExpertMatrix$new(expert_matrix, expert_params_matrix)
expert_matrix
(matrix
)
The name of Expert Functions, stored as a matrix of characters.
expert_params_matrix
(matrix
)
The parameters of Expert Functions, stored as a matrix of lists.
select the expert function object inside expert matrix
select()
ExpertMatrix$select(row_index = 0, col_index = 0)
row_index
Row index
col_index
Column index Exposurize all the expert functions inside the expert matrix
exposurize()
ExpertMatrix$exposurize(exposure)
exposure
The exposurized value
get_mean()
Return the mean matrix of the ExpertMatrix
ExpertMatrix$get_mean()
get_variance()
Return the variance matrix of the ExpertMatrix set the penalty parameters for all the expert functions
ExpertMatrix$get_variance()
set_penalty_params()
ExpertMatrix$set_penalty_params(expert_penalty_params_matrix)
expert_penalty_params_matrix
(matrix
)
To be more specific, it is a matrix of list like this
penalty_params = matrix( list( c(2,1,2), c(1,1,1), c(3,1,2), c(1,3,4)), nrow = 2) set the parameters for all the expert functions
set_params()
ExpertMatrix$set_params(expert_params_matrix)
expert_params_matrix
(matrix
)
To be more specific, it is a matrix of list of named list like this
params = matrix(list( list(meanlog = 1, sdlog = 2), list(meanlog = 1, sdlog = 2), list(meanlog = 3, sdlog = 1), list(meanlog = 5, sdlog = 1)), nrow = 2) Get the sum of penalty value of all the expert functions. Users are required to set the penalty parameters before call this function.
get_penalty_value()
ExpertMatrix$get_penalty_value(penalty)
penalty
TRUE/FALSE
value The total penalty value of Expert Matrix Count the total number of parameters (for the Expert Functions) that exist in the Expert Matrix.
count_params()
ExpertMatrix$count_params()
result (integer
)
Total number of parameters
clone()
The objects of this class are cloneable with this method.
ExpertMatrix$clone(deep = FALSE)
deep
Whether to make a deep clone.
params = matrix(list( list(meanlog = 1, sdlog = 2), list(meanlog = 1, sdlog = 2), list(meanlog = 3, sdlog = 1), list(meanlog = 5, sdlog = 1)), nrow = 2) penalty_params = matrix( list( c(2,1,2), c(1,1,1), c(3,1,2), c(1,3,4)), nrow = 2) expert_names = matrix( c("lognormal", "lognormal", "lognormal", "lognormal"), nrow = 2) # ExpertMatrixObj = ExpertMatrix$new(expert_matrix = expert_names, expert_params_matrix = params) # ExpertMatrixObj$set_penalty_params(penalty_params) # ExpertMatrixObj$set_params(params)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.