border_augmentation {surreal} | R Documentation |
Transform Data by Adding a Border
Description
This function transforms the input data by adding points around the original data to create a frame. It uses an optimization process to find the best alpha parameter for point distribution, which helps in making the fitted values and residuals orthogonal.
Usage
border_augmentation(x, y, n_add_points = 40, verbose = FALSE)
Arguments
x |
Numeric vector of x coordinates. |
y |
Numeric vector of y coordinates. |
n_add_points |
Integer. Number of points to add on each side of the frame. Default is |
verbose |
Logical. If |
Value
A matrix with two columns representing the transformed x
and y
coordinates.
Examples
# Simulate data
x <- rnorm(100)
y <- rnorm(100)
# Append border to data
transformed_data <- border_augmentation(x, y)
# Modify par settings for plotting side-by-side
oldpar <- par(mfrow = c(1, 2))
plot(x, y, pch = 16, main = "Original data")
plot(transformed_data[, 1], transformed_data[, 2], pch = 16, main = "Transformed data")
# Restore original par settings
par(oldpar)
[Package surreal version 0.0.1 Index]