Learn R Programming

glmmrBase (version 1.1.0)

hsgp_rescale: Rescales data to [-1,1]

Description

Rescales data to [-1,1] for HSGP model fitting

Usage

hsgp_rescale(data, columns)

Value

A copy of the input data frame with rescaled columns

Arguments

data

A data frame

columns

Vector of integers. The indexes of the columns to be rescaled.

Details

The HSGP covariance function requires that all dimensions are scaled to [-1,1] as conversion is not automatic. This function will rescale the D covariance variables to [-1,1]^D while preserving their size relative to one another.

Examples

Run this code
df <- data.frame(x = runif(100,0,2), y = runif(100, -2,2))
df <- hsgp_rescale(df, 1:2)

Run the code above in your browser using DataLab