Re: [Scilab-users] Matrix copy

2012-10-16 Thread Eric Dubois
stacksize('max') may help.

Éric
Le 16 oct. 2012 12:21, "Anton Julio"  a écrit :

> Hi,
> I'm using IPD and SIVP, This is my code
>
> Im = imread('C:\Users\Pictures\Lion2.png');
>
> [h,l,c]=size(Im);
> Im2 = zeros(h,l,c);
> for m = 1 : 76
> for i = 1*m : 8*m
> for j = 1 : 16
> for k = 1 : 3
>  Im2(i,j,k)= Im(i,j,k);
> end;
> end;
> end;
> end;
> imshow(Im2);
>
> and error message
>
>  !--error 17
> : stack size exceeded (Use stacksize function to increase it).
> at line 100 of function generic_i_hm called by :
> at line   5 of function %i_i_hm called by :
> Im2(i,j,k)=a;
> at line  17 of exec file called by :
> exec('C:\Users\Pictures\Mosaic.sce', -1)
>
> Thank you
>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] max of matric colums - vectorization

2012-12-13 Thread Eric Dubois
Maybe max(A,'r') is what you atd looking for.

Éric
Le 13 déc. 2012 23:14, "Paul Carrico"  a écrit :

> All,
>
> ** **
>
> Maybe I’m too tired to find a so easy solution, but I don’t understand why
> the code herebellow does not work .. I want to find the max of each column
> while each I’ve the max of the complete matrix (???)
>
> ** **
>
> i is a vector 
>
> ** **
>
> Paul
>
> ** **
>
> #
>
> *A** = rand(5,20)*
>
> *i**=**[**1** : 20]*
>
> * *
>
> *B**=**zeros**(**1**,**20**)***
>
> *B**(**i**)** = max(A(:,i))*
>
> ** **
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] plot a tree

2013-01-05 Thread Eric Dubois
Hello and happy new year to all!

I am looking for a graphic function plotting a tree (in the spirit of, but
not nessarily strictly equivalent to, matlab function treeplot).

I have neither found it in Scilab, in Stéphane MOTTELET's plotting library,
nor on the web.

Does nevertheless such a function exist?

Thanks!

Éric.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-10 Thread Eric Dubois
Dear Eric.

Could be more precise on the model you want to estimate? (The term
"Markov-switching model" is a generic one: you have to define the law of
your data under the regimes as well as the number of regimes you want to
estimate).

Anyway, there is another Scilab toolbox performing Markov-switching models
(HMM), but it does not seem to be maintained. And I think you will not find
other Scilab ressources corresponding to this kind of models.

Éric.

2013/1/9 ericdoblas 

> Hello all,
>
> I am using Markov Switching Model (MSM) to detect turning points. I can´t
> use Bry Boschan or Harding Pagan. I must use MSM. I don´t understand the
> manual´s instructions for Grocer. Specifically, I don´t understand all
> steps
> of the routine on grocer. So, I need a routine for MSM on Grocer.
>
> Thank you very much who can help me
> Eric Doblas
> Argentina
>
>
> This is the data:
>
> DateGDP LGDP
> I 93216370,1113 12,2847457
> II 93   241871,8584 12,39616335
> III 93  242645,5224 12,3993569
> IV 93   245132,4288 12,40955387
> I 94232945,3257 12,35855905
> II 94   257476,8946 12,45868527
> III 94  253467,7781 12,44299199
> IV 94   257341,5437 12,45815945
> I 95237968,1031 12,37989192
> II 95   248093,6393 12,42156153
> III 95  242214,6991 12,3975798
> IV 95   244467,9646 12,40683956
> I 96236566,0366 12,37398267
> II 96   260751,9252 12,47132476
> III 96  262166,9638 12,47673685
> IV 96   267020,0467 12,49507902
> I 97256387,8567 12,45444664
> II 97   281769,8008 12,54884571
> III 97  284092,2675 12,55705435
> IV 97   287515,3456 12,56903151
> I 98271702,3677 12,51246251
> II 98   301207,5978 12,61
> III 98  293315,4036 12,58900377
> IV 98   286267,8493 12,56468319
> I 99265024,6359 12,48757807
> II 99   286412,3269 12,56518775
> III 99  278472,6935 12,53707528
> IV 99   283566,3992 12,55520159
> I 00264555,9181 12,48580792
> II 00   285275,1759 12,56120952
> III 00  276767,971  12,53093478
> IV 00   278091,6764 12,53570611
> I 01259199,8739 12,46535476
> II 01   284795,7629 12,55952758
> III 01  263126,5054 12,4803902
> IV 01   248864,5552 12,42466407
> I 02216849,495  12,28695882
> II 02   246314,6332 12,41436499
> III 02  237416,8668 12,37757281
> IV 02   240361,3921 12,38989887
> I 03228595,8824 12,33971102
> II 03   265402,4777 12,48900274
> III 03  261534,5226 12,47432157
> IV 03   268560,9668 12,50083323
> I 04254330,4234 12,44638958
> II 04   284375,6106 12,55805122
> III 04  284392,0599 12,55810906
> IV 04   293467,0606 12,58952068
> I 05274594,5026 12,52305075
> II 05   313927,2903 12,65691668
> III 05  310593,0805 12,64623891
> IV 05   319939,2408 12,67588638
> I 06298695,5617 12,60718015
> II 06   338243,7275 12,731522
> III 06  337741,8852 12,73003723
> IV 06   347578,7074 12,75874641
> I 07322448,8712 12,68369986
> II 07   367492,3517 12,81445779
> III 07  367538,7276 12,81458397
> IV 07   379199,6613 12,84581816
> I 08349945,3229 12,7655322
> II 08   396227,2401 12,88974316
> III 08  393039,23   12,88166471
> IV 08   394564,9401 12,88553902
> I 09357096,4155 12,7857611
> II 09   393181,2789 12,88202605
> III 09  391678,8883 12,87819762
> IV 09   404860,9562 12,91129897
> I 10381221,6341 12,8511362
> II 10   439766,5937 12,9939994
> III 10  425323,1724 12,96060456
> IV 10   442208,8085 12,99953747
> I 11419023,1666 12,94568149
> II 11   479963,6782 13,08146571
> III 11  464882,753  13,04954051
> IV 11   474414,821  13,06983737
> I 12440884,2806 12,99653772
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-10 Thread Eric Dubois
Sorry, but maybe you could be a little bit more explicit: I have not the
paper immediately available and Hamilton (1989) page 7 does not as such
speak very much...

Éric.

2013/1/10 ericdoblas 

> Dear Éric,
>
> Thank you for your answer. Specifically, I need estimate a MSM as in
> Hamilton (1989), as follows:
>
>   (page 7).
>
> Thank you very much!
>
> Greetings from Argentina!
>
> Eric Doblas 
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635p4025642.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-10 Thread Eric Dubois
Dear Eric.

I have done my best to make Grocer ms programs use easy (help files, manual
and demos: did you have a look at the ms_reg_d.sci, ms_var_d.sci demos?).

So tell me what you do not understand?

Éric.

2013/1/10 ericdoblas 

> That´s ok Éric. Thank you!
>
> I will try to be more specific. In the chapter 23 (Grocer´s Manual) you
> wrote about MSM. I need estimate the most general model (ms_reg) and the
> two
> particulars cases: ms_mean and ms_var, for data sent in the first mail...
>
> Excuse me if the consultation is very elemental, but recently I am starting
> with Grocer MSM. I think that is a excellent tool for Scilab. Rigth now, I
> am investing time to learn .
>
> Thank you very much!
>
> Eric Doblas
> CONICET - Argentina
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635p4025645.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-11 Thread Eric Dubois
To load data, you have many solutions. For time series I recommend to store
your data in a .txt file, transform the dates in a suitable format (that is
1993q1, 1993q2, etc.), set the name of the corresponding column to "dates"
and use impexc2bd (see impexc2bd). And have a look at chapter 5 of the
manual (as well as chapters 1, 2 and 3  which can also be helpful before
starting any econometric estimation).

For the second question, using one of the functions ms_var, ms_reg or
ms_mean indicates that you are estimating a Markov-switching model: there
rare not other steps inovolved!

