Added functional_rate(): Estimates instantaneous rates of plant disease progress (first derivative of trajectory over time) and associated uncertainty from epidemic trajectories fitted by functional_curves(). Supports response and link scale derivatives via GAM linear predictor matrix differences, handles boundary conditions without extrapolation, accounts for zero-epidemic curves and negative rates, and computes key rate phenotypes (r_max, t_r_max, growth duration, cumulative positive growth, and growth windows). Includes S3 methods: print(), summary(), plot(), and augment().
Bug fixes and improvements
functional_curves(): Fixed smooth term label inspection during prediction so that .unit experimental unit and block random effects are correctly identified and supplied to predict.gam().
functional_curves(): Updated the GAM formula to fit independent smooths per treatment by default (trt + s(time, by=trt)), avoiding artifactual drops (“caimento”) at the tails of flat curves. Added the global_smooth parameter to allow users to opt-in to the previous Global-Specific smoothing behavior.
simulate_dsp_data(): Adjusted the amplitudes of the simulated suppression profiles (“Early”, “Late”, “Persistent”) to achieve exactly a 70% reduction in AUDPC compared to the unsprayed control, representing a realistic fungicide efficacy scenario.
Updated _pkgdown.yml to include the newly exported functional PCA and DSP functions in the “Functional Analysis” reference index, resolving site build errors.
functional_pca(): Performs functional principal component analysis on fitted disease progress curves to decompose variation among epidemic trajectories into orthogonal temporal components. Includes plotting and extractor functions.
functional_curves(): Fits genotype-specific epidemic trajectories using GAM, with support for genotype-level covariates.
functional_distances(): Computes pairwise functional distances among fitted curves and performs hierarchical clustering and permutation testing.
functional_resistance(): Calculates Functional Resistance Index (FRI) and Stability-Adjusted Functional Resistance Index (SAFRI) with support for stratified rankings and bootstrap-supported classification.
suggest_k(): Helper function to recommend GAM smoothing parameters (k_smooth, k_trt, k_env, gamma) based on data structure; supports tidy-eval column names and can infer replication from a data frame.
Enhancements
Added support for genotype-level auxiliary covariates (e.g., heading_group) to adjust functional curves and resistance rankings, allowing for better distinction between genetic resistance and phenological escape.
Improved bootstrap methodology for resistance classification with support for stratified group comparisons.
Added functional_instability() for computing normalized functional instability (NFI) of genotype-by-environment epidemic curves, with optional decomposition into spatial and temporal components.