Generate 2D functional data for simulation studies
generate_2d_po_functional_data.Rd
Creates synthetic 2D functional data with optional noise components and different coefficient patterns. Uses Simpson's rule for accurate integration.
Arguments
- n
Number of samples to generate.
- grid_x
Number of points in x-axis grid. Default is 20.
- grid_y
Number of points in y-axis grid. Default is 20.
- noise_sd
Standard deviation of measurement noise. Default is 0.015.
- rsq
Desired R-squared value for the response. Default is 0.95.
- beta_type
Type of coefficient surface ("saddle" or "exp"). Default is "saddle".
- response_type
Type of the response variable ("gaussian" or "binomial"). Default is "gaussian".
- a1
Optional fixed value for first stochastic component. If provided, a2 must also be provided.
- a2
Optional fixed value for second stochastic component. If provided, a1 must also be provided.
- sub_response
Number of intervals for Simpson integration. Default is 50.
- n_missing
Number of holes in every curve.
- min_distance_x
Length of the holes in the x axis.
- min_distance_y
Length of the holes in the y axis.
Value
A list containing:
surfaces: List of n true (noiseless) surfaces
noisy_surfaces: List of n observed (noisy) surfaces
response: Vector of n response values
grid_x: x-axis grid points
grid_y: y-axis grid points
beta: True coefficient surface
stochastic_components: Matrix of a1 and a2 values used for each surface