Lastly, I do not understand what you mean by "conditioning the var-cov
matrix"; if by this, you mean that the var-cov matrix is different
according to the state of the economy, then give as 3rd argument of
function ms_mean of 5th argument of function ms_reg the number of states
you assumes the economy can experience (this is what is done in the example
provided in ms_reg_d() with the instruction :"switch_var=2 // variances are
switching").

Éric.


PS : turnpoints is a subroutine used by the brybos program, therefore not
relevant for Markov-switching estimation

2013/1/10 ericdoblas 

> Dear Éric,
>
> The following information is  in you example, but I have a lot of doubts,
> for exmple:
>
>
> - How to load the data?
> - How indicate it is MSM?
>
>
> I hope you can help me!!
>
> Thank you very much!
>
> Eric Doblas
>
>
> function [bcp,bct] = turnpoints(y,k)
>
> // PURPOSE: rough selection of peaks and troughs indexes
> //-
> // INPUT:
> // . y = vector of data
> // . k = x(t-i)>x(t) & x(t+i)>x(t), i=1:k defines a trough at t
> //   x(t-i) //-
> // OUTPUTS :
> // . bcp = vector of peak indexes
> // . bct = vector of trough indexes
> //-
> // Translated to Scilab by E. Michaux (2005)
> // from Julien Matheron
> // Banque de France, centre de recherche, sept. 2002
>
> [T,n] = size(y);
> if Ty = y';
>[T,n] = size(y);
> end;
> v = zeros(T,n);
>
> // --
> // I. Defines the k-dependent logical
> // argument of the following "if-loops"
> // --
>
> s_up = "(y(i)>y(i-1))";
> s_do = "(y(i)
> for step = 2:k;
>s_up = joinstr(s_up,msprintf("&(y(i)>y(i-%d))",step),'+');
>s_do = joinstr(s_do,msprintf("&(y(i) end;
>
> for step=1:k
>s_up = joinstr(s_up,msprintf("&(y(i)>y(i+%d))",step),'+');
>s_do = joinstr(s_do,msprintf("&(y(i) end;
>
>
> // --
> // II. Defines peaks
> // --
>
> for i = k+1:T-k ;
>if evstr(s_up) then
>   v(i) = 1;
>end;
> end
> bcp = find(v>0)'; // selects indexes such that a peak occurs
>
> // --
> // III. Defines troughs
> // --
>
> v = zeros(T,n); // reinitializes v
>
> for i = k+1:T-k
>if evstr(s_do) then
>   v(i) = 1 ;
>end;
> end;
> bct = find(v>0)'; // selects indexes such that a trough occurs
> endfunction
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635p4025649.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-11 Thread Eric Dubois
Take the file transformed as joined, store it say in folder c:/gdp and run
unde scilab
-->impexc2bd('c:\gdp\exemple.txt',';','c:\gdp\exemple.dat')

and do not forget to load the database:
--> load('c:\gdp\exemple.dat')

and run:
-->GDP

Éric.





2013/1/11 ericdoblas 

> Thank you Éric!
>
> Tha last consulting: Could you give me a example (or routine) to load my
> data (the first mail)?
>
> Best Regards
>
> Eric Doblas
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635p4025653.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
dates;GDP;LGDP
1993Q1;216370.1113;12.2847457
1993Q2;241871.8584;12.39616335
1993Q3;242645.5224;12.3993569
1993Q4;245132.4288;12.40955387
1994Q1;232945.3257;12.35855905
1994Q2;257476.8946;12.45868527
1994Q3;253467.7781;12.44299199
1994Q4;257341.5437;12.45815945
1995Q1;237968.1031;12.37989192
1995Q2;248093.6393;12.42156153
1995Q3;242214.6991;12.3975798
1995Q4;244467.9646;12.40683956
1996Q1;236566.0366;12.37398267
1996Q2;260751.9252;12.47132476
1996Q3;262166.9638;12.47673685
1996Q4;267020.0467;12.49507902
1997Q1;256387.8567;12.45444664
1997Q2;281769.8008;12.54884571
1997Q3;284092.2675;12.55705435
1997Q4;287515.3456;12.56903151
1998Q1;271702.3677;12.51246251
1998Q2;301207.5978;12.61
1998Q3;293315.4036;12.58900377
1998Q4;286267.8493;12.56468319
1999Q1;265024.6359;12.48757807
1999Q2;286412.3269;12.56518775
1999Q3;278472.6935;12.53707528
1999Q4;283566.3992;12.55520159
2000Q1;264555.9181;12.48580792
2000Q2;285275.1759;12.56120952
2000Q3;276767.971;12.53093478
2000Q4;278091.6764;12.53570611
2001Q1;259199.8739;12.46535476
2001Q2;284795.7629;12.55952758
2001Q3;263126.5054;12.4803902
2001Q4;248864.5552;12.42466407
2002Q1;216849.495;12.28695882
2002Q2;246314.6332;12.41436499
2002Q3;237416.8668;12.37757281
2002Q4;240361.3921;12.38989887
2003Q1;228595.8824;12.33971102
2003Q2;265402.4777;12.48900274
2003Q3;261534.5226;12.47432157
2003Q4;268560.9668;12.50083323
2004Q1;254330.4234;12.44638958
2004Q2;284375.6106;12.55805122
2004Q3;284392.0599;12.55810906
2004Q4;293467.0606;12.58952068
2005Q1;274594.5026;12.52305075
2005Q2;313927.2903;12.65691668
2005Q3;310593.0805;12.64623891
2005Q4;319939.2408;12.67588638
2006Q1;298695.5617;12.60718015
2006Q2;338243.7275;12.731522
2006Q3;337741.8852;12.73003723
2006Q4;347578.7074;12.75874641
2007Q1;322448.8712;12.68369986
2007Q2;367492.3517;12.81445779
2007Q3;367538.7276;12.81458397
2007Q4;379199.6613;12.84581816
2008Q1;349945.3229;12.7655322
2008Q2;396227.2401;12.88974316
2008Q3;393039.23;12.88166471
2008Q4;394564.9401;12.88553902
2009Q1;357096.4155;12.7857611
2009Q2;393181.2789;12.88202605
2009Q3;391678.8883;12.87819762
2009Q4;404860.9562;12.91129897
2010Q1;381221.6341;12.8511362
2010Q2;439766.5937;12.9939994
2010Q3;425323.1724;12.96060456
2010Q4;442208.8085;12.99953747
2011Q1;419023.1666;12.94568149
2011Q2;479963.6782;13.08146571
2011Q3;464882.753;13.04954051
2011Q4;474414.821;13.06983737
2012Q1;440884.2806;12.99653772
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-11 Thread Eric Dubois
What if you change the comma in your file into a dot (the dot is the
decimal separator in Scilab)?

Éric.

PS:
1) if you use the file I have sent to you, then LPIB is equivalent to LnPBI
you want to load into Scilab
2) and log(GDP) too!

2013/1/11 ericdoblas 

> Hello Éric,
>
> I need only one step, because I was able to replicate your example.
>
> I can load the data:
>
> "Dates;LnPBI"
> "1993q1;12,2847456986185"
> "1993q2;12,3961633542544"
> "1993q3;12,3993569016157" .. so on.
>
> Then, I used impexc2bd, and after that, I loaded .dat file. But, I can´t
> run
> LnPBI.
>
> Thank you!
>
> Eric
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Grocer-Markov-Switching-Model-tp4025635p4025656.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-11 Thread Eric Dubois
try:
-->r=ms_reg('100*lpbi-lagts(2,lpbi)',['100*(lagts(1,lpbi)-lagts(3,lpbi))';'100*(lagts(2,lpbi)-lagts(4,lpbi))';'100*(lagts(3,lpbi)-lagts(5,lpbi))'],'cte',nb_states,switch_var,var_opt,'transf=stud','prt=initial;final')

(you had 2 typos in your command)

Éric.

2013/1/11 ericdoblas 

>
> r=ms_reg('100*lpbi-lagts(2,lpbi))','['100*(lagts(1,lpbi)-lagts(3,lpbi))';'100*(lagts(2,lpbi)-lagts(4,lpbi))';'100*(lagts(3,lpbi)-lagts(5,lpbi))'],'cte',nb_states,switch_var,var_opt,'transf=stud','prt=initial;final')
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer / Markov Switching Model

2013-01-11 Thread Eric Dubois
Correction: what I propose is correct from a syntaxical point a view but
nonsensical from an economic one. Run rather:

-->
r=ms_reg('100*(lpbi-lagts(2,lpbi))',['100*(lagts(1,lpbi)-lagts(3,lpbi))';'100*(lagts(2,lpbi)-lagts(4,lpbi))';'100*(lagts(3,lpbi)-lagts(5,lpbi))'],'cte',nb_states,switch_var,var_opt,'transf=stud','prt=initial;final')

Éric.

2013/1/11 Eric Dubois 

> try:
>
> -->r=ms_reg('100*lpbi-lagts(2,lpbi)',['100*(lagts(1,lpbi)-lagts(3,lpbi))';'100*(lagts(2,lpbi)-lagts(4,lpbi))';'100*(lagts(3,lpbi)-lagts(5,lpbi))'],'cte',nb_states,switch_var,var_opt,'transf=stud','prt=initial;final')
>
> (you had 2 typos in your command)
>
> Éric.
>
> 2013/1/11 ericdoblas 
>
>>
>> r=ms_reg('100*lpbi-lagts(2,lpbi))','['100*(lagts(1,lpbi)-lagts(3,lpbi))';'100*(lagts(2,lpbi)-lagts(4,lpbi))';'100*(lagts(3,lpbi)-lagts(5,lpbi))'],'cte',nb_states,switch_var,var_opt,'transf=stud','prt=initial;final')
>>
>
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] How to start with several variables in AUTOMATIC function of GROCER

2013-02-19 Thread Eric Dubois
Dear Samuel.

The error can be explained easily: one of the main principles of the
program automatic is to find the best model that passes specification
tests, that is tests that the residuals can be considered as white noise
and that the model is stable (through standard Chow tests). And the Chow
test estimates a number of coefficients equal to twice the number of
exogenous varaibles (that is 12 coefficients with only 9 points!)

As explained in chapter 15 of  the manual (page 8-9), available on my web
site (http://dubois.ensae.net/grocer.html), you can overcome this
difficulty by reducing the set of specification tests. For instance:
--> automatic(nc, x,'test=doornhans')
works.

This is at the expense of the philisophy of the program...

Éric.

2013/2/19 Samuel Enibe 

> Dear sir,
>
> I would like to employ the AUTOMATIC function in GROCER toolbox to perform
> automatic regression starting with a rather LARGE set of variables and
> ending with the few that are most significant. However, I have noticed the
> following problems using the example attached:
>
> 1. Programme works with only 3 initial variables specified (see line 30 in
> attached file), which works, but line 31 with only 6 starting variables
> complains of TOO MANY EXOGENOUS VARIABLES
> 2. When it runs with 3 starting variables, the R2 value is not specified.
> How can I get this calculated and used.
> 3. The help files included with the AUTOMATIC package does not seem to
> answer these questions.
>
> ANY ASSISTANCE WILL BE GREATLY APPRECIATED
>
>
> --
> Samuel Ogbonna Enibe
> BEng (Nig), MSc (Reading, England), PhD (Nig)
> Professor of Mechanical Engineering
> Director, National Centre for Equipment  Maintenance & Development
> University of Nigeria, Nsukka, Nigeria
> Tel: +2348063646798
> Email: samuel.en...@unn.edu.ng
>  enibe...@yahoo.com
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] About the function ms_var in GROCER

2013-03-31 Thread Eric Dubois
Hello.

What do you mean exactly by: "it encounters an error when 5 variables are
included."? Please, send data and code so that I can see what is tour
problem.

Eric.

PS: you will have to wait a little bit for help by myself, because I take a
plane tomorrow.


2013/3/31 lihnyaa 

> hello all,
>
> I am using Éric Dubois' GROCER to estimate a MSVAR and I came across a
> problem about the function ms_var.
> The simplest call to ms_var takes the following form:
> ms_var(typvar,p,endo,MS_M,MS_M_V,MS_var_opt ). And the function really
> works well when there are only 4 endogenous variables in the VAR, but it
> encounters an error when 5 variables are included.
> 
> I'm not good at programming, so help is needed.
> Thank you very much.
>
> And I can use msvar_irf to get the impulse response fuction, but there are
> two kind of irf, named 'full' and 'partial'. So What is the difference
> between them. Does the 'full' mean exact impulse–response function and the
> 'partial' is regime dependent impulse response function(the function is
> conditional on a
> given regime prevailing at the time of the disturbance and throughout the
> duration of the response).
>
> And thanks very much again.
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/About-the-function-ms-var-in-GROCER-tp4026408.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] About the function ms_var in GROCER

2013-04-01 Thread Eric Dubois
Hello.

For me it works (see the file estim_5variables.txt attached). I am working
with Grocer 1.56 under Scialb 5.4.0 and Windows 7: is it the case for you.

Anywa, file MSVAR_Constraint.sci also attach may help correct the error you
have encountered (at least, ms_var should not lead to the error message you
had...); to use it, store it into a folder (say c:/newgrocer) and load it
into Scilab by running:
--> getd('c:/newgrocer')

Éric.


2013/4/1 lihnyaa 

> The attachment is the data I use. canns1.dat
> 
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/About-the-function-ms-var-in-GROCER-tp4026408p4026417.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
Initial statistical moments and parameters   
 
 =Initial real and transformed parameters, para_m and 
param_init:==   
 
0.06992010.5174729  
  - 0.09441320.4764142  
0.02860410.0286041  
  - 1.0042623  - 1.0042623  
0.43996360.4399636  
0.02600330.0260033  
  - 3.0080104  - 3.0080104  
15.77335415.773354  
  - 0.0039443  - 0.0039443  
0.72062180.7206218  
0.04195660.0419566  
0.00375060.0037506  
0.02020320.0202032  
0.76075380.7607538  
0.00587860.0058786  
  - 0.0093643  - 0.0093643  
0.99835170.9983517  
  - 0.0003832  - 0.0003832  
0.02506030.0250603  
  - 0.0518977  - 0.0518977  
0.05411200.0541120  
  - 0.0008583  - 0.0008583  
0.04869930.0486993  
0.96761830.9676183  
  - 0.6099630  - 0.6099630  
2.10597892.1059789  
0.00727840.0072784  
0.05127960.0512796  
  - 0.0043994  - 0.0043994  
0.00076340.0007634  
0.99127770.9912777  
  - 0.1764949  - 0.1764949  
  - 0.0869307  - 0.0869307  
  - 0.6468239  - 0.6468239  
0.45084740.4508474  
0.01769910.0176991  
  - 3.5536921  - 3.5536921  
16.77554516.775545  
  - 0.0055584  - 0.0055584  
0.64854420.6485442  
0.05168710.0516871  
0.00425000.0042500  
0.02895860.0289586  
0.96222100.9622210  
0.00875620.0087562  
0.02735980.0273598  
0.99297640.9929764  
  - 0.0006226  - 0.0006226  
0.03625730.0362573  
  - 0.2209711  - 0.2209711  
  - 0.0298299  - 0.0298299  
0.11680030.1168003  
0.06995060.0699506  
0.98034150.9803415  
  - 0.8335095  - 0.8335095  
2.58175952.5817595  
0.00711340.0071134  
0.05978280.0597828  
  - 0.0065145  - 0.0065145  
0.00017180.0001718  
0.99442270.9944227  
  - 0.2021340  - 0.2021340  
0.26183400.0685570  
  - 0.00346530.120  
  - 0.0006818  - 0.002  
0.00345910.001  
  - 0.00182180.033  
0.01914040.0003664  
  - 0.0003208  - 7.813D-08  
0.00065101.892D-09  
0.3135.306D-11  
0.01144590.002  
  - 0.00146110.021  
  - 0.00131730.017  
0.45825020.0001673  
0.00064962.127D-09  
0.01221093.309D-08  
0.30873120.054  
  - 0.0060214  - 1.309D-08  
  - 0.0014013  - 1.745D-09  
  - 0.00233650.054  
  - 0.00148450.022  
0.02170900.021  
0.00037009.220D-09  
0.00036742.528D-10  
0.00010601.459D-08  
0.01233106.803D-09  
  - 0.0012294  - 1.164D-08  
  - 0.0008206  - 7.241D-10  
0.43739090.044  
0.00059320.004  
0.01129460.0001276  
 
 rows(param)   
 
92.  
 
 
 
 ==Initial matrix of transition markovian probabilities, 
ptrans_init:==   
 
0.51747290.4764142  
0.48252710.5235858  
 
 
 
 ==Initial switching regressors (or intercepts), Beta 
:==   
 
0.0286041  - 0.0869307  
  - 1.0042623  - 0.6468239  
0.43996360.4508474  
0.02600330.0176991  
  - 3.0080104  - 3.5536921  
15.77335416.775545  
  - 0.0039443  - 0.0055584  
0.72062180.6485442  
0.04195660.0516871  
0.00375060.0042500  
0.02020320.0289586  
0.76075380.9622210  
0.00587860.0087562  
  - 0.00936430.0273598  
0.99835170.9929764  
  - 0.0003832  - 0.0006226  
0.02506030.0362573  
  - 0.0518977  - 0.2209711  
0.0541120  - 0.0298299  
  - 0.00085830.1168003  
0.04869930.0699506  
0.96761830.9803415  
  - 0.6099630  - 0.8335095  
2.10597892.5817595  
0.00727840.0071134  
0.05127960.0597828  
  - 0.0043994  - 0.0065145  
0.00076340.0001718  
0.99127770.9944227  
  - 0.1764949  - 0.2021340  
 
 
 
 ==Initial ergodic state

Re: [Scilab-users] Interpretation of Banerji test result

2013-04-10 Thread Eric Dubois
Hello Mike.

This is right. More precisely, at a standard 5% level, you accept the
hypothesis that the turning_test series has a lead of 3 periods over the
turning_reference series and you reject the hypothesis of a 4 periods lead
(but you should accept at a 1% level).

Éric.


2013/4/10 Mike 

> Dear All
>
> I am not an expert in Scilab or statistics, however I got into a situation
> where I need to work with it.
>
> I used the Banerji test to figure out if my test series is leading the
> reference series and I got this result:
>
> ---
>
> rba =
>
> banerji(turning_reference('P'),turning_reference('T'),turning_test('P'),turning_test('T'))
>
>  Banerji test of leading profile
> H0 : no k-periods leading of competing series
>
> # of extra-cycle in the reference series detected: 0
>
> H0   sum  rejection prob.
> k<1 21 99.804688
> k<2  12   98.4375
> k<3  370.3125
> k<4  -6   3.90625
>
>  *
>   * *
>
>  rba  =
>
>
>  Banerji test estimation results
>
> ---
>
> Am I right when I interpret this output as a fact that my test series is
> leading for k<1 and k<2?
>
> Thank you for your help.
>
> Mike
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Interpretation-of-Banerji-test-result-tp4026503.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Interpretation of Banerji test result

2013-04-25 Thread Eric Dubois
Hello Mike

Here is Emmnauel's answer (he is the author of the programm):

Let "sum" be the sum of actual difference in timing at turns of series S1
against  S2. The test is the following
H0: sum = 0
H1: sum > 0

The idea of the test is to built all the possible outcomes (ie all the
different "sum") by randomization
and then to test what is the probability of the observed (or more extreme)
outcome. So what we
get is P( >= sum under H0). The rejection probability is built as 1-P( >=
sum under H0) and gives
the confidence level at which the null can be rejected. It can be seen as
the risk of acception
H0 while H0 is false

Let's look at your results (see below). The first line is the following test
H0 : S1 leads S2 by k=0  which we wrote as H0 : k<1. Under H0 the
probability
to observe a sum at least  greated 21 is 0.2%, such that we can reject H0
with a confidence
level of  99.8%.

The test can be performed in a sequential way, starting for the maximum lead
to be tested.  In your case for 4 leads, H0 : S1 leads S2 by k=0, we have
P( >= sum under H0) = 96.1%. Meaning that risk of accepting H0 while H0 is
true
is below 5%




Éric.


2013/4/23 Mike 

> Thank you for your answer!
>
> However, I don't understand why there is a lead of 3 periods at a standard
> 5% level.
>
> Isn't it 100% - 5% = 95%?
>
> That means in return that i accept the hypothesis as long as the rejection
> prob. higher than 95% is?
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Interpretation-of-Banerji-test-result-tp4026503p4026587.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
<>___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] interpolating varargin into calls within my function

2013-09-11 Thread Eric Dubois
Hello.

plot(x(1:64),y(1:64),varargin(:))

should work.

Éric
Le 12 sept. 2013 00:20, "matt bruensteiner"  a
écrit :

> Hi,
>
> I'm sure this has been asked before, but I'm finding it very difficult to
> search out the answer.
>
> I created a function:
>
> function plotfirst64(x, y, varargin)
> plot(x(1:64), y(1:64), varargin );
> endfunction
>
> My intention is that the varargin arguments to my function should become
> arguments to plot, allowing me to control the plot appearance when calling
> my function. Obviously, SciLab doesn't work that way and if I try to use
> the varargin, those arguments are ignored.
>
> For example, I do `ploteye(x, y, "thickness", 2)` or `ploteye(x, y, "r-")`
> and the plot still comes out with the default line style.
>
> Searching online I found that Matlab has a syntax that should do what I
> want like this:
>
> function plotfirst64(x, y, varargin)
> plot(x(1:64), y(1:64), varargin{:} );
>
> But that doesn't seem to work in SciLab either.
>
> How can I pass varargin arguments through to a function called inside my
> function?
>
> Thanks,
>
> Matt
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Double y-axis on a single plot!

2013-09-26 Thread Eric Dubois
Hello.

In my toolbox grocer, available on Atoms or my web site,
dubois.ensae.net/grocee.html, you will find a function pltseries that
provides this, among manu other things.

Éric
Le 26 sept. 2013 23:05, "Debola Abduljeleel"  a écrit :

>
> Hi everyone,
> Please how can I plot a graph with 2 y-axes i.e. Left & right with just
> one single x-axis.
> Regards.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Double y-axis on a single plot!

2013-09-26 Thread Eric Dubois
Sorry, there is a smartphone induced full. The link is
dubois.ensae.net/grocer.html

Éric
Le 27 sept. 2013 08:33, "Carrico, Paul"  a
écrit :

> The link doesn’t work
>
> ** **
>
> *De :* users-boun...@lists.scilab.org [mailto:
> users-boun...@lists.scilab.org] *De la part de* Eric Dubois
> *Envoyé :* vendredi 27 septembre 2013 08:09
> *À :* International users mailing list for Scilab.
> *Objet :* Re: [Scilab-users] Double y-axis on a single plot!
>
> ** **
>
> Hello.
>
> In my toolbox grocer, available on Atoms or my web site,
> dubois.ensae.net/grocee.html, you will find a function pltseries that
> provides this, among manu other things.
>
> Éric
>
> Le 26 sept. 2013 23:05, "Debola Abduljeleel"  a
> écrit :
>
>
> Hi everyone,
> Please how can I plot a graph with 2 y-axes i.e. Left & right with just
> one single x-axis.
> Regards.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
> 
>
>
> Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
> personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail 
> par erreur, veuillez contacter immédiatement l'expéditeur et effacer le 
> message de votre système. Toute divulgation, copie ou distribution de cet 
> e-mail est strictement interdite.
>
> This email and any files transmitted with it are confidential and intended 
> solely for the use of the individual or entity to whom they are addressed. If 
> you have received this email in error, please contact the sender and delete 
> the email from your system. If you are not the named addressee you should not 
> disseminate, distribute or copy this email.
>
>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] evaluate error on each parameter calculated with leastsq

2014-02-21 Thread Eric Dubois
Hello.

You could have à look at the nls function in my toolbox Grocer, avaolable
undet Atoms ( see also my web page dubois.ensae.net/grocer.html).

Êric
Le 20 févr. 2014 08:32, "Yohann"  a écrit :

> Hi Antoine,
> thank you for your answer but
> what I need is a confidence interval on each parameter !
> Cheers
> Yohann
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/evaluate-error-on-each-parameter-calculated-with-leastsq-tp4028696p4028742.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] strange behaviour of handle property figure_size

