Thread Subject:
Loop Subscripted assignment dimension mismatch, HP Filter

Subject: Loop Subscripted assignment dimension mismatch, HP Filter

From: Charles-Antoine

Date: 12 Aug, 2012 22:45:07

Message: 1 of 2

Hello,

I am trying to loop the Hodrick Prescott Filter in order to see its performance in a dynamic environent. Unfortunately I have the "Subscripted assignment dimension mismatch" error and I can't figure it out.

If I replace the HP filter by something else like the mean or median, the loop works perfectly...

MALength =

   750
length =

       10001
HPresearch(4,MALength:end) = PriceActionsMatrix(1,MALength:end)-PriceActionsMatrix(2,MALength:end);

size( HPresearch(4,MALength:end))
ans =

           1 9252
           
for i=MALength:length;
    HPresearch(6,i) = hpfilter(HPresearch(4,i-500:i),5);
end

Your help help be greatly appreciated. Thanks a lot in advance!

Charles

Subject: Loop Subscripted assignment dimension mismatch, HP Filter

From: Charles-Antoine

Date: 13 Aug, 2012 02:22:06

Message: 2 of 2

For people who are interest I found the solution:
http://ideas.repec.org/c/dge/qmrbcd/181.html





"Charles-Antoine" wrote in message <k09blj$dua$1@newscl01ah.mathworks.com>...
> Hello,
>
> I am trying to loop the Hodrick Prescott Filter in order to see its performance in a dynamic environent. Unfortunately I have the "Subscripted assignment dimension mismatch" error and I can't figure it out.
>
> If I replace the HP filter by something else like the mean or median, the loop works perfectly...
>
> MALength =
>
> 750
> length =
>
> 10001
> HPresearch(4,MALength:end) = PriceActionsMatrix(1,MALength:end)-PriceActionsMatrix(2,MALength:end);
>
> size( HPresearch(4,MALength:end))
> ans =
>
> 1 9252
>
> for i=MALength:length;
> HPresearch(6,i) = hpfilter(HPresearch(4,i-500:i),5);
> end
>
> Your help help be greatly appreciated. Thanks a lot in advance!
>
> Charles

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
loop Charles-Antoine 12 Aug, 2012 18:49:10
rssFeed for this Thread

Contact us