Learn R Programming

SIMPLICA (version 1.0.0)

defaultPatternFunctions: Default pattern generators for SIMPLICA

Description

Returns a named list of default matrix approximation functions used to score component patterns. Each function must take a numeric matrix (i.e., a component: subset of rows and columns) and return a matrix of the same dimensions that approximates the original matrix according to a specific structural pattern (e.g., constant, additive, etc.).

Usage

defaultPatternFunctions()

Arguments

Value

A named list of functions, each representing a matrix approximation method.

Details

This list can be passed to fitness2() via the patternFunctions argument. Users can extend or override the default patterns by modifying the returned list.

Requirements for pattern functions

Custom pattern functions must:

  • Take a numeric matrix as input.

  • Return a numeric matrix of the same dimensions.

  • Be compatible with sum(abs(...)) and sum((...)^2) operations for fitness scoring.

Examples

Run this code
# Retrieve default pattern functions
patterns <- defaultPatternFunctions()

# Add a custom pattern based on diagonal structure
diagonalPattern <- function(m) {
  diagVal <- mean(diag(as.matrix(m)))
  matrix(diagVal, nrow = nrow(m), ncol = ncol(m))
}

# Extend the list with your own pattern
patterns$diagonal <- diagonalPattern

Run the code above in your browser using DataLab