2014-05-05 Thread Eric Dubois
Thanks Samuel.

IDNHVM ;-), since I still do not:
- why the behaviour differs from Scilab 5.4.1 to Scilab 5.5.0; is it a bug
or an intended change of behaviour? And why?
- if this betrays a bug;
- how to reocver Scilab 5.4.1 behaviour with Scilab 5.5.0.

Eric.


2014-05-04 1:38 GMT+02:00 Samuel Gougeon :

>  Hello,
>
> Le 03/05/2014 19:36, Eric Dubois a écrit :
>
> Hello.
>
>  I have encountered a strange behaviour of Scilab 5.5.0, which did not
> happen with Scilab 5.4.1.
>
>  This happened with the following sequence:
>
>  --> wind=scf()
>
>  --> wind.figure_position=[0,0]
>
>  --> screen_size=get(0,'screensize_px')
>
>  --> wind.figure_size=screen_size(3:4)
>
>  --> plot2d(1:10,1:10)
>
> With 5.5.0 on Win7_x64, the result is:
>  - the width of the window is exactly the screen's one.
>  - the window has no status bar. Resizing it (by 0) makes the bar
> appearing.
>  - the height of the window is too tall exactly by the height of its
> bottom border, in such a way that the bottom of the blank background is
> exactly at the bottom of the screen, and the border is below so not visible.
>  - the plot is displayed, but with almost no bottom margin : X labels are
> displayed at the very bottom of the screen
>
> (before  this, the OS task bar has been moved on the vertical right, in
> order to see the bottom of the screen).
>
> HTH
> Samuel
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] GROCER VAR-HMM Example Output Different from Chapter 23

2014-05-20 Thread Eric Dubois
Hello Brian

Sorry for this late answer, but I have been quite busy these days.

I did not notice the problem with this version of the MS programs. Indeed I
have changed the optimization device of all GROCER programs and I have not
adapted the defaults for the MS programs.

If you run:
--> global GROCERDIR;
--> load(GROCERDIR+'\data\us_revu.dat')
--> bounds('1967m4','2004m2')

--> nb_states=2
--> switch_var=2 // variances are switching
--> var_opt=3 // unrestricted var-cov matrix

-->
r=ms_var('cte',3,'100*(log(us_revu)-lagts(2,log(us_revu)))',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
(see chapter 6 of the manual for explanations)

Then the results of the ms_var demo is restaured.

I will change the default in Grocer next version .

Regards.

Éric.


2014-05-19 12:56 GMT+02:00 Brian Bouterse :

> Hi Scilab community!
>
> I'm new to Scilab, and the AR-HMM and VAR-HMM solving capabilities of
> GROCER are what interest me.
>
> I have a question relating to Chapter 23 from the GROCER manual[0].  This
> is the univariate MS-AR(3) solved using the function ms_reg_d() on the
> us_revu.dat data included with GROCER.  I have made no adjustment from the
> example statements in Chapter 23.
>
> The example output is shown on pages 4 and 5 of the Chapter 23 module.
>  Compare that against the output I receive.
>
> http://fpaste.org/102978/14004958/
>
> Here are my questions:
>
> 1.  The numerical output is completely different.  I expected it to be the
> same since the data is provided by GROCER, and I've done the example
> exactly as shown in Chapter 23.  Is there some explanation to why the
> solved solution I receive is different than the example output in the
> chapter?
>
> 2.  I see output like %i*8.4469016 which seems like an error because %i
> looks like a variable that yet needs to be replaced, and then multiplied to
> get to its final value.  Is this some kind of bug or error?
>
> Thanks for any help the community can provide.  We'll be using this for a
> seminar on HMM, AR-HMM, and VAR-HMM at North Carolina State University.
>  I'm also a developer, so I really appreciate all the effort that has been
> put into scilab and GROCER.
>
> Thanks,
> Brian
>
>
> [0]:  http://dubois.ensae.net/Grocer_manual_v1.6.zip
>
>
> --
> Brian Bouterse
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] GROCER VAR-HMM Example Output Different from Chapter 23

2014-05-23 Thread Eric Dubois
Dear Brian

1) For me it works fine; I suspect that you have run ms_var with your data
after having run with the manual example. I expect that if you reopen
Scialb and run your problem, starting from load('arhmm_example.dat'), it
will work. A good advice anyway is to set the bounds before each estimation
or to run:
--> bounds()
if you want to use the greatest available time span with your data
2) I agree; indeed the example in the manual as well as yours are
univariate, but ms_var also works with multivariate series (I have run some
tests which worked well)
3) If you want to contribute, do not hesitate to send me code (at
grocer.tool...@gmail.com or grocer.tool...@free.fr); add your copyright; if
you can create a help file it would still be better (I have some tools do
help doing that if you want them); and if you can add to the manual, it
would be marvellous!
If you want to imporve the docs you are also welcome; I can sned you the
OpenOffice files you need if you find it suitable

Éric.



2014-05-23 14:13 GMT+02:00 Brian Bouterse :

