To clarify my problem written in the previous email, I am adding results from Gretl. I run following script:
"loop i=1..94 --progressive --quiet 
    genr  ECT1 = ECT*(time <= i)
    genr  ECT2 = ECT-ECT1
    ols   D_ARM ECT1 ECT2 D_FRN1 D_ARM1
    genr  LF = $lnl
    store "C:\Users\Svanidze\Desktop\LF.gdt" LF
endloop"

I received following outcome:
? loop i=1..94 --progressive --quiet
> genr    ECT1 = ECT*(time <= i)
> genr    ECT2 = ECT-ECT1
> ols      D_ARM   ECT1   ECT2   D_FRN1   D_ARM1
> genr    LF = $lnl
> store "C:\Users\Svanidze\Desktop\LF.gdt" LF
> endloop
progressive loop: model must be of constant size
>> ols D_ARM ECT1 ECT2 D_FRN1 D_ARM1

It does not produce outcome. Something is wrong there. Could you suggest what to do?

Best, 
Miranda

On Mon, May 18, 2015 at 1:33 PM, Miranda Svanidze <miranda.svanidze@gmail.com> wrote:
OK, I see. I should explain more.

Actually, I sent you all script (or idea how I see it) to you. What I need is to run OLS with Y being depended variable and ECT1, ECT2, X, diff_Y and diff_X being independent variables. In my estimation ECT is threshold variable. Each value from this time series is considered as threshold, which splits ECT in two parts: ECT1 and ECT2. How optimal threshold is chosen? for this, technically I must run my OLS regression as many times, as many potential thresholds are there from ECT series. Optimal one is the one, which coincides to the maximum value of Profile Likelihood function. Doing so manually (splitting ECT for its every value and performing corresponding OLS regression) is really hard and almost endless process. If you will help me to build such script which will iterate process with any possible threshold value (I mean, running OLS with different ECT1 and ECT2 and extracting Profile Likelihood estimates from every OLS regression) would be very supportive to me. Could you help? 
Please, let me know If I should clarify more.

Thanks in advance!
Best, 
Miranda

On Mon, May 18, 2015 at 1:18 PM, Miranda Svanidze <miranda.svanidze@gmail.com> wrote:
Thank you for your reply! 
Indeed, my uploaded file, which you can't open. I just copy text from file here that you can read:

I want to build script (with loop programming) which will calculate just entire profile likelihood function in Gretl. The other estimations I can perform myself. 
Here is my request formulated below: 
# Model: TVECM (Threshold Vector Error Correction Model)
# Name of my variables: dependent variable - Y (Price on market 1); independent variables - X (Price on market 2) and ECT (Error correction term)
# My data sample runs from 2006:10 to 2014:08
# First, I need to generate variables "difference of Y", "difference of X", "Lagged value of ECT", "lagged value of diff_Y", and "lagged value of diff_X"
# "Lagged value of ECT" is my threshold variable - Threshold value must come from it. 
# My final target is to calculate the entire profile likelihood function of ols regression and save results in a separate file (let's say "LF.gdt")
# Below is my guess how the process must be solved. Could you adjust it to my data and help me to complete it?
------------script----------------
loop i=................. --progressive --quiet
    genr  ...........................
    ols ...............................
    genr LF = $lnl
    store "C:\.....\.....\......\LF.gdt" LF
endloop

Best, 
Miranda


On Mon, May 18, 2015 at 12:06 PM, Riccardo (Jack) Lucchetti <r.lucchetti@univpm.it> wrote:
On Mon, 18 May 2015, Miranda Svanidze wrote:

Hello,
I am new here.
My problem is following: I want to calculate entire profile likelihood
function (and then find maximum value) in order to find threshold estimate
and run TVECM model. Therefore I want to build script (with loop
programming) which will calculate just entire profile likelihood function
in Gretl. The other estimations I can perform myself.
Here is my request formulated below:
# Model: TVECM (Threshold Vector Error Correction Model)
# Name of my variables: dependent variable - Y (Price on market
1); independent variables - X (Price on market 2) and ECT (Error correction
term)
# My data sample runs from 2006:10 to 2014:08
# First, I need to generate variables "difference of Y", "difference of X",
"Lagged value of ECT", "lagged value of diff_Y", and "lagged value of
diff_X"
# "Lagged value of ECT" is my threshold variable - Threshold value must
come from it.
# My final target is to *calculate the entire profile likelihood function
of ols regression and save results in a separate file* (let's say "LF.gdt")
# Below is my guess how the process must be solved. Could you adjust it to
my data and help me to complete?
------------script----------------
loop i=2006:10..2014:08 --progressive --quiet
   genr
   ols
   genr LF = $lnl
   store "C:\.....\.....\......\LF.gdt" LF
endloop

Thank you!
Kind regards,
Miranda

I'm sorry, you'll have to be more explicit that this. Posting your complete script would be much better; from what you posted I don't understand what you're trying to do, let alone what the problem is.


-------------------------------------------------------
  Riccardo (Jack) Lucchetti
  Dipartimento di Scienze Economiche e Sociali (DiSES)

  Università Politecnica delle Marche
  (formerly known as Università di Ancona)

  r.lucchetti@univpm.it
  http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users