ICSS Variance Break Procedure (revised)

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.

ICSS Variance Break Procedure (revised)

Postby TomDoan » Thu May 05, 2011 11:22 am

This is a revised version of the ICSS procedure for searching for breaks in variance using the algorithm described in Inclan and Tiao, "Use of Cumulative Sums of Squares for Retrospective Detection of Changes in Variance", JASA 1994, vol 89, pp 913-923. This uses a .05 significance level for determining whether to add another break to the ones already detected, that is, a break isn't listed unless it's significant at the .05 level or better.

icss.src
Procedure file (requires RATS 7.3 or later)
(6.01 KiB) Downloaded 266 times


@ICSS x start end

Parameters

x is the series being analyzed
start to end is the range (by default, the defined range of x).

Options

BREAKS=(output) VECT[INT] of entries with breaks located
[PRINT]/NOPRINT
TRACE/[NOTRACE]

The new features are the three options, in particular the BREAKS option, which allows you to retrieve the break points for continued analysis, rather than having to read them out of the table.

Example

This is from the original Inclan and Tiao paper.

Code: Select all
*
* Replication file for Inclan and Tiao, "Use of Cumulative Sums of
* Squares for Retrospective Detection of Changes in Variance", JASA
* 1994, vol 89, pp 913-923
*
* Note that the entry numbers are off by one from those given in the
* article. This is because RATS is basing entry numbers on the start of
* the original stock price series, not on the start of the log
* differenced data.
*
data(unit=input) 1 369 ibm
 460 457 452 459 462 459 463 479 493 490 492 498 499 497 496
 490 489 478 487 491 487 482 479 478 479 477 479 475 479 476
 476 478 479 477 476 475 475 473 474 474 474 465 466 467 471
 471 467 473 481 488 490 489 489 485 491 492 494 499 498 500
 497 494 495 500 504 513 511 514 510 509 515 519 523 519 523
 531 547 551 547 541 545 549 545 549 547 543 540 539 532 517
 527 540 542 538 541 541 547 553 559 557 557 560 571 571 569
 575 580 584 585 590 599 603 599 596 585 587 585 581 583 592
 592 596 596 595 598 598 595 595 592 588 582 576 578 589 585
 580 579 584 581 581 577 577 578 580 586 583 581 576 571 575
 575 573 577 582 584 579 572 577 571 560 549 556 557 563 564
 567 561 559 553 553 553 547 550 544 541 532 525 542 555 558
 551 551 552 553 557 557 548 547 545 545 539 539 535 537 535
 536 537 543 548 546 547 548 549 553 553 552 551 550 553 554
 551 551 545 547 547 537 539 538 533 525 513 510 521 521 521
 523 516 511 518 517 520 519 519 519 518 513 499 485 454 462
 473 482 486 475 459 451 453 446 455 452 457 449 450 435 415
 398 399 361 383 393 385 360 364 365 370 374 359 335 323 306
 333 330 336 328 316 320 332 320 333 344 339 350 351 350 345
 350 359 375 379 376 382 370 365 367 372 373 363 371 369 376
 387 387 376 385 385 380 373 382 377 376 379 386 387 386 389
 394 393 409 411 409 408 393 391 388 396 387 383 388 382 384
 382 383 383 388 395 392 386 383 377 364 369 355 350 353 340
 350 349 358 360 360 366 359 356 355 367 357 361 355 348 343
 330 340 339 331 345 352 346 352 357
*
set ldiff = log(ibm/ibm{1})
@ICSS ldiff 2 369
Attachments
inclantiao.rpf
Example program
(1.96 KiB) Downloaded 68 times
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: ICSS Variance Break Procedure (revised)

Postby avalokita » Mon Sep 19, 2011 7:39 pm

Dear TomDoan:

I use WinRats Pro 7.10 but I cannot utilize this procedure well.
At first, when I ran the procedure, I got a error message stating
## SX22. Expected Type INTEGER, Got REAL Instead
>>>>endl,lbreaks(k+1))<<<<

I thought it may be a type conversion problem, so i add function FIX in front of every %if,
but I am not certain weather it is proper.

Another problem is about the use of "report".
Code: Select all
compute ltitle="ICSS Analysis of Series "+%l(x)
report(use=ireport,action=define,title=ltitle)


The reference document doesn't mention the "title" option, so i modified it to hlabels.
But the result are not presented on the report window. Instead, it is shown on the output window.

Would u please teach me how to handle with these problems?
The procedure you provide is really an excellent tool and i am seeking to write an icss-h algorithm.
avalokita
 
Posts: 13
Joined: Mon Sep 19, 2011 3:36 am

Re: ICSS Variance Break Procedure (revised)