> Thanks for the reply Eric. It is great to get hints and suggestions from
> the author directly!
>
> I used the commands that you outlined, and they were able to reproduce the
> expected output verbatim, which is great. Thanks for clearing that up for
> me. I've gotten further towards my goal.
>
> I've now got three questions:
>
> 1)  I get an unexpected result when I run ms_var() on my own data. I run
> these commands:
>
> load('arhmm_example.dat')
> nb_states=2
> switch_var=2 // variances are switching
> var_opt=3 // unrestricted var-cov matrix
>
> r=ms_var('cte',3,'ardata',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> I receive this output:
>
> WARNING: in overlay, series number 2 has been ignored because of a bad
> frequency
>  !--error 1
> series ends before the end date of the bounds
> at line  39 of function ts2vec0 called by :
> at line 101 of function explone called by :
> at line 253 of function ms_var called by :
>
> r=ms_var('cte',3,'ardata',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> The arhmm_example.dat file is available here[0], and it was made by
> running.the following command on the original csv[1] file arhmm_example.csv.
>
> impexc2bd('arhmm_example.csv', ';', 'arhmm_example.dat')
>
> I believe I either don't have the dates configured correctly, or it
> requires a specific number of data points to match the frequency value,
> which also may be wrong. Do you have some insight into this error message?
> I've been reading the docs on the ts structure, and I will continue to try
> to solve this roadblock.
>
>
> 2) My goal in doing all this is to analyze Autoregressive Hidden Markov
> Models. As I understand it, the VAR-HMM that ms_var provides is a
> multivariate case of an Autoregressive Hidden Markov Model. The terms
> Markov Switching Model, and Hidden Markov Model refer to the same thing.
> Using a single variable with ms_var() as I show above in the example, will
> simulate an AR-HMM(3). I would like to check if these statements agree with
> your understanding.
>
>
> 3) How could I contribute to the grocer code. At the very least I could
> improve the docs some.
>
>
> [0]:
> https://s3.amazonaws.com/dfsklfdsklfds/fdsjkfsdjkfds/arhmm_example.dat
> [1]:
> https://s3.amazonaws.com/dfsklfdsklfds/fdsjkfsdjkfds/arhmm_example.csv
>
> Thanks,
> Brian
>
>
> On Tue, May 20, 2014 at 3:55 PM, Eric Dubois wrote:
>
>> Hello Brian
>>
>> Sorry for this late answer, but I have been quite busy these days.
>>
>> I did not notice the problem with this version of the MS programs. Indeed
>> I have changed the optimization device of all GROCER programs and I have
>> not adapted the defaults for the MS programs.
>>
>> If you run:
>> --> global GROCERDIR;
>> --> load(GROCERDIR+'\data\us_revu.dat')
>> --> bounds('1967m4','2004m2')
>>
>> --> nb_states=2
>> --> switch_var=2 // variances are switching
>> --> var_opt=3 // unrestricted var-cov matrix
>>
>> -->
>> r=ms_var('cte',3,'100*(log(us_revu)-lagts(2,log(us_revu)))',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>> (see chapter 6 of the manual for explanations)
>>
>> Then the results of the ms_var demo is restaured.
>>
>> I will change the default in Grocer next version .
>>
>> Regards.
>>
>> Éric.
>>
>>
>> 2014-05-19 12:5

Re: [Scilab-users] GROCER VAR-HMM Example Output Different from Chapter 23

2014-05-29 Thread Eric Dubois
time t=0
>
> The output from http://ur1.ca/hej98 does not correspond at all with the
> values of these inputs, which means something unexpected is going on! Do
> you have insight into why scilab doesn't produce these expected numbers?
>
> 5)  One possibility is that maybe it is "working", but there isn't enough
> data for it to estimate the parameters correctly. I had koa marhn [2]
> output 10,000 observations, but I ran into trouble transforming it from a
> csv file to a dat file using impexc2bd. My input file is
> arhmm_example_1.csv [3]. I tried to convert to .dat using:
>
> impexc2bd('arhmm_example_1.csv', ';', 'arhmm_example_1.dat')
>
> I receive this output, and the .dat file in NOT created
>
>  !--error 1
> dates are entered neither in chronlogical order nor in reverseerse
> chronological order
> at line  87 of function read_dates called by :
> at line 188 of function impexc2bd called by :
> arhmm_example_1.dat'
>
> How do you transform a large .csv file to .dat? Is there some problem with
> the data file, the way I am making it?
>
> [0]:  https://s3.amazonaws.com/scilab_data_files/arhmm_example_280.dat
> [1]:  https://s3.amazonaws.com/scilab_data_files/arhmm_example_280.csv
> [2]:  https://github.com/bmbouter/koa_marhn
> [3]:  https://s3.amazonaws.com/scilab_data_files/arhmm_example_1.csv
> [4]:  https://s3.amazonaws.com/scilab_data_files/arhmm_example_1000.csv
> [5]:  https://s3.amazonaws.com/scilab_data_files/arhmm_example_1000.dat
>
> This e-mail is way to long, but I wanted to fully recap the issues I've
> considered as I use ms_var(). Thanks for any help you can provide. You can
> also find me in the #scilab channel on the OFTC IRC servers.
>
> Thanks,
> Brian
>
>
>
> On Fri, May 23, 2014 at 3:48 PM, Eric Dubois 
> wrote:
>
>> Dear Brian
>>
>> 1) For me it works fine; I suspect that you have run ms_var with your
>> data after having run with the manual example. I expect that if you reopen
>> Scialb and run your problem, starting from load('arhmm_example.dat'), it
>> will work. A good advice anyway is to set the bounds before each estimation
>> or to run:
>> --> bounds()
>> if you want to use the greatest available time span with your data
>> 2) I agree; indeed the example in the manual as well as yours are
>> univariate, but ms_var also works with multivariate series (I have run some
>> tests which worked well)
>> 3) If you want to contribute, do not hesitate to send me code (at
>> grocer.tool...@gmail.com or grocer.tool...@free.fr); add your copyright;
>> if you can create a help file it would still be better (I have some tools
>> do help doing that if you want them); and if you can add to the manual, it
>> would be marvellous!
>> If you want to imporve the docs you are also welcome; I can sned you the
>> OpenOffice files you need if you find it suitable
>>
>> Éric.
>>
>>
>>
>> 2014-05-23 14:13 GMT+02:00 Brian Bouterse :
>>
>> Thanks for the reply Eric. It is great to get hints and suggestions from
>>> the author directly!
>>>
>>> I used the commands that you outlined, and they were able to reproduce
>>> the expected output verbatim, which is great. Thanks for clearing that up
>>> for me. I've gotten further towards my goal.
>>>
>>> I've now got three questions:
>>>
>>> 1)  I get an unexpected result when I run ms_var() on my own data. I run
>>> these commands:
>>>
>>> load('arhmm_example.dat')
>>> nb_states=2
>>> switch_var=2 // variances are switching
>>> var_opt=3 // unrestricted var-cov matrix
>>>
>>> r=ms_var('cte',3,'ardata',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>>>
>>> I receive this output:
>>>
>>> WARNING: in overlay, series number 2 has been ignored because of a bad
>>> frequency
>>>  !--error 1
>>> series ends before the end date of the bounds
>>> at line  39 of function ts2vec0 called by :
>>> at line 101 of function explone called by :
>>> at line 253 of function ms_var called by :
>>>
>>> r=ms_var('cte',3,'ardata',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>>>
>>> The arhmm_example.dat file is available here[0], and it was made by
>>> running.the following command on the original csv[1] file arhmm_example.csv.
>>>
>>> impexc2bd(

Re: [Scilab-users] GROCER VAR-HMM Example Output Different from Chapter 23

2014-06-03 Thread Eric Dubois
Hello Brian.

Thank you for your feedback. I will try to make the distinction between
'cte' and 'all' more precise in the manual.

I will also think about your suggestion to put the code on a hub.

Regards.

Éric.


2014-06-03 12:21 GMT+02:00 Brian Bouterse :

> Hi Eric,
>
> Thanks for the quick and helpful reply! I adjusted the first parameter
> from 'cte' to 'all' and that produces the correct form of output, and the
> values look close to the expected values. This is great!
>
> I've read the help documents several times, but I didn't realize the
> impact of adjusting the value of the first parameter. The doc example on
> the ms_var help page describes the parameter, but the only example on that
> page uses 'cte'. There is no example with 'all' on the ms_var() help page.
> Also including some sample output may also be good there. I would like to
> contribute an example like this to the docs, manual, or help files. I think
> that would have caused me to solve my own problems instead of writing long
> e-mails.
>
> I also tried using a larger data file 10,000 observations in a column
> format, and then impexc2bd transformed the data file correctly. That is
> also solved thanks to your suggestion.
>
> I know the code is available for download, but would you ever consider
> putting a copy of the GROCER code in a repository on github.com? If it
> were in a place like that, I, and others, would have an easier time of
> contributing to the codebase instead of e-mailing patches. What do you
> think about an idea like this? Just a friendly suggestion based on what has
> worked well for me in the past. I can help put it up there, and configure
> it if that is helpful.
>
> Thanks again for making this great software, and helping me use it!
>
> Best,
> Brian
>
>
>
>
>
> On Thu, May 29, 2014 at 1:41 PM, Eric Dubois 
> wrote:
>
>> Hello Brian
>>
>> You did not recover the intial parameters because you did not estimate
>> the same model as the one you generated.
>>
>> This is because you used in ms_var the option 'cte' which means that only
>> the constant is allowed to switch: and this is why the AR coeffcients are
>> only given for 'all regimes'. I f you rather use the option 'all', then all
>> parameters are allowed to switch and the result is now consistent with the
>> parameters of the generated model, that is the true values are within the
>> confidence interval of the estimated ones. This is explained in the help
>> command (see help ms_var): may I ask you why you did not infer it from the
>> help files?
>>
>> As for the big file, I suspect it is truncated into Scilab. Can you try
>> with data in column instead of in rows?
>>
>> Éric.
>>
>>
>> 2014-05-29 13:24 GMT+02:00 Brian Bouterse :
>>
>> Hi Eric,
>>>
>>> Thanks again for the response. What you told me to do worked. If I
>>> closed Scilab, and rerun the example from my earlier e-mail, I do not see
>>> any warnings, which is good. The output I received is not what I expected
>>> in several ways, so I'll ask some more questions here. There are a lot of
>>> different questions here, but they all relate to the example below, and the
>>> use of ms_var and GROCER. Thanks in advance for any insight into the issues
>>> I am experiencing.
>>>
>>> The example:
>>>
>>> I have a file arhmm_example_280.dat [0] that was generated and loaded
>>> from arhmm_example_280.csv [1] using the following commands:
>>>
>>> impexc2bd('arhmm_example_280.csv', ';', 'arhmm_example_280.dat')
>>> load('arhmm_example_280.dat')
>>>
>>> I then run, what I expect to be a single variable, 2-regime,
>>>
>>> nb_states=2
>>> switch_var=2
>>> var_opt=3
>>>
>>>   
>>> r=ms_var('cte',3,'ardata',nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>>>
>>> I then receive this output:  http://ur1.ca/hej98
>>>
>>> 1) In the "coefficients" section of the output, the output doesn't seem
>>> to contain enough numbers to describe the expected number of outputs. The
>>> model has 2 regimes, and it is autoregressive with order 3, so I expect
>>> there to be 3 coefficients for EACH regime (regime 1 and regime 2).
>>> Instead, I see a single coefficient for Regime 1 (0.9313736) and a single
>>> coefficient for Regime 2 (8.26

Re: [Scilab-users] Test statistics with linregr function

2014-07-24 Thread Eric Dubois
Hello Samuel.

The equivalent of function linreg in Grocer is function ols (much simpler I
hope than automatic). If you still have problems with ols, what are they?

Éric.


2014-07-24 17:35 GMT+02:00 Samuel Enibe :

> Dear sir,
>
> I am using the *linregr* multiple regression  function to analyse some
> field data. I have obtained the multiple regression coefficients *b*
> built into the *stat* output variable. For each coefficient *b(i)*, I
> need to determine the standard error, Z-score, P-value and  95% confidence
> interval.
>
> How can I do this with *linregr* or any other suitable SCILAB function. I
> have found it a bit difficult using the *automatic* and similar functions
> built into the  *Grocer*  toolbox of Eric DuBois which could have been a
> way out.
>
> I will appreciate any help.
>
> Samuel Ogbonna Enibe
>
> 
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Test statistics with linregr function

2014-07-25 Thread Eric Dubois
Hello Samuel.

For the standard errors of the coefficients, they can be derived from the
results fo the regression.

You have to store these resulst in atlist, say myres as follows:
--> myres=ols([your input])

and then
--> stderr=myres('beta') ./ myres('tstat')

For the Z statistics, could you precise what you mean by that? (if ypu mean
the Student statistics, then they are already displayed on screen in the
colum t-statistics adn can be recovered as myres('tstat')

As for confidence intervals, it is a little bit more tedious but also
feasible:
--> scale=cdft("T",myres('nobs')-myres('nvar'),0.025,0.975); // from the
Student distribution takes the value acheiving the 0.05/2 lowest part of
tyhe distribution
--> conf=[myres('beta')+scale*stderr , myres('beta')-scale*stderr]
// build the 0.95 confidence interval from the coefficients and their
standard error ; note: instead of sclae you could use the -asymptotic-
value of 1.96

I will add these fetaures in a future Grocer version/.

Éric.

2014-07-24 23:56 GMT+02:00 Samuel Enibe :

> Thanks once more.
> I have been able to use the *ols* function, but there are still a few
> grey areas. It is not clear to me which of the output parameters to use in
> determining the following parameters of each regression coefficien, namely
>
> *"Standard  error",*
>
>
> *"Z", *
>
>
>
> *"95% confidence Interval" *
>
> I will appreciate any further insights.
>
> Samuel Ogbonna Enibe
>
>
> On Thu, Jul 24, 2014 at 9:42 PM, Eric Dubois 
> wrote:
>
>> Hello Samuel.
>>
>> The equivalent of function linreg in Grocer is function ols (much simpler
>> I hope than automatic). If you still have problems with ols, what are they?
>>
>> Éric.
>>
>>
>> 2014-07-24 17:35 GMT+02:00 Samuel Enibe :
>>
>>> Dear sir,
>>>
>>> I am using the *linregr* multiple regression  function to analyse some
>>> field data. I have obtained the multiple regression coefficients *b*
>>> built into the *stat* output variable. For each coefficient *b(i)*, I
>>> need to determine the standard error, Z-score, P-value and  95% confidence
>>> interval.
>>>
>>> How can I do this with *linregr* or any other suitable SCILAB function.
>>> I have found it a bit difficult using the *automatic* and similar
>>> functions built into the  *Grocer*  toolbox of Eric DuBois which could
>>> have been a way out.
>>>
>>> I will appreciate any help.
>>>
>>> Samuel Ogbonna Enibe
>>>
>>> 
>>>
>>> ___
>>> users mailing list
>>> users@lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>>
>>>
>>
>> ___
>> users mailing list
>> users@lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>>
>>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Use of automatic function without one or more specification tests

2014-08-18 Thread Eric Dubois
Hello Samuel

I don not know what you mean by "the function *automatic *runs partially",
but anyway, you can choose your specification tests with the option
'test=' as shown in example 2 of the help file for automatic.

If you want to use only the Doornik-Hansen normality test, then run (shown
with the example of the help file):
--> global GROCERDIR
--> load(GROCERDIR+'/data/bdhenderic.dat') ;
-->
results=automatic('delts(lm1-lp)','lagts(lm1-lp-ly)','delts(lp)','rnet','delts(lagts(lm1-lp))',
'delts(lagts(2,lm1-lp))','delts(lagts(3,lm1-lp))','delts(lagts(4,lm1-lp))',...
'delts(ly)','delts(lagts(1,ly))',
'delts(lagts(2,ly))','delts(lagts(3,ly))','delts(lagts(4,ly))',...
'delts(delts(lp))','delts(delts(lagts(1,lp)))','delts(delts(lagts(2,lp)))','delts(delts(lagts(3,lp)))','delts(delts(lagts(4,lp)))',...
'delts(rnet)','delts(lagts(1,rnet))','delts(lagts(2,rnet))','delts(lagts(3,rnet))','delts(lagts(4,rnet))','const',...
'test=doornhans')

Alternativley if you want to obtain the display specification test, but
without them constarining the estimation, tou can impose a 0 p-value for
these tests with option 'eta=0':
-->  
results=automatic('delts(lm1-lp)','lagts(lm1-lp-ly)','delts(lp)','rnet','delts(lagts(lm1-lp))',
'delts(lagts(2,lm1-lp))','delts(lagts(3,lm1-lp))','delts(lagts(4,lm1-lp))',...
'delts(ly)','delts(lagts(1,ly))',
'delts(lagts(2,ly))','delts(lagts(3,ly))','delts(lagts(4,ly))',...
'delts(delts(lp))','delts(delts(lagts(1,lp)))','delts(delts(lagts(2,lp)))','delts(delts(lagts(3,lp)))','delts(delts(lagts(4,lp)))',...
'delts(rnet)','delts(lagts(1,rnet))','delts(lagts(2,rnet))','delts(lagts(3,rnet))','delts(lagts(4,rnet))','const',...
'eta=0')

Éric.


2014-08-18 0:01 GMT+02:00 Samuel Enibe :

> I would like to use the *automatic* function in the Grocer SCILAB package
> to eliminate some non significant variables in a linear regression problem.
> The function *ols* runs successfully on the data. In contrast, the
> function *automatic* runs partially, suggesting that it should be run
> without the specification tests. Is there any way to eliminate one or more
> of the specification tests?
>  The user manual is not clear on this.
> Your suggestions will be highly appropriated.
>
> Samuel Enibe
> University of Nigeria, Nsukka
>
>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulation of static general equilbiirum model

2014-09-27 Thread Eric Dubois
Hi.

Well, in Scilab you will have to write a function with the text of your
equations transfroemd so that your endogenous variables appear as
corrdinates of a vector (such as param(1),..., param(8) since you have 8
endogenous variables) that takes your endogenous variables as a vector of
parameters; you can thereafter use Scilab function fsolve that solves a
system of n non linear equations with n unknown variables.

This a very manual way to proceed. In particular, you have to handle the
time dimension by hand. I am currently working on a somehow industrialized
version of that (not achieved; for insatnce it does deal yet with dynamic
models and coefficients must be dela manually), that could work in your
case. If you are interested in them, I can communicate them to you.

Eric.

2014-09-27 11:32 GMT+02:00 Mathseco :

> Hi i'm new to scilab !!!
>
> I have a static general equilibrium model with 8 endogenous variable and 8
> independent equations.
>
> Can anyone guide me how to do simulation of such model in scilab ? I want
> to
> get the values of endogenous variable in the model by solving those
> equations for different values of exogenous variables.Please guide
> meThanks
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulation of static general equilbiirum model

2014-09-27 Thread Eric Dubois
For instance, suppose you have the very simple model:

log(c)=a*log(R)+b*un
R=c*C+G

c and R are your endogenous variables, un and G your exogenosu ones.

Then define the function:
function resid=model(param)

resid(1)=log(param(1))-a*log(param(2))-b*un
resid(2)=param(2)-c*param(1)-G

endfunction

provided that un and G are the values of your exogenous variables at the
simulation date and that you have guesstimate of 100 and 110 for C and R ,
then
x=fsolve([100;110],model)
should do the trick

Help fsolve for more details on the working of fsolve.

Eric.

2014-09-27 16:33 GMT+02:00 Mathseco :

> could you please elaborate little more on how can i apply fsolve function
> here as I am a beginner in scilab?? Thanks
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213p4031216.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulation of static general equilbiirum model

2014-09-27 Thread Eric Dubois
Hi.

fsolve solves f(x)=0 where f is your function. So you have to remove the
'=0' from your function.

Éric.

PS : in a function the '=' is used to define the value of a variable in the
lhs.


2014-09-27 18:11 GMT+02:00 Mathseco :

> I tried to write a function solve_m on my own but not getting it right and
> getting lot of errors...
> I have 8 endogenous variables i.e.w,ws,X,Y,alx,aly,asx,asy...
>
> function [w,ws,X,Y,alx,aly,asx,asy]=Solve_m(L,S,Px,Py,t,alpha,beeta,A,B)
>alx-(1/(A*(ws/w)*(alpha/(1-alpha)))^(alpha-1))=0;
> asx-1/(A*(ws/w)*(alpha/(1-alpha)))^(alpha)=0;
> aly-(1/(B*(ws/w)*(beeta/(1-beeta)))^(beeta-1))=0;
> asy-(1/(B*(ws/w)*(beeta/(1-beeta)))^(beeta))=0;
> Px-((alx*w)+(asx*ws))=0;
> Py-(((aly*w)+(asy*ws))/(1+t))=0;
> L-((alx*X)+(aly*Y))=0;
> S-((asx*X)+(asy*Y))=0;
> endfunction
>
> Then i called function Solve_m() by providing all the values for exogenous
> variables...But m getting error Warning: obsolete use of '=' instead of
> '=='.
> Px-((alx*w)+(asx*ws))=0;
>!
> at line   3 of function Solve_m  called by :
> endfunction
>
> Can you help where am making mistake ?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213p4031219.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulation of static general equilbiirum model

2014-09-28 Thread Eric Dubois
Hi

As expalined peviously you hav to write a function with a vetor of size 8
(the number of endogenous variables) as input and a vetcor of size 8 (the
number of equations) as output, each corrdinates of this vector being the
residual of an equation (look at the example, it seems to me easy to
tarnspsoe to your case...)

It should look like:

function resid=Solve_m(param)
resid(1)=param(4)-(1/(A*(param(2)/param(1))*(alpha/(1-alpha)))^(alpha-1));
resid(2)=param(7)-1/(A*(param(2)/param(1))*(alpha/(1-alpha)))^(alpha)
[etc.];
endfunction

then
sol=fsolve(Solve_m)
w=sol(1).

Eric.


2014-09-27 22:53 GMT+02:00 Mathseco :

> If i do some steps manually then need to set this function to zero and want
> to calculate value of 'r', Can anybody tell me the code to write for it...
> (except r here..all other variables are exogenous in this function)
>
>
> L*((Px*A*(1-alpha))^(1/alpha))*r^(-1/alpha)+(S*((Py*B*(1-beeta))^(1/beeta))*r^(-1/beeta))-K=0;
>
>
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213p4031222.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulation of static general equilbiirum model

2014-09-28 Thread Eric Dubois
Hi

The function does not seem to match the problem you exposed. For instance,
I Would have written:
resid(2)=param(7)-1/(A*(param(2)/param(1))*(alpha/(1-alpha)))^(alpha)

You can simply check that your function si 0 at the solution you calculated
manually:
Solve_m(solution)

I this is not 0 (or very small numbers), then either the function does not
replicate your problem and you must cahnge it until it is the case or your
solution is wrong.

I this is 0, come back to me.

Éric.


2014-09-28 15:56 GMT+02:00 Mathseco :

> @Eric : Thank you so much ...my function works as you told..Sorry i ask so
> many ques as i'm just a beginner in scilab ...i'll be highly grateful if
> you
> could help me in one more quesThis is the function which i have written
> :
> clear;
> function resid=Solve_m(param)
>
> resid(1)=param(5)-(1/((A*((param(2)/param(1))*(alpha/(1-alpha^(alpha-1)));
> resid(2)=(param(7)*A*(((param(2)/param(1))*(alpha/(1-alpha)))^alpha))-1;
> resid(3)=(param(8)*B*(((param(2)/param(1))*(beeta/(1-beeta)))^beeta))-1;
> resid(4)=(param(6)*B*(((param(2)/param(1))*(beeta/(1-beeta)))^beeta))-1;
> resid(5)=((param(5)*param(1))+(param(7)*param(2)))-Px;
> resid(6)=((param(6)*param(1))+(param(8)*param(2)))-(Py*(1+t));
> resid(7)=((param(5)*param(3))+(param(6)*param(4)))-L;
> resid(8)=((param(7)*param(3))+(param(8)*param(4)))-S;
> endfunction
>
> //constants
> A=10;
> B=10;
> t=0.2;
> Px=1;
> Py=1;
> alpha=0.3;
> beeta=0.1;
> L=500;
> S=200;
>
> sol=fsolve([1,10,1280,1200,0.2,0.06,0.1,0.09],Solve_m);
> w=sol(1);
> ws=sol(2);
> X=sol(3);
> Y=sol(4);
> alx=sol(5);
> aly=sol(6);
> asx=sol(7);
> asy=sol(8);
>
> I have calculated the same values manually just to check whether what i'm
> doing through scilab is correct or not because i need to use this for more
> complicated models. But unfortunately, my manual calculated values  and the
> one i got through above function is not coming same...Could you help wht
> can
> be the reason? (I have double check the calculated manual values) , Thanks
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213p4031225.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulation of static general equilbiirum model

2014-09-28 Thread Eric Dubois
I suspect that your problem has data with too different orders of magnitude.

Indeed, when I calaulate the numerical Jacobian at your satrting values, it
has eigen values with a ratio of more than a million: in econometric tets
you have a huge multiocolinaeraity problem.

Check what happens if you redefine your problem so that variables have the
same order of magnitude.

Éric.

2014-09-28 18:00 GMT+02:00 Mathseco :

> @ Eric : I changed the equations as u told it shld be written... I checked
> my
> manual solution too, the function is coming to be zero.
> There is one more thing..in this case, since i have worked out manual
> solution,so i know the guesstimates for my all 8 endogenous variables so i
> put those as argument in the function fsolve..but if i put some other
> values
> which are not close to the solutions then it is showing error
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213p4031227.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulation of static general equilbiirum model

2014-10-04 Thread Eric Dubois
I fear that what you ask exceeds my capacities...

Send me your Scilab script and I will have a look...

Éric.

2014-10-03 20:16 GMT+02:00 Mathseco :

> @Eric...Even after changing the model..m getting the same error 98...for
> fsolve but if i use 'real ' before the each equations then it runs . Then,
> although it runs the problem is that i am getting negative values for my
> endogenous variables which is not acceptable for my model... can you help
> me...whts the reason for this...its really urgent.. !!!
> Thanks
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Simulation-of-static-general-equilbiirum-model-tp4031213p4031298.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Using GROCER ms_var parameters for forecasting

2015-02-12 Thread Eric Dubois
Dear Brian.

If I have well understood, you want:
- to estimate a ms_var model on a subset of your dataset;
- recover the estimated parameters;
- and calculate the filtered state probabilities on the other part of your
dataset with these parameters.

This can be done:
- the function MSVAR_Filt calculates among other the filetered
probabilities (5th output);
- the function needs among other things the parameters of the model; they
can be recovered from the output tlist of function ms_var; if give it the
name res (with --> res=ms_var(...)): this is the field 'coeff' in the
output tlist (res('coeff') with this example);

But the function MSVAR_Filt also has to be fed with matrices y_hat, x_hat
and z_hat that are matrices derived from the matrix of endogenous and
exogenous variables (see function ms_var to see how it is done).

If you are not too in a hurry, I can write the function that gathers all
these operations within a few weeks.

Éric.

2015-02-12 16:56 GMT+01:00 Brian Bouterse :

> I use GROCER's ms_var function to estimate a single variable VAR model,
> and it estimates parameters as expected and described by the manual. I want
> to train and evaluate my model on different data sets to avoid bias from
> training and benchmarking on the same data set. How can this be done?
>
> For example consider data set A (month 1) and data set B (month 2) from a
> 2 month sample. I would like to train on month 1 and then benchmark on
> month 2.
>
> I use ms_var to train on data set A. It gives me estimated parameters and
> filtered regime probabilities. That works well. How can I use the trained
> parameters to then estimate on month 2 data?
>
> I'm aware of the ms_forecast function, but it seems to only forecast using
> the results from an estimator like ms_var(). The forecasting will then only
> be done on the same data as was used for estimating. I want to use the
> trained parameters to product estimates for a different data set.
>
> Thanks in advance. I really appreciate being able to use this software.
>
> -Brian
>
> --
> Brian Bouterse
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Using GROCER ms_var parameters for forecasting

2015-02-17 Thread Eric Dubois
Dear Brian.

1) sorry, I made indeed a typo and wanted to speak about y_mat, x_mat and
z_mat.

2) I do not know exactly what you want, but you can calculate what you want
from the parameters and all other inputs

3) you will find attached a function run_ms_var that performs, I hope, what
you need: this function takes a results tlist from a ms_var execution and a
vector of endogenous variables to feed the VAR (your benchmark data).

I have checked that if you give as endogenous variables exactly the same
variables as the one used for estimation, you recover the same yhat,
filtered probs, etc.

To use the function, you have to save it in a folder, say c:/newms, and run
into Scilab
--> getd('c:/newms)

To check what I mentionned above, run:
--> load(GROCERDIR+'\data\us_revu.dat')
--> bounds('1967m4','2004m2')
--> nb_states=2
--> switch_var=2 // variances are switching
--> var_opt=3 // heteroskedastik var-cov matrix
--> 
r=ms_var('cte',3,'100*(log(us_revu)-lagts(2,log(us_revu)))',nb_states,switch_var,var_opt,'prt=initial;final','transf=stud')
--> 
[y_hat,resid,PR,PR_STT,PR_STL]=run_ms_var(r,'100*(log(us_revu)-lagts(2,log(us_revu)))'
--> PR_STT-r('filtered probs')

The function is rather rough (no header, no options,...) and can be
improved, but I hope it answers your needs.

Éric.




2015-02-17 15:03 GMT+01:00 Brian Bouterse :

> Hi Eric,
>
> Thanks for the reply! Yes you understand my goals correctly, but one
> clarification: It would be better to have the estimated values directly
> instead of the filtered state probabilities. I usually get these with
> ms_forecast(r, n).
>
> I've been reading through the grocer code to determine how to write the
> function you suggest. I do need it sooner than a few weeks so I'm
> attempting to do it. It seems straightforward except for the y_hat, x_hat,
> and z_hat variables I need to provide to MSVAR_Filt.(). Here are some
> questions:
>
> 1) You say I need to feed MSVAR_Filt() with y_hat, x_hat, and z_hat, but
> the variables in the function signature for MSVAR_Filt read
> as y_mat,x_mat,z_mat. Did you mean y_mat or y_hat?
>
> 2) y_hat (2nd output) is an output of MSVAR_Filt(). The function comments
> say that is my estimated y. Is that the direct estimates that I am looking
> for?
>
> 3) I read through ms_var() to see how to derive the y_hat, x_hat, and
> z_hat variables that are needed, but I don't see any code in ms_var that
> derive these variables. Can you more specifically point out where the code
> is that shows the derivation of these matrices?
>
> Separate from those questions I am wondering what kind of bias is
> introduced if I use the filtered probabilities from ms_var? Could I use
> those instead of attempting to predict with data set A and evaluate with
> data set B. The reason I like the two data set methodology is that the
> training data (A) is separated from the evaluation data (B) so there can't
> be any bias in terms of measuring how the trained data generalizes when
> benchmarked on evaluation data because the training model never saw data
> set (B). Chapter 23 says the filtered probabilities only use data up until
> that point in time, but it uses estimates that were built from all
> information that is available. It seems biased to evaluate the residuals
> using filtered probabilities (or smoothed probabilities) because training
> and evaluating error on the same data set seems wrong. What do you think
> the right way is to use these tools to avoid bias when measuring error of
> model performance?
>
> Thanks for any information. Also is there any possibility for us to chat
> on IRC? I'm 'bmbouter' in #scilab on freenode if you want to chat there. It
> would probably be faster than e-mail.
>
> Thanks!
> Brian
>
>
> On Thu, Feb 12, 2015 at 3:44 PM, Eric Dubois 
> wrote:
>
>> Dear Brian.
>>
>> If I have well understood, you want:
>> - to estimate a ms_var model on a subset of your dataset;
>> - recover the estimated parameters;
>> - and calculate the filtered state probabilities on the other part of
>> your dataset with these parameters.
>>
>> This can be done:
>> - the function MSVAR_Filt calculates among other the filetered
>> probabilities (5th output);
>> - the function needs among other things the parameters of the model; they
>> can be recovered from the output tlist of function ms_var; if give it the
>> name res (with --> res=ms_var(...)): this is the field 'coeff' in the
>> output tlist (res('coeff') with this example);
>>
>> But the function MSVAR_Filt also has to be fed with matrices y_hat, x_hat
>> a

Re: [Scilab-users] Using GROCER ms_var parameters for forecasting

2015-02-19 Thread Eric Dubois
Dear Brian

You cannot perform forecasts with the results fo the function I sent you,
because these results are under a matrix form while ms_forecast needs a
results tlist (typed list). What is needed is therefore a results tlist
with all needed fields to make forecasts. You will find enclosed a new
ms_var_run function that makes that. What I have done is replacing the
results that are new in the results tlist estimated, while keeping all
invariant results (suach as estimated parameters, t-stats,...): I think I
have done it properly, but I cannot insure you that it is the case.

Starting for the previous example, replace:
--> [y_hat,resid,PR,PR_STT,PR_STL]=run_ms_var(r,'100*(log(
us_revu)-lagts(2,log(us_revu)))'

with:
-->newr=run_ms_var(r,'100*(log(us_revu)-lagts(2,log(us_revu)))'

and then make a forecast with:
--> rf=ms_forecast(newr,'2004m12')

Again, the function is rough and should be improved somehow.

Éric.

2015-02-19 14:28 GMT+01:00 Brian Bouterse :

> Hi Eric,
>
> Thank you so much for the function. The verification step you demonstrate
> are convincing that the implementation produces the correct filtered
> probability result on the benchmark data. I've been able to reproduce your
> demo results, and also apply it to my own data set. This is great!
>
> There is one more thing that I'm not sure how to do for the single
> variable case. How can I take the results I have from run_ms_var() and use
> them with ms_forecast() to produce a single variable filtered estimate? The
> results I have are [y_hat,resid,PR,PR_STT,PR_STL]. I imagine this could
> be done using the following pseudocode:
>
> for each time step in PR_STT:
> select the regime with the highest filtered probability for this time
> step (ie: say regime N). This is like a maximum likelihood selection.
> select the autoregressive parameters for regime N from the original
> training step
> forecast the next time step using the autoregressive parameters using
> regime N
>
> This seems very similar to what ms_forecast() can do, but I'm not sure how
> to call ms_forecast given only the existence of parameters
> [y_hat,resid,PR,PR_STT,PR_STL]. Is this possible?
>
> Perhaps one of the variables [y_hat,resid,PR,PR_STT,PR_STL] already
> contains what I am looking for, but I want to be sure that it is based on
> the filtered probabilities and not considering data that comes later in the
> data set than the point of prediction. Does that make sense? In other words
> I want to predict the specific value at time t, and only consider data on
> the interval [0, t-1].
>
> Thanks again for everything you've done including writing this, helping
> me, responding so quickly, etc. This is really great.
>
> -Brian
>
>
>
> On Tue, Feb 17, 2015 at 3:50 PM, Eric Dubois 
> wrote:
>
>> Dear Brian.
>>
>> 1) sorry, I made indeed a typo and wanted to speak about y_mat, x_mat and
>> z_mat.
>>
>> 2) I do not know exactly what you want, but you can calculate what you
>> want from the parameters and all other inputs
>>
>> 3) you will find attached a function run_ms_var that performs, I hope,
>> what you need: this function takes a results tlist from a ms_var execution
>> and a vector of endogenous variables to feed the VAR (your benchmark data).
>>
>> I have checked that if you give as endogenous variables exactly the same
>> variables as the one used for estimation, you recover the same yhat,
>> filtered probs, etc.
>>
>> To use the function, you have to save it in a folder, say c:/newms, and
>> run into Scilab
>> --> getd('c:/newms)
>>
>> To check what I mentionned above, run:
>> --> load(GROCERDIR+'\data\us_revu.dat')
>> --> bounds('1967m4','2004m2')
>> --> nb_states=2
>> --> switch_var=2 // variances are switching
>> --> var_opt=3 // heteroskedastik var-cov matrix
>>
>> --> 
>> r=ms_var('cte',3,'100*(log(us_revu)-lagts(2,log(us_revu)))',nb_states,switch_var,var_opt,'prt=initial;final','transf=stud')
>>
>> --> 
>> [y_hat,resid,PR,PR_STT,PR_STL]=run_ms_var(r,'100*(log(us_revu)-lagts(2,log(us_revu)))'
>> --> PR_STT-r('filtered probs')
>>
>> The function is rather rough (no header, no options,...) and can be
>> improved, but I hope it answers your needs.
>>
>> Éric.
>>
>>
>>
>>
>> 2015-02-17 15:03 GMT+01:00 Brian Bouterse :
>>
>>> Hi Eric,
>>>
>>> Thanks for the reply! Yes you understand my goals correctly, but one
>>> clarification: It would be better to have t

Re: [Scilab-users] GROCER: ms_var throwing errors during estimation in case of a VAR

2015-03-09 Thread Eric Dubois
Hello Deb

I think this a problem (which may happen when a matrix type switches
accidentally to complex) has been solved since then: if you switch to
grocer 1.65 this should work.

Éric.

2015-03-09 18:10 GMT+01:00 dnayak :

> I am new to Scilab and GROCER, but have successfully used it for parameter
> estimation in case of a single variable VAR model. My problem arises when I
> try to do the same with a 2-variable VAR model.
>
> I am using GROCER 1.62 on Scilab 5.5.1 in a Windows 7 (64-bit) machine.
>
> When I use a 2 state model, GROCER is running fine. The commands I use in
> this case are as follows:
> nb_states = 2
> switch_var = 2
> var_opt = 3
>
> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> However, GROCER throws an error in case of a 3 state model. The commands I
> use in this case are:
> nb_states = 3
> switch_var = 3
> var_opt = 3
>
> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> The error I get is:
> !--error 144
> Undefined operation for the given operands.
> check or define function %s_4_s for overloading.
> at line  44 of function %s_pow called by :
> at line 158 of function MSVAR_SetInit called by :
> at line 165 of function ms_estimate called by :
> at line 309 of function ms_var called by :
>
> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> I fail to compehend the reason behind this error. Can someone please help
> me
> out here??
>
> Thanks,
> Deb
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/GROCER-ms-var-throwing-errors-during-estimation-in-case-of-a-VAR-tp4031839.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] GROCER: ms_var throwing errors during estimation in case of a VAR

2015-03-12 Thread Eric Dubois
Hi Deb.

Could you please download the attach file in a new folder (say c:/new_ms)
and:
- load the file with the following command:
--> getd('c:/new_ms')
- then run again your estimation code
- check that the program displays:

--- new MSVAR_SerInit ---

Then
1) if your estimation ends without error, fine (but this should mean that
you have not properly installed Grocer v1.65, then please tell me exactly
what you did - did you use Atoms or did you download Grocer from my web
site? Where did you unzip the zip file? What mesages did you obtain?)
2) if you have the same error -except that it should now happen at line 161
of function MSVAR-SetInit- then could you send me your data and code (you
can send it directly at grocer.tool...@gmail.com or grocer.tool...@free.fr),
so that I can figure out what happens exactly?

Éric.

2015-03-11 22:56 GMT+01:00 dnayak :

> Hi Eric,
>
> Thanks for your prompt reply. I did as you asked me to do. I removed GROCER
> 1.62 and used 1.65. But still the same error is appearing.
>
> !--error 144
> Undefined operation for the given operands.
> check or define function %s_4_s for overloading.
> at line  44 of function %s_pow called by :
> at line 158 of function MSVAR_SetInit called by :
> at line 165 of function ms_estimate called by :
> at line 306 of function ms_var called by :
>
> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> As I said earlier, when I use 2 states, GROCER starts working. It throws
> the
> error when I use 3 states.
>
> Thanks,
> Deb
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/GROCER-ms-var-throwing-errors-during-estimation-in-case-of-a-VAR-tp4031839p4031873.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>


MSVAR_SetInit.sci
Description: Binary data
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] GROCER: ms_var throwing errors during estimation in case of a VAR

