## ## MAT5. Needed Matrix with Dimensions 47 x 5, Got 210 x 5 I

Use this forum for posting example programs or short bits of sample code.

### ## MAT5. Needed Matrix with Dimensions 47 x 5, Got 210 x 5 I

Dear Tom,

When I run the code below, I receive the following error message. Could you please tell me what I do wrong? Attached to this post you will find the dataset and the code.

compute optlag=3
system(model=panelmod)
variables gdp cpi ir hp dc
lags 1 to optlag
det gdpdum{1 to optlag} cpidum{1 to optlag} irdum{1 to optlag} \$
hpdum{1 to optlag} dcdum{1 to optlag} \$
audum bedum cadum chdum dkdum esdum fidum nzdum gedum iedum itdum jpdum sadum nodum swedum ukdum usdum
end(system)
estimate(print,outsigma=omegares) start end resids(1) coeffs(1)

compute starte=1977:2
compute ende=2017:4

compute nobs=ende-starte+1
dis nobs
compute nreg=nvars*optlag
compute nregt = nreg*2.0+17+nobs
dec rect coefm(fix(nregt),nvars)
dec rect coefmm(fix(nregt),nvars)
ewise coefm(i,j) = %modelgetcoeffs(panelmod)(i,j)

do j=1,nvars
do i=1,fix(nreg)
compute coefmm(i,j) = coefm(i,j)+coefm(nreg+i,j)
end do i
end do j
do j=1,nvars
do i=fix(nreg+1),fix(nregt)
compute coefmm(i,j) = 0.0
end do i
end do j

compute %modelsetcoeffs(panelmod,coefmm)

Last edited by tyzellar on Sat Jul 09, 2022 4:05 pm, edited 1 time in total.
tyzellar

Posts: 11
Joined: Tue May 17, 2022 7:32 am

### Re: ## MAT5. Needed Matrix with Dimensions 47 x 5, Got 210 x

Code: Select all
`system(model=panelmod)variables gdp cpi ir hp  dclags 1 to optlagdet gdpdum{1 to optlag} cpidum{1 to optlag} irdum{1 to optlag} \$ hpdum{1 to optlag}  dcdum{1 to optlag} \$audum bedum cadum chdum dkdum esdum fidum nzdum gedum iedum itdum jpdum sadum nodum swedum ukdum usdumend(system)estimate(print,outsigma=omegares) start end resids(1) coeffs(1)compute starte=1977:2compute ende=2017:4compute nobs=ende-starte+1dis nobscompute nreg=nvars*optlagcompute nregt = nreg*2.0+17+nobs`

Where are you getting the value for NREGT? I don't see where you get NREG*2 and there isn't anything with a NOBS dimension in the definition for PANELMOD.
TomDoan

Posts: 7236
Joined: Wed Nov 01, 2006 5:36 pm

### Re: ## MAT5. Needed Matrix with Dimensions 47 x 5, Got 210 x

Dear Tom, I found the mistake. Thank you a thousand times for your reply!! I really appreciate it!
tyzellar

Posts: 11
Joined: Tue May 17, 2022 7:32 am

### Who is online

Users browsing this forum: No registered users and 3 guests