Generates synthetic functional predictors and responses from the spatial function-on-function regression (SFoFR) data-generating process described in Beyaztas, Shang and Sezer (2025). The model embeds spatial autoregression on the functional response, Fourier-type basis structure for the covariate, and user-controlled Gaussian noise.
sff_dgp(
n,
nphi = 10,
gpy = NULL,
gpx = NULL,
rf = 0.9,
sd.error = 0.01,
tol = 0.001,
max_iter = 1000
)A named list with components
n x length(gpy) matrix of observed functional responses on the grid gpy.
Same dimension as Y; noise-free latent responses before adding \(\varepsilon_i(t)\).
n x length(gpx) matrix of functional predictors.
n x n row-normalised spatial weight matrix based on inverse distances.
length(gpy) x length(gpy) matrix containing \(\rho(t,u)\) evaluated on the response grid.
length(gpx) x length(gpy) matrix containing \(\beta(t,s)\) evaluated on the Cartesian product of the predictor and response grids.
Number of spatial units (curves) to generate.
Number of sine and cosine basis functions used to build each functional predictor. Total latent scores generated are therefore 2 * nphi.
Numeric vector of evaluation points for the response domain \(t \in [0,1]\). Defaults to an equally-spaced grid of 101 points.
Numeric vector of evaluation points for the predictor domain \(s \in [0,1]\). Defaults to an equally-spaced grid of 101 points.
Scalar in \((0,1)\) controlling the strength of spatial autocorrelation through the surface \(\rho(t,u)\). Values closer to 1 yield stronger dependence.
Standard deviation of the i.i.d. Gaussian noise \(\varepsilon_i(t)\) added to the latent regression part.
Absolute tolerance used in the fixed-point iteration that solves the spatial autoregressive operator equation (stopping rule on the sup-norm of successive iterates).
Maximum number of fixed-point iterations. Prevents infinite looping when strong spatial feedback and small tol interact.
Ufuk Beyaztas, Han Lin Shang, and Gizel Bakicierler Sezer
The generator mimics the penalised SFoFR set-up:
$$ Y_i(t) \;=\; \sum_{j=1}^{n} w_{ij}\int_0^1 Y_j(u)\,\rho(t,u)\,du \;+\; \int_0^1 X_i(s)\,\beta(t,s)\,ds \;+\; \varepsilon_i(t), $$
where
\(w_{ij}\) are row-normalised inverse-distance weights,
\(X_i(s)\) is built from Fourier scores \(\xi_{ijk} \sim \mathcal{N}(0,1)\) and damped basis functions \(\phi_k^{\cos}(s)=(k^{-3/2})\sqrt{2}\cos(k\pi s)\) and \(\phi_k^{\sin}(s)=(k^{-3/2})\sqrt{2}\sin(k\pi s)\),
the regression surface is \(\beta(t,s)=2+s+t+0.5\sin(2\pi s t)\),
the spatial autocorrelation surface is \(\rho(t,u)=rf\,(1+ut)/(1+|u-t|)\),
\(\varepsilon_i(t)\stackrel{\text{i.i.d.}}{\sim}\mathcal{N}(0,\sigma^2)\), with \(\sigma=\code{sd.error}\).
Given the contraction condition
\(\|\rho\|_\infty < 1/\|W\|_\infty\), the Neumann series defining
\((\mathbb{I}-\mathcal{T})^{-1}\) converges and the solution is obtained by
simple fixed-point iterations until the change is below tol. Full
details are in Beyaztas, Shang and Sezer (2025).
Beyaztas, U., Shang, H. L., and Sezer, G. B. (2025). Penalised Spatial Function-on-Function Regression. Journal of Agricultural, Biological, and Environmental Statistics, in press.
# \donttest{
# generate a toy data set
dat <- sff_dgp(n = 250, rf = 0.5)
# }
Run the code above in your browser using DataLab