2015-03-12 Thread Eric Dubois
Hello Deb.

There was indeed another real variable becoming complex (although its
imaginary part was nil) before line 158. A rare problem, but sorry for not
having antici^pated it could happen.

I have solved the problem in the attached MSVAR_SetInit file (although I
have not waited until full convergence, which seems to be rather long).

Éric.

2015-03-12 18:22 GMT+01:00 dnayak :

> Hi Eric,
>
> I did everything just the way you asked me to. I even got the message
> '' --- new MSVAR_SerInit --- '', when I ran my estimation. However, I am
> still getting the same error. But, it is in line 161 now, as you predicted.
>
> !--error 144
> Undefined operation for the given operands.
> check or define function %s_4_s for overloading.
> at line  44 of function %s_pow called by :
> at line 161 of function MSVAR_SetInit called by :
> at line 165 of function ms_estimate called by :
> at line 306 of function ms_var called by :
>
> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> I attach here both the original csv file that has my data and the dat file
> that I obtained from the csv file using the impexc2bd command.
>
> I run my estimation using the following steps:
> 1. Load data
> - load('C:\Users\Adminuser\Desktop\TEST\Alice\AliceGROCERleftIrightP.dat')
> 2. nb_states = 3
> 3. switch_var = 3
> 4. var_opt = 3
>
> 5. 
> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>
> Hope this helps.
>
> Thanks,
> Deb
>
>
>
> On Thu, Mar 12, 2015 at 4:30 AM, Eric Dubois [via Scilab / Xcos - Mailing
> Lists Archives] <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4031882&i=0>> wrote:
>
>> Hi Deb.
>>
>> Could you please download the attach file in a new folder (say c:/new_ms)
>> and:
>> - load the file with the following command:
>> --> getd('c:/new_ms')
>> - then run again your estimation code
>> - check that the program displays:
>>
>> --- new MSVAR_SerInit ---
>>
>> Then
>> 1) if your estimation ends without error, fine (but this should mean that
>> you have not properly installed Grocer v1.65, then please tell me exactly
>> what you did - did you use Atoms or did you download Grocer from my web
>> site? Where did you unzip the zip file? What mesages did you obtain?)
>> 2) if you have the same error -except that it should now happen at line
>> 161 of function MSVAR-SetInit- then could you send me your data and code
>> (you can send it directly at [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=4031875&i=0> or [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=4031875&i=1>), so that I can
>> figure out what happens exactly?
>>
>> Éric.
>>
>> 2015-03-11 22:56 GMT+01:00 dnayak <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=4031875&i=2>>:
>>
>>> Hi Eric,
>>>
>>> Thanks for your prompt reply. I did as you asked me to do. I removed
>>> GROCER
>>> 1.62 and used 1.65. But still the same error is appearing.
>>>
>>> !--error 144
>>> Undefined operation for the given operands.
>>> check or define function %s_4_s for overloading.
>>> at line  44 of function %s_pow called by :
>>> at line 158 of function MSVAR_SetInit called by :
>>> at line 165 of function ms_estimate called by :
>>> at line 306 of function ms_var called by :
>>>
>>> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>>>
>>> As I said earlier, when I use 2 states, GROCER starts working. It throws
>>> the
>>> error when I use 3 states.
>>>
>>> Thanks,
>>> Deb
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://mailinglists.scilab.org/GROCER-ms-var-throwing-errors-during-estimation-in-case-of-a-VAR-tp4031839p4031873.html
>>> Sent from the Scilab users - Mailing Lists Archives mailing list archive
>>> at Nabble.com.
>>> ___
>>> users mailing list
>>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4031875&i=3>
>>> http://lists.scilab.org/mailman/listinfo/users
>>>
>>
>>
>> _

Re: [Scilab-users] GROCER: ms_var throwing errors during estimation in case of a VAR

2015-03-13 Thread Eric Dubois
Hi Deb.

I fear I have let a pause in my MSVAR_SetInit (the pause is very useful to
understand bugs: when the program encounters a pause, it stops running and
give you acces to all the variables created by the program until the pause,
which helps you understanding what (variable) has went wrong). You can
restart the program as indicated by running:
-1->resume

Anyway, please fiind enclosed a function MSVAR_SetInit without any pause.

I have started also to look more deeply at your problem and I suggest you
to run msvar with normalized variables (to avoid numerical problems) and
with optim as the defautlt optimization program (to avoid too long an
estimation):
--> r=ms_var('all',1,['l/1';'r/1000'],3,3,3,'optfunc=optim')

This is only when you will have stabilized your model or if the results
seem to you strange that you should switch back to optimg with:
--> r=ms_var('all',1,['l/1';'r/1000'],3,3,3,'opt_convg=0')

Éric.

2015-03-13 14:51 GMT+01:00 dnayak :

> Hi Eric,
>
> I used the new MSVAR_SetInit.sci that you sent me yesterday. I used the
> getd command to load the new script and then proceeded as before.
>
> This time GROCER is not throwing any error, but I am not sure whether it
> is working at all.
>
> After I run the estimation process, I get the message - 'Type 'resume'
> or 'abort' to return to standard level prompt.'. Previously, GROCER would
> print the initial values set by the program for the different parameters
> and then go into the optimization step, when it would asked me to wait.
> Nothing like that is happening now. Also, I can see a lot of variables get
> loaded into the variable browser, which do not bear any meaning for me.
>
> Am I following the right process? Please let me know.
>
> Thanks,
> Deb
>
> On Thu, Mar 12, 2015 at 5:26 PM, Eric Dubois [via Scilab / Xcos - Mailing
> Lists Archives] <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4031886&i=0>> wrote:
>
>> Hello Deb.
>>
>> There was indeed another real variable becoming complex (although its
>> imaginary part was nil) before line 158. A rare problem, but sorry for not
>> having antici^pated it could happen.
>>
>> I have solved the problem in the attached MSVAR_SetInit file (although I
>> have not waited until full convergence, which seems to be rather long).
>>
>> Éric.
>>
>> 2015-03-12 18:22 GMT+01:00 dnayak <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=4031883&i=0>>:
>>
>>> Hi Eric,
>>>
>>> I did everything just the way you asked me to. I even got the message
>>> '' --- new MSVAR_SerInit --- '', when I ran my estimation. However, I am
>>> still getting the same error. But, it is in line 161 now, as you predicted.
>>>
>>> !--error 144
>>> Undefined operation for the given operands.
>>> check or define function %s_4_s for overloading.
>>> at line  44 of function %s_pow called by :
>>> at line 161 of function MSVAR_SetInit called by :
>>> at line 165 of function ms_estimate called by :
>>> at line 306 of function ms_var called by :
>>>
>>> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>>>
>>> I attach here both the original csv file that has my data and the dat
>>> file that I obtained from the csv file using the impexc2bd command.
>>>
>>> I run my estimation using the following steps:
>>> 1. Load data
>>> - load('C:\Users\Adminuser\Desktop\TEST\Alice\AliceGROCERleftIrightP.dat')
>>> 2. nb_states = 3
>>> 3. switch_var = 3
>>> 4. var_opt = 3
>>>
>>> 5. 
>>> r=ms_var('all',1,['l';'r'],nb_states,switch_var,var_opt,'prt=initial;final','opt_convg=0')
>>>
>>> Hope this helps.
>>>
>>> Thanks,
>>> Deb
>>>
>>>
>>>
>>> On Thu, Mar 12, 2015 at 4:30 AM, Eric Dubois [via Scilab / Xcos -
>>> Mailing Lists Archives] <[hidden email]
>>> <http:///user/SendEmail.jtp?type=node&node=4031882&i=0>> wrote:
>>>
>>>> Hi Deb.
>>>>
>>>> Could you please download the attach file in a new folder (say
>>>> c:/new_ms) and:
>>>> - load the file with the following command:
>>>> --> getd('c:/new_ms')
>>>> - then run again your estimation code
>>>

Re: [Scilab-users] Grocer: Estimation of a Sequence of States

2015-03-30 Thread Eric Dubois
Hello.

The function ms_var_oos that has been introduced in Grocer 1.66 is probably
what you need.

See help ms_var_oos for a description of the function.

Eric
Le 30 mars 2015 17:30, "dnayak"  a écrit :

> Hi,
>
> I have been using Grocer for some time now for the estimation of HMM-VAR
> parameters. However, I have a different problem now.
>
> Suppose, I have estimated the parameters of an HMM-VAR. Now, I want to use
> those parameters to estimate the sequence of states in a given time-series
> data. This may or may not be the data used to obtain the parameters.
>
> Is there any function, that is able to do that?
>
> Thanks,
> Deb
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Grocer-Estimation-of-a-Sequence-of-States-tp4031997.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Grocer: Estimation of a Sequence of States

2015-04-01 Thread Eric Dubois
Hi Deb.

I am not sure to understand:
- the output from ms_var, a results tlist, contains field 'smoothed probs'
and 'filteed probs' that provides the (smoothed and filtered) probabilities
of the corresponding states on the estimation period;
- the output from ms_var_oos provides the same results, but on any period
(in or out of sample).

Isn't it what you search?

Éric.

2015-04-01 19:05 GMT+02:00 dnayak :

> Hi Eric,
>
> Thanks for the information. However, after going through the function
> ms_var_oos, I feel it runs the Markov-switching VAR model estimated over
> one period of time on another period and compares the results.
>
> However, I need a function that will estimate for me the sequence of
> regimes/states that the data goes through. So, what I need is to first
> estimate the parameters for the Markov-switching VAR model, i.e. train the
> model on a time-series data set X and then use the same parameters to
> estimate the regimes that every instant of X falls into. For example, it
> should give me something like - 1. Data for time instant 1 falls in Regime
> 2; 2. Data for time instant 2 falls in Regime 4; and so on.
>
> Can Grocer do that?
>
> Thanks,
> Deb
>
> On Mon, Mar 30, 2015 at 12:57 PM, Eric Dubois [via Scilab / Xcos - Mailing
> Lists Archives] <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4032031&i=0>> wrote:
>
>> Hello.
>>
>> The function ms_var_oos that has been introduced in Grocer 1.66 is
>> probably what you need.
>>
>> See help ms_var_oos for a description of the function.
>>
>> Eric
>> Le 30 mars 2015 17:30, "dnayak" <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=4031999&i=0>> a écrit :
>>
>>> Hi,
>>>
>>> I have been using Grocer for some time now for the estimation of HMM-VAR
>>> parameters. However, I have a different problem now.
>>>
>>> Suppose, I have estimated the parameters of an HMM-VAR. Now, I want to
>>> use
>>> those parameters to estimate the sequence of states in a given
>>> time-series
>>> data. This may or may not be the data used to obtain the parameters.
>>>
>>> Is there any function, that is able to do that?
>>>
>>> Thanks,
>>> Deb
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://mailinglists.scilab.org/Grocer-Estimation-of-a-Sequence-of-States-tp4031997.html
>>> Sent from the Scilab users - Mailing Lists Archives mailing list archive
>>> at Nabble.com.
>>> ___
>>> users mailing list
>>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4031999&i=1>
>>> http://lists.scilab.org/mailman/listinfo/users
>>>
>>
>> ___
>> users mailing list
>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4031999&i=2>
>> http://lists.scilab.org/mailman/listinfo/users
>>
>>
>> --
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://mailinglists.scilab.org/Grocer-Estimation-of-a-Sequence-of-States-tp4031997p4031999.html
>>  To unsubscribe from Grocer: Estimation of a Sequence of States, click
>> here.
>> NAML
>> <http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> --
> View this message in context: Re: Grocer: Estimation of a Sequence of
> States
> <http://mailinglists.scilab.org/Grocer-Estimation-of-a-Sequence-of-States-tp4031997p4032031.html>
>
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> <http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html>
> at Nabble.com.
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Non linear regression

2015-05-13 Thread Eric Dubois
Hello.

You can use fslove if your equation is exact and leastsq if it is an
approximate relationship. But,in the first case you need to have the smae
number of parameters than observations and in the second one more
observations than parameters, whereas you seem to have less observations
(3) than parameters (4): you should have an infinite number of slutions!

Éric

2015-05-13 19:43 GMT+02:00 Kleper Oliveira Rocha :

> Dear colleagues,
>
> I want to fit data to an equation like
> [image: Imagem inline 1]
>  where a, beta1, b and beta2 must be determined.
>
> The data are:
>
> y PcoPH2
>
> 0.00495   1.0  0.1
> 0.00742   1.0  0.5
> 0.00525   1.0  4.0
>
> In the book of Fogler (Elements of Chemical Reaction Engineering) I have
> the answer
>
> a = 0.02527
> beta1 = 0.6166
> b = 2.4872
> beta2 = 1.0262
>
> How can I fit the data above to the equation in Scilab?
>
> Thanks in advance.
> *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - *
> *Kleper de Oliveira Rocha*
>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] setting the seed of grand

2015-06-29 Thread Eric Dubois
Hi

I do nbot understand why you should keep the same seed (it should give rise
to 1 times the same results), but teh way to do that is:

S=grand("getsd")
for i=1:100
  for j=1:100
 for k=1:100
grand("setsd",S")
x=grand(10,10,'norm',0,1)
・
 end
  end
end

Éric.

2015-06-29 19:12 GMT+02:00 fujimoto2005 :

> I want to  set the same seed for same k for every i,j.
>
> for i=1:100
>   for j=1:100
>  for k=1:100
> x=grand(10,10,'norm',0,1)
> ・
>  end
>   end
> end
> Pleas teach me how to set such seed.
>
>
>
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/setting-the-seed-of-grand-tp4032520.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Creating tables with Scilab

2015-10-18 Thread Eric Dubois
Hello.

Emmanuel Michaux has written a function mat2latex for our toolbox Grocer,
which should answer your needs, eventually with some minor adpatation. I
joined it as well as a demo function. Do not hesitate to have a look at
Grocer, available on Atoms (or at http://dubois.ensae.net/grocer.html), to
have a look at all other capabilties incorporated in Grocer!

Éric.

2015-10-18 13:29 GMT+02:00 Rafael Guera :

> Dear Scilabers,
>
>
>
> Does anyone know if it possible to create tables similar to the one below
> in Scilab?
>
> I have tried the prettyprint command but with no success.
>
>
>
>
>
> Thanks and regards,
>
>
>
> Rafael
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>


mat2latex.sci
Description: Binary data


mat2latex_d.sci
Description: Binary data
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Creating tables with Scilab

2015-10-21 Thread Eric Dubois
Hello Rafael

You have well understood: the program generates Latex code, but does not
generate directly a pdf file that could be encapsulated into another
document: this has to be done with a Latex generator, such as TehcnicCenter
under windows. Sorry it this is does not answer your needs.

Éric

2015-10-21 21:49 GMT+02:00 Rafael Guera :

> Hello Eric,
>
>
>
> Thanks for your reply and for the Grocer link.
>
> From what I could understand, the Scilab script provided generates Latex
> code for a formatted table and writes the file to disk.
>
> What about the display of the Latex table, is this done inside Scilab?
>
>
>
> Regards,
>
> Rafael
>
>
>
> *From:* users [mailto:users-boun...@lists.scilab.org] *On Behalf Of *Eric
> Dubois
> *Sent:* Sunday, October 18, 2015 1:59 PM
> *To:* Users mailing list for Scilab 
> *Subject:* Re: [Scilab-users] Creating tables with Scilab
>
>
>
> Hello.
>
>
>
> Emmanuel Michaux has written a function mat2latex for our toolbox Grocer,
> which should answer your needs, eventually with some minor adpatation. I
> joined it as well as a demo function. Do not hesitate to have a look at
> Grocer, available on Atoms (or at http://dubois.ensae.net/grocer.html),
> to have a look at all other capabilties incorporated in Grocer!
>
>
>
> Éric.
>
>
>
> 2015-10-18 13:29 GMT+02:00 Rafael Guera :
>
> Dear Scilabers,
>
>
>
> Does anyone know if it possible to create tables similar to the one below
> in Scilab?
>
> I have tried the prettyprint command but with no success.
>
>
>
>
>
> Thanks and regards,
>
>
>
> Rafael
>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] News: Scilab 6 Beta, VISA Toolbox, Embedded World 2016

2016-02-16 Thread Eric Dubois
Hello



Thank you for this release and the improvements this Scilab version
contains.



I have however a major concern with the change of behaviour of the addition
or subtraction of a null matrix to another matrix. As explained in the
release notes, []+a will now result in [] whereas it resulted in a in
previous versions.



This means that developments made under older Scilab versions will have to
be adapted to Scilab 6.0. This is potentially a huge task, since all
additions or subtractions in the programs have a priori to be checked.
Needless to say, additions and subtractions are very pervasive operations
in numerical programs. And since all additions and subtractions cannot be
checked in a systematic way (in my toolbox, I have more than 20 000 of
them!), the needed modifications will be made over a long period of time,
at the rhythm of the discovery of bugs by a developer or its users.



More worrying still, not all additions or subtractions involving null
matrices will generate errors when switching from Scilab 5 or older to
Scilab 6: for example, z=size([a+1 y],1) applied to the null matrix a will
simply add 1 in Scilab 6 to the result of Scilab 5, without generating
errors. The attentive user will be alerted by the warning message generated
by Scilab 6, but the inattentive one may not notice it or fully understand
its consequences. So it may lead some users to generate wrong results
without being aware of it, which should be very embarrassing for the
provider of the programs used and for Scilab-enterprises itself.



Another problem will come from users sticking to Scilab older versions: as
for me I have regularly e-mails from users that work for a reason or
another on old Scilab versions (5.3.3 at the moment for instance): avoiding
problems to these users will constrain the adaptation, prevent from using
all capabilities of Scilab and complicate the code. With my example, it
will be necessary to introduce a conditional such as:



if isempty(x) then

   z=size(y,1)+1

else

   z=size([a y],1)

end



And this will apply to new programs as well, which will need so much care
that, I fear, some cases will be missed by even the most careful
programmer. And in this case users working with older Scilab versions will
not even be alerted by a warning message.



Moreover, considering the importance of the change, it is all the more
surprising that it has not been announced in advance, as was the –good–
practice for previous changes, even minor (such as the replacement of x^n
by x .^n when x was a vector, a change that a) affected much less numerous
lines of code b) did entail a simple replacement of some ^ by .^ c) had no
side effect).