Postby TomDoan » Tue Sep 20, 2011 9:21 am

avalokita wrote:Dear TomDoan:

I use WinRats Pro 7.10 but I cannot utilize this procedure well.
At first, when I ran the procedure, I got a error message stating
## SX22. Expected Type INTEGER, Got REAL Instead
>>>>endl,lbreaks(k+1))<<<<

I thought it may be a type conversion problem, so i add function FIX in front of every %if,
but I am not certain weather it is proper.


That will work.

avalokita wrote:Another problem is about the use of "report".
Code: Select all
compute ltitle="ICSS Analysis of Series "+%l(x)
report(use=ireport,action=define,title=ltitle)


The reference document doesn't mention the "title" option, so i modified it to hlabels.
But the result are not presented on the report window. Instead, it is shown on the output window.

Would u please teach me how to handle with these problems?
The procedure you provide is really an excellent tool and i am seeking to write an icss-h algorithm.


Take the TITLE option off the REPORT instruction.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: ICSS Variance Break Procedure (revised)

Postby timkrause » Fri Jul 13, 2012 11:05 pm

Hello,

I am trying to use this procedure, but since this is my first attempt at using RATS source code, I'm having some trouble. I modified the code to match my sample size, and the program started to run, but after 1 hour, I halted it and received the following error messages:

## M6. User Abort
The Error Occurred At Location 135, Line 16 of ICSS1AND2
Called From Location 269, Line 30 of ICSS

Would you please let me know what other modifications I need to make to the code to get it to run? I've attached my modified code as well as my test data set.

Thanks, as always!

Tim
Attachments
iwm_mdy_spy_040912_rats.xlsx
(35.92 KiB) Downloaded 49 times
icss_etfs_070712.RPF
(6.16 KiB) Downloaded 57 times
timkrause
 
Posts: 8
Joined: Tue Nov 29, 2011 10:10 pm

Re: ICSS Variance Break Procedure (revised)

Postby TomDoan » Sat Jul 14, 2012 8:21 am

Don't try to change the procedures - it's already designed to adapt to the data. This is all you need:

OPEN DATA "\\DELL28GHZ\MyDocuments\UTSA\Research\CRSP Data\CRSP New ETFs APR 2012\iwm_mdy_spy_040912_rats.xlsx"
DATA(FORMAT=XLSX,NOLABELS,ORG=COLUMNS,TOP=2) 1 580 DATE R1 R2 R3
set x = r1
@ICSS x 1 580
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: ICSS Variance Break Procedure (revised)

Postby timkrause » Sat Jul 14, 2012 12:35 pm

Thanks Tom! I read CH 15 of the UG last night and am looking forward to using/writing more procedures.

Tim
timkrause
 
Posts: 8
Joined: Tue Nov 29, 2011 10:10 pm

Re: ICSS Variance Break Procedure (revised)

Postby charbel » Fri May 10, 2013 2:37 pm

Hi Tom,

I am trying to run the ICSS Variance Break Procedure on RATS v.7 but it does not work. Once I run the program, the following error appears:
## SX9. REPORT is not a Basic Data Type
>>>>local report <<<<
On the forum it is posted that it works only with v.7.3 and above. Is there any possible modifications that I can make to the procedure to adapt it to RATS v.7?
I appreciate your help.
Best,
Charbel
charbel
 
Posts: 6
Joined: Mon Oct 08, 2007 3:35 am

Re: ICSS Variance Break Procedure (revised)

Postby TomDoan » Fri May 10, 2013 3:04 pm

charbel wrote:Hi Tom,

I am trying to run the ICSS Variance Break Procedure on RATS v.7 but it does not work. Once I run the program, the following error appears:
## SX9. REPORT is not a Basic Data Type
>>>>local report <<<<
On the forum it is posted that it works only with v.7.3 and above. Is there any possible modifications that I can make to the procedure to adapt it to RATS v.7?
I appreciate your help.
Best,
Charbel


There's a version of this that will run on RATS v7 that you can get off the procedure browser, though you may already have that on your RATS distribution:

http://www.estima.com/procs_perl/510/icss.src

However, it doesn't have some of the options described above. I wouldn't recommend trying to make this version 7 compatible. It's not merely a matter of getting rid of the local report.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: ICSS Variance Break Procedure (revised)

Postby charbel » Fri May 10, 2013 3:27 pm

Thank you for your quick reply Tom. I'll use the one I have in RATS distribution for the moment. I guess it is time to move to RATSv8. Best
charbel
 
Posts: 6
Joined: Mon Oct 08, 2007 3:35 am


Return to RATS Procedures

Who is online

Users browsing this forum: No registered users and 2 guests

cron