# coef.midas_r: Extract coefficients of MIDAS regression In midasr: Mixed Data Sampling Regression

## Description

Extracts various coefficients of MIDAS regression

## Usage

 ```1 2``` ```## S3 method for class 'midas_r' coef(object, midas = FALSE, term_names = NULL, ...) ```

## Arguments

 `object` `midas_r` object `midas` logical, if `TRUE`, MIDAS coefficients are returned, if `FALSE` (default), coefficients of NLS problem are returned `term_names` a character vector with term names. Default is `NULL`, which means that coefficients of all the terms are returned `...` not used currently

## Details

MIDAS regression has two sets of cofficients. The first set is the coefficients associated with the parameters of weight functions associated with MIDAS regression terms. These are the coefficients of the NLS problem associated with MIDAS regression. The second is the coefficients of the linear model, i.e the values of weight functions of terms, or so called MIDAS coefficients. By default the function returns the first set of the coefficients.

## Value

a vector with coefficients

Vaidotas Zemlys

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```#Simulate MIDAS regression n<-250 trend<-c(1:n) x<-rnorm(4*n) z<-rnorm(12*n) fn.x <- nealmon(p=c(1,-0.5),d=8) fn.z <- nealmon(p=c(2,0.5,-0.1),d=17) y<-2+0.1*trend+mls(x,0:7,4)%*%fn.x+mls(z,0:16,12)%*%fn.z+rnorm(n) eqr<-midas_r(y ~ trend + mls(x, 0:7, 4, nealmon) + mls(z, 0:16, 12, nealmon), start = list(x = c(1, -0.5), z = c(2, 0.5, -0.1))) coef(eqr) coef(eqr, term_names = "x") coef(eqr, midas = TRUE) coef(eqr, midas = TRUE, term_names = "x") ```

midasr documentation built on Feb. 23, 2021, 5:11 p.m.