Don’t other Scilab users share my concern?



Regards



Éric.



PS: I find a little bit provocative the sentence in the release notes: “To
simplify the transition of your code base during beta, a specific warning
is issued when such operation is detected”. With a little exaggeration, it
sounds like digging the Great canyon and saying to people now separated by
it: to help you, we will give you beach shovels so that you can build a
bridge between the two rivers of the canyon...

2016-02-15 16:35 GMT+01:00 Yann DEBRAY :

> Hello Scilab user,
>
> It has been a while since we last shared news with you. Here are some
> recent updates we hope you will like.
> Scilab 6 Beta
>
> Scilab 6.0 is a major new release of Scilab, the open source modeling &
> simulation platform. This beta version is a preview for all users,
> commercial as well as community.
>
> *What's new: *
>
> --> New computation core enabling bigger data sets
> --> Improved Xcos allowing larger models
> --> Utilities for development productivity (debugger, profiler and
> coverage)
>
> To provide relevant informations to the user, we also introduced a new
> view called "Newsfeed".
> The release will come soon, so feel free to give us feedback about your
> experience.
>
> Find out more 
>
> Signal acquisition and instrument control
> with the Scilab VISA Toolbox (beta version) In partnership with National
> Instruments, we have developed a Scilab interface for measurement devices
> from leading manufacturers (National Instruments, Agilent/HP, ... )
>
> Here is the first version of this VISA toolbox for signal acquisition and
> instrument control. This is a beta version: your feedbacks are welcome.
>
> The Virtual Instrument Software Architecture  (VISA)
> is a standard for configuring, programming, and troubleshooting
> instrumentation systems comprising GPIB, VXI, PXI, Serial, Ethernet, and/or
> USB interfaces. VISA provides the programming interface between the
> hardware and development environments.
>
> Find out more 
>
> Event Embedded World // 23-25 February 2016, Nuremberg
>
> Starting with the largest embedded systems' event of the year : Embedded
> World 2016 

