Learn R Programming

widals (version 0.6.2)

stnd.Ht: Standardize Temporal Covariates

Description

Standardize temporal covariates with respect to both the spacial and time dimensions

Usage

stnd.Ht(Ht, n)

Value

A \(\tau\) x \(p_t\) numeric matrix.

Arguments

Ht

Temporal covariates (of supporting sites). A \(\tau\) x \(p_t\) numeric matrix.

n

Number of sites. A positive scalar integer.

See Also

stnd.Hs, stnd.Hst.ls.

Examples

Run this code

##### Please see the examples in Hst.sumup


## The function is currently defined as
function (Ht, n) 
{
    h.mean <- apply(Ht, 2, mean)
    sHt <- t(t(Ht) - h.mean)
    sHt <- t(t(sHt)/apply(sHt, 2, function(x) {
        sqrt(sum(x^2))
    }))
    sHt <- sHt * sqrt(nrow(Ht)/n)
    return(sHt)
  }

Run the code above in your browser using DataLab