GAMCR.utils module#

GAMCR.utils.fractional_year_to_datetime(fractional_year)[source]#
GAMCR.utils.nse(observed, simulated)[source]#

Calculate the Nash-Sutcliffe Efficiency (NSE).

Parameters: observed (array-like): Array of observed values. simulated (array-like): Array of simulated values.

Returns: float: NSE value.

GAMCR.utils.compute_smoothing_penalty_matrix(n, knots)[source]#
GAMCR.utils.build_custom_matrix(n)[source]#

Build an n x n matrix with the following structure: - Diagonal elements: 6 - Subdiagonal and superdiagonal elements: -4 - Sub-subdiagonal and super-superdiagonal elements: 1

Parameters: - n: Size of the matrix (n x n)

Returns: - A numpy array representing the matrix.