scale.TSdata: Scale Methods for TS objects

Description Usage Arguments Value See Also Examples

Description

Scale data or a model by a given factor.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
    ## S3 method for class 'TSdata'
scale(x, center=FALSE, scale=NULL)
    ## S3 method for class 'TSestModel'
scale(x, center=FALSE, scale=NULL)
    ## S3 method for class 'ARMA'
scale(x, center=FALSE, scale=NULL)
    ## S3 method for class 'innov'
scale(x, center=FALSE, scale=NULL)
    ## S3 method for class 'nonInnov'
scale(x, center=FALSE, scale=NULL)
    
    checkScale(x, scale)
    ## S3 method for class 'TSestModel'
checkScale(x, scale)
    ## S3 method for class 'TSmodel'
checkScale(x, scale)
    

Arguments

x

TSdata, TSmodel or an object containing these.

center

to match generic arguments, not currently used.

scale

A list with two matrices or vectors, named input and output, giving the multiplication factor for inputs and outputs. Vectors are treated as diagonal matrices. scale$input can be NULL if no transformation is to be applied (or the data or model has no input.)

Value

The resulting data or model is different from the original in proportion to scale. ie. if S and T are output and input scaling matrices then y'(t) = S y(t) where y' is the new output u'(t) = S u(t) where u' is the new input

For models the result has inputs and outputs (and innovations) which are scaled as if data scaling had been applied to them as above. Thus if the input and output scales are diagonal matrices or scalars the plot of the predictions and residuals for l(scale(model,scale=somescale), scale(data, scale=somescale)) while have the same appearance as l(model, data) but will be scaled differently.

See Also

scale

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    data("eg1.DSE.data.diff", package="dse")
    # This is a simple example. Usually scale would have something 
    # to do with the magnitude of the data.
    z <- scale(eg1.DSE.data.diff, 
        scale=list(input=rep(2, nseriesInput(eg1.DSE.data.diff)), 
                  output=rep(2,nseriesOutput(eg1.DSE.data.diff))))
    model <- estVARXls(eg1.DSE.data.diff)
    model <- scale(model, 
        scale=list(input=rep(2, nseriesInput(eg1.DSE.data.diff)), 
                  output=rep(2,nseriesOutput(eg1.DSE.data.diff))))

dse documentation built on March 26, 2020, 7:12 p.m.