Matrix with NAs
Posted: Fri Feb 19, 2016 11:58 am
Hi,
I would like to produce a TxN matrix from a set of N individual series. The issue is that there are time periods with NAs in each of the series. I want to keep track of the NAs in the matrix.
To solve the problem, I tried two possibilities (below), but neither worked. The output is a TxN matrix pricesmat. The individual series with the NAs are stored as subcomp{!j}_pc, where j=1,...,N indexes each individual series.
Thank you.
ATTEMPT 1. Error is 'Pricesmat(T,1) is an illegal or reserved name'
matrix(T,N) pricesmat = @zeros(T,N)
for !j = 1 to N
stomna(subcomp{!j}_pc,pricesmat(T,!j))
next
ATTEMPT 2. Error is 'Nonumeric argument in subcomp1_v'
matrix(T,N) pricesmat = @zeros(T,N)
for !j = 1 to N
vector(T) subcomp{!j}_v
stomna(subcomp{!j}_pc,subcomp{!j}_v)
pricesmat(T,!j) = subcomp{!j}_v
next
I would like to produce a TxN matrix from a set of N individual series. The issue is that there are time periods with NAs in each of the series. I want to keep track of the NAs in the matrix.
To solve the problem, I tried two possibilities (below), but neither worked. The output is a TxN matrix pricesmat. The individual series with the NAs are stored as subcomp{!j}_pc, where j=1,...,N indexes each individual series.
Thank you.
ATTEMPT 1. Error is 'Pricesmat(T,1) is an illegal or reserved name'
matrix(T,N) pricesmat = @zeros(T,N)
for !j = 1 to N
stomna(subcomp{!j}_pc,pricesmat(T,!j))
next
ATTEMPT 2. Error is 'Nonumeric argument in subcomp1_v'
matrix(T,N) pricesmat = @zeros(T,N)
for !j = 1 to N
vector(T) subcomp{!j}_v
stomna(subcomp{!j}_pc,subcomp{!j}_v)
pricesmat(T,!j) = subcomp{!j}_v
next