RATS 10.1
RATS 10.1

CSET( options )  cseries start end = function(T)

Performs general transformations of complex series

Parameters

cseries

result complex series

start, end

range of entries to be computed (default 1 to the FREQUENCY length)

function(T)

expression to be evaluated for entry T of cseries

Options

These are for compatibility with SET, but are rarely useful for CSET.

 

FIRST=complex expression/FRML

special value or FRML (if the value of start affects the calculation) for entry start. Use this only if the first entry uses a different calculation from the others. (This is not common in frequency domain calculations).

 

SCRATCH/[NOSCRATCH]

use scratch space - compute all then copy

 

SMPL=Standard SMPL option [not used]

 

STARTUP=expression/FRML evaluated at period <<start>>

provides an expression which is computed only for the first entry of the range, and before function(T) is computed. This can be a FRML of any type.

Description

This sets the values of entries start to end of cseries by evaluating the function at each of the entries, substituting for T the number of the entry being set.

 

To get entry T of complex series n, use %Z(T,n). There are several specialized functions which are handy for computing functions of frequency ordinates:


 

%UNIT(x)

returns \(\exp (ix)\) for the real number \(x\)

%UNIT2(t1,t2)

returns \(\exp \left( { - i\,2\pi \left( {t1 - 1} \right)/t2} \right)\) for \(t1\) and \(t2\) integers. \(t1\) is usually T. With \(t2\) equal to the number of frequencies, this maps the unit circle as T runs from 1 to \(t2\).

%ZLAG(t,x)

returns \(\exp \left( { - i\,2\pi \left( {t - 1} \right)x/N} \right)\) where \(N\) is the number of frequencies that you have specified on FREQUENCY. As \(t\) runs from 1 to \(N\), this gives the appropriate Fourier transform for the lag operator \(L^x\).

Examples

cset 4 = %z(t,3)/%csqrt(%z(t,1)*%z(t,2))

 

Sets series \({4_t} = {3_t}/\sqrt {{2_t}*{1_t}} \)


 

cset 3 = %z(t,3)*%z(t,4)

cset 3 = %z(t,3)*%conjg(%z(t,4))

 

The first makes series 3 equal to series 3 multiplied by the conjugate of series 4, while the second makes 3 equal to 3 multiplied by 4 (without conjugation).


 

cset 3 = %unit2(t,400)

cset 3 = %cexp(%cmplx(0.0,2*%pi*(t-1)/400.)

cset 3 = %cmplx(cos(2*%pi*(t-1)/400.),sin(2*%pi*(t-1)/400.))


 

Any of these makes entry t of series 3 =  \(\exp \left( {2\pi {\kern 1pt} i{\kern 1pt} \left( {t - 1} \right)/400} \right)\)


 

cset 5 = c=%cmplx(1.0,0.0),%do(i,1,%size(b),c=c+b(i)*%zlag(t,i)),c

 

Makes series 5 equal to the transfer function for \(1 + b(1)L + b(2){L^2} + b(3){L^3} + b(4){L^4}\) if the dimension of B is 4. Writing it this way allows the number of lags in the polynomial to be changed quickly by changing the size of the lag VECTOR.


 

cset(scratch) 3 = %z(t,3)/%z(1,3)

 

Replaces series 3 by itself normalized so that entry 1 is 1.0. The SCRATCH option is needed because entry 1 will be overwritten before it gets used to compute entries from 2 on.

 


Copyright © 2025 Thomas A. Doan