Functional data analysis has become a tool of interest in applied areas such as economics, medicine, and chemistry. Among the techniques developed in recent literature, functional semiparametric regression stands out for its balance between flexible modelling and output interpretation. Despite the large variety of research papers dealing with scalar-on-function (SoF) semiparametric models, there is a notable gap in software tools for their implementation. This article introduces the R package \texttt{fsemipar}, tailored for these models. \texttt{fsemipar} not only estimates functional single-index models using kernel smoothing techniques but also estimates and selects relevant scalar variables in semi-functional models with multivariate linear components. A standout feature is its ability to identify impact points of a curve on the response, even in models with multiple functional covariates, and to integrate both continuous and pointwise effects of functional predictors within a single model. In addition, it allows the use of location-adaptive estimators based on the $k$-nearest-neighbours approach for all the semiparametric models included. Its flexible interface empowers users to customise a wide range of input parameters and includes the standard S3 methods for prediction, statistical analysis, and estimate visualization (\texttt{predict}, \texttt{summary}, \texttt{print}, and \texttt{plot}), enhancing clear result interpretation. Throughout the article, we illustrate the functionalities and the practicality of \texttt{fsemipar} using two chemometric datasets.
翻译:函数型数据分析已成为经济学、医学和化学等应用领域备受关注的分析工具。在近年文献发展的技术中,函数型半参数回归因其在建模灵活性与结果可解释性之间的平衡而备受瞩目。尽管已有大量研究论文涉及标量对函数(SoF)半参数模型,但其实现的软件工具仍存在显著空白。本文介绍了专为此类模型设计的R软件包 \texttt{fsemipar}。\texttt{fsemipar} 不仅能够使用核平滑技术估计函数型单指标模型,还能在半函数型模型中估计和选择具有多元线性分量的相关标量变量。其突出特点是能够识别曲线对响应变量的影响点(即使在多函数型协变量模型中),并能在单一模型内整合函数型预测变量的连续效应与逐点效应。此外,该软件包允许对所有包含的半参数模型使用基于 $k$ 最近邻方法的位置自适应估计量。其灵活的接口使用户能够自定义广泛的输入参数,并包含用于预测、统计分析和估计可视化的标准S3方法(\texttt{predict}、\texttt{summary}、\texttt{print} 和 \texttt{plot}),从而提升结果解读的清晰度。本文通过两个化学计量学数据集,全面展示了 \texttt{fsemipar} 的功能性与实用性。