Re: [Scilab-users] News: Scilab 6 Beta, VISA Toolbox, Embedded World 2016

2016-02-16 Thread Eric Dubois
Thanks for the answers.

I share Samuel opinion that the changes from Scilab 5 to Scilab 6 are much
important than previous ones (and I have experienced all of them since
starting with Scilab 2.6!). In the previous cases, functionnalities became
obsolote; this time they change... This is a much more difficult to deal
with

I do not know, Samuel, how you plan to review all your codes. As for me
this should be a daunting task:
- I have arorund 1400 Scilab functions, representing something like 70 000
lines of code, containing around 20 000 additions or subtractions; so I
cannot imagine reviewing all this code;
- Another avenue is to devise a battery of tests covering all possible
cases; this should be less costly, but could miss some relevant cases; and
this means in my cases extending the battery of tests, a useful task
anyway, but also costly

The command warning stop seems to be a good idea for dealing with this
problem, but it has also major drawbacks: you should put it in the .start
file, to prevent users to generate wrong results, but this will also stop
programs that work perfectly. So I do not think it will help dealing with
my concern that inexperimented users could generate wrong results with a
toolbox such as mine. Am I missing something?

Anyway, I fully agree with Samuel that more and more publicity MUST be done
about how to translate Scilab 5 code and modules into SCilab 6 code and
modules, and maybe they will convince me that I have overestimated the
problems...

