Learn R Programming

CepReg (version 0.1.3)

ols_get: Ordinary Least Squares Estimator for Log-Spectral Regression

Description

Performs OLS regression to estimate the association between covariates and cepstral coefficients.

Usage

ols_get(X, f, frq, nbase)

Value

A list containing:

alph

Intercept vector.

bet

OLS coefficient matrix.

spechat

Estimated smoothed log-spectra.

res

Matrix of residuals.

Arguments

X

A numeric matrix of predictors (N x P).

f

A numeric matrix of cepstral coefficients.

frq

A vector of frequencies in [0,1].

nbase

Number of Fourier basis functions.

Examples

Run this code
frq <- seq(0, 1, length.out = 16)[2:8]
n <- 10
p <- 3
nbase <- 5
X <- matrix(rnorm(n * p), n, p)
f <- matrix(rnorm(n * nbase), n, nbase)

ols_result <- ols_get(X, f, frq, nbase)

Run the code above in your browser using DataLab