Learn R Programming

dse (version R2000.6-1)

scale.TSdata: Scale Methods for TS objects

Description

Scale data or a model by a given factor.

Usage

scale(obj, scale)

Arguments

obj
TSdata, TSmodel or an object containing these.
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

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,somescale), scale(data, somescale)) while have the same appearance as l(model, data) but will be scaled differently.

See Also

scale

Examples

Run this code
if(is.R()) data("eg1.DSE.data.diff", package="dse1")
	# This is a simple example. Usually scale would have something 
	# to do with the magnitude of the data.
	z <- scale(eg1.DSE.data.diff, 
	    list(input=rep(2, input.dimension(eg1.DSE.data.diff)), 
		output=rep(2,output.dimension(eg1.DSE.data.diff))))
	model <- est.VARX.ls(eg1.DSE.data.diff)
	model <- scale(model, 
	    list(input=rep(2, input.dimension(eg1.DSE.data.diff)), 
		output=rep(2,output.dimension(eg1.DSE.data.diff))))

Run the code above in your browser using DataLab