Regards

Éric


2016-02-16 13:58 GMT+01:00 Clément David <
clement.da...@scilab-enterprises.com>:

> Hello guys,
>
> Just a pointer there : about the stacksize re-introduction or not please
> comment on http://bugzilla.
> scilab.org/show_bug.cgi?id=14266 .
>
> --
> Clément
>
> Le mardi 16 février 2016 à 13:12 +0100, Antoine Monmayrant a écrit :
> > Le 02/16/2016 01:00 PM, Jan Åge Langeland a écrit :
> > >  On 16.02.2016 11:55, Eric Dubois wrote:
> > > > Don’t other Scilab users share my concern?
> > > >  Regards
> > > >  Éric.
> > > >
> > > I have a similar (but simpler)  problem, with stacksize().   All my
> old scripts containing
> > > stacksize('max') etc. need to be modified.
> > >
> > > All it will take is to keep the  standard function stacksize(a)  in
> Scilab 6, just let it do
> > > nothing.
> > Well, you have your fix: add the definition of a dummy stacksize()
> function at the beginning of
> > your init.
> > My 5 cents fix is this:
> >
> > //on older version of scilab, set the memory to the max
> > version_numbers = getversion('scilab');
> > if  version_numbers(1) < 6 then
> > stacksize('max');
> > end
> >
> > that I added to all my ressource-hungry scripts.
> >
> > But you are right, I don't see why they did not implement a dummy
> stacksize() that just output a
> > warning about the fact that it's useless, obsolete and should not be
> used in new code.
> >
> > Antoine
> >
> > >
> > > Jan Å
> > >
> > >
> > > ___
> > > users mailing list
> > > users@lists.scilab.org
> > > http://lists.scilab.org/mailman/listinfo/users
> >
> > --
> > +++
> >
> >  Antoine Monmayrant LAAS - CNRS
> >  7 avenue du Colonel Roche
> >  BP 54200
> >  31031 TOULOUSE Cedex 4
> >  FRANCE
> >
> >  Tel:+33 5 61 33 64 59
> >
> >  email : antoine.monmayr...@laas.fr
> >  permanent email : antoine.monmayr...@polytechnique.org
> >
> > +++
> >
> > ___
> > users mailing list
> > users@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] getf()?

2016-03-25 Thread Eric Dubois
getf has been replaced with exec(...). See help exec.

Éric.

2016-03-25 20:36 GMT+01:00 :

> That's the same question I am asking.
>
> To reiterate: I downloaded an example SciLab application
>
> http://www.scicos.org/examples/pdtk.zip
>
> And when I run it, it halts attempting to call a function getf(),
> that is unknown in my version of SciLab (5.5.2).
>
> Presumably, the application worked with some earlier version of SciLab,
> and the function has changed name or been deprecated in favour of some
> other function that provides the same or similar functionality;
> but there is no reference at all to getf() in the help for my version.
>
> The call appears to be loading or invoking contents of a .sci file.
>
> My question is therefor, how should I modify the application I've
> downloaded to make it work with my version of SciLab?
>
> Cheers, Buk.
>
> > -Original Message-
> > From: scilab.browseruk.bb30c473ec.sgougeon#free...@ob.0sg.net
> > Sent: Fri, 25 Mar 2016 17:34:49 +0100
> > To: users@lists.scilab.org
> > Subject: Re: [Scilab-users] getf()?
> >
> > Hi,
> > What are you expecting from "getf()"? What is it supposed to do?
> >
> > ___
> > users mailing list
> > users@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
>
> 
> FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
> Check it out at http://www.inbox.com/earth
>
>
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] porting an atom module from 5.5.x?==?utf-8?q? -> 6.0

2016-04-09 Thread Eric Dubois
Hello Antoine

I am not sure of you mean exactly by "porting an atom module", but as for
me I have managed to install my Scilab toolbox (grocer) on Scilab 6.0, with
small adaptations to the builder.sce file and changes to the code, in
particular to make my functions contnue to work properly after the change
made to the behaviour of an addition with an empty matrix.

Éric.

2016-04-09 16:34 GMT+02:00 Antoine Monmayrant :

> Hi everyone,
>
> I just tried to install in 6.0 an atom module developed by one of my
> colleagues for 5.5.X,  without success.
> I tough naively that just bumping the version requirement from 5.X wih
> X>=2 to X.0 with X>=6,  in addition to small fixes in the loader/builder
> would do it but I was wrong.
> As anyone ported 5.5 modules to 6.0?
> Any piece of advice or tutorial on the best way to do it?
>
> Thanks in advance for your help,
>
> Antoine
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users