artur bala | 1 Nov 2011 19:34
Favicon

Re: saving the row/col names of a matrix


> On Tue, 25 Oct 2011, artur bala wrote:
>
>> Could it be possible to save the row/col names that one may give to a
>> matrix ?
> I'm not sure what you mean. If the row or column names are put
> in a named string variable they're automatically saved.
>
> matrix m = I(3)
> string cnames = "name1 name2 name3"
> colnames(m, cnames)
> print m
> print cnames
Another point (which was my original one): the names are not saved when 
a matrix is returned from a function.
If I transform your script into a function, and call it from a script 
the saved matrix has no row/col saved.

function matrix nothing (scalar value)
   m = I(value)
   if value = 3
     string cnames = "name1 name2 name3"
     string rnames = "name4 name5 name6"
     colnames(m, cnames)
     rownames(m, rnames)
     print m
   endif
   return m
end function

(Continue reading)

Seth J Kopchak | 1 Nov 2011 20:17
Favicon

Plots off the screen

Dear All,

Running gretl 1.9.6. on windows 7.

If I create a plot, the window is placed off my monitors and out of reach
of my cursor.  [Until recently only half of the window went off the
monitor, but now, inexplicably (to me) the whole thing is out of reach.]

This phenomenon must be related to having more than one monitor, since if
I turn disable all but one screen the graphics window shows up in a
reasonable place.

Searched for clues, but only other mention was on this list in 2007, and
doesn't have a resolution.

Working around with Alt+space m and then the arrow keys, but this adds a
bit too much suspense to examining graphics.  Imagine there must be some
configuration for gnuplot somewhere but I'm not sure how to fix this
problem.

Thanks in advance for your suggestions!

Best,

SK

Allin Cottrell | 1 Nov 2011 21:39
Picon
Favicon

Re: saving the row/col names of a matrix

On Tue, 1 Nov 2011, artur bala wrote:

>> On Tue, 25 Oct 2011, artur bala wrote:
>>
>>> Could it be possible to save the row/col names that one may give to a
>>> matrix ?
>> I'm not sure what you mean. If the row or column names are put
>> in a named string variable they're automatically saved.
>>
>> matrix m = I(3)
>> string cnames = "name1 name2 name3"
>> colnames(m, cnames)
>> print m
>> print cnames
> Another point (which was my original one): the names are not saved when
> a matrix is returned from a function.
> If I transform your script into a function, and call it from a script
> the saved matrix has no row/col saved.
>
> function matrix nothing (scalar value)
>   m = I(value)
>   if value = 3
>     string cnames = "name1 name2 name3"
>     string rnames = "name4 name5 name6"
>     colnames(m, cnames)
>     rownames(m, rnames)
>     print m
>   endif
>   return m
> end function
(Continue reading)

Hebert Suárez Cahuana | 2 Nov 2011 02:03
Picon
Favicon

Problemas en Gretl 1.9.6

Estimados todos:

Parece que algo anda mal con la versión 1.9.6, utilizo linux ubuntu, le doy ./configure make make check y se instala pero ahora no puede abrir ningún archivo, no se puede hacer nada porque el programa se cierra automáticamente y aparece en la consola el mensaje siguiente: Ilegal instruccion
Quiero regresar a la versión 1.9.5 que si estaba bien pero no se como hacerlo.

Saludos
Hebert Suarez Cahuana
Perú

--
Atentamente:
Hebert Suárez Cahuana
Departamento Académico de Economía
Escuela Profesional de Economía
Universidad Nacional de San Agustín 
Av. Venezuela S/N  Cercado
www.unsa.edu.pe
Arequipa-Peru
Telefono 51 54 215105
E-mail: hsuarezc-AySywPH+/HsEmBOxnfisBw@public.gmane.org

"NO PREGUNTES QUE PUEDE HACER TU PAÍS POR TI, SINO PREGUNTA QUE PUEDES HACER TU POR TU PAÍS" John Kennedy Presidente de los Estados Unidos


<div>
<p>Estimados todos:</p>
<div>Parece que algo anda mal con la versi&oacute;n 1.9.6, utilizo linux ubuntu, le doy ./configure make make check y se instala pero ahora no puede abrir ning&uacute;n archivo, no se puede hacer nada porque el programa se cierra autom&aacute;ticamente y aparece en la consola el mensaje siguiente: Ilegal instruccion</div>
<div>Quiero regresar a la versi&oacute;n 1.9.5 que si estaba bien pero no se como hacerlo.</div>
<div><br></div>
<div>Saludos</div>
<div>Hebert Suarez Cahuana</div>
<div>Per&uacute;<br clear="all"><div><br></div>-- <br>Atentamente:<br>Hebert Su&aacute;rez Cahuana<br><div>Departamento Acad&eacute;mico de Econom&iacute;a</div>
<div>Escuela Profesional de Econom&iacute;a<br>
</div>Universidad Nacional de San Agust&iacute;n&nbsp; <br>Av. Venezuela S/N&nbsp; Cercado<br><a href="http://www.unsa.edu.pe" target="_blank">www.unsa.edu.pe</a><br>
Arequipa-Peru<br>Telefono 51 54 215105<br>E-mail: <a href="mailto:hsuarezc <at> unsa.edu.pe" target="_blank">hsuarezc@...</a><br><br>"NO PREGUNTES QUE PUEDE HACER TU PA&Iacute;S POR TI, SINO PREGUNTA QUE PUEDES HACER TU POR TU PA&Iacute;S" John Kennedy Presidente de los Estados Unidos<br><br><br>
</div>
</div>
Allin Cottrell | 2 Nov 2011 02:17
Picon
Favicon

Re: saving the row/col names of a matrix

On Tue, 1 Nov 2011, artur bala wrote:

> Another point (which was my original one): the [column or row] 
> names are not saved when a matrix is returned from a function.

True. Here's a minimal case:

<hansl>
function matrix mnames (void)
   matrix m = I(3)
   colnames(m, "col1 col2 col3")
   print m
   return m
end function

matrix m = mnames()
print m
</hansl>

Initially I thought this might be a simple bug that could easily be 
fixed, but actually it turns out it's a design issue (and hence I'm 
copying gretl-devel, hoping for comments).

The point is that the gretl_matrix type knows nothing about column 
or row names. These names reside at the level of the "user_matrix" 
struct which wraps a locally named gretl_matrix for ease of use. But 
when a function returns a matrix, it returns a plain gretl_matrix: 
the names are destroyed and not returned.

The main reason that the names are attached to the "user_matrix" 
wrapper and not the gretl_matrix itself is to keep the gretl_matrix 
type lean and mean. After all, it's used internally in many contexts 
where column/row names are never wanted, and it's also offered as a 
type for matrix operations by third parties (the libgretl API) 
where, again, name-pointers are likely to be just a deadweight.

On the other hand, I can see a use-case for wanting to return a 
matrix from a user-defined function with row and/or column names 
attached. Right now, I'm not sure how to resolve this.

Allin

Allin Cottrell | 2 Nov 2011 02:28
Picon
Favicon

Re: Problemas en Gretl 1.9.6

On Tue, 1 Nov 2011, Hebert Suárez Cahuana wrote:

> Parece que algo anda mal con la versión 1.9.6, utilizo linux ubuntu, le doy
> ./configure make make check y se instala pero ahora no puede abrir ningún
> archivo, no se puede hacer nada porque el programa se cierra
> automáticamente y aparece en la consola el mensaje siguiente: Ilegal
> instruccion

Google translation:

"It seems that something is wrong with version 1.9.6, I use ubuntu 
linux, I give ./configure make make check and installed but now 
can not open any file, you can not do anything because the program 
closes automatically appears on the console the following message: 
Illegal instruction."

The operating system error "Illegal instruction" means that you are 
trying to execute code on a given processor that was compiled for a 
different processor. This can happen if your gcc version is not in 
sync with your actual computer.

What kind of CPU do you have? Is it an old machine that does not 
support the SSE2 instruction set? In that case when you build gretl 
you should configure with

./configure --disable-sse2

Allin Cottrell
On Tue, 1 Nov 2011, Hebert Suárez Cahuana wrote:

> Parece que algo anda mal con la versión 1.9.6, utilizo linux ubuntu, le doy
> ./configure make make check y se instala pero ahora no puede abrir ningún
> archivo, no se puede hacer nada porque el programa se cierra
> automáticamente y aparece en la consola el mensaje siguiente: Ilegal
> instruccion

Google translation:

"It seems that something is wrong with version 1.9.6, I use ubuntu 
linux, I give ./configure make make check and installed but now 
can not open any file, you can not do anything because the program 
closes automatically appears on the console the following message: 
Illegal instruction."

The operating system error "Illegal instruction" means that you are 
trying to execute code on a given processor that was compiled for a 
different processor. This can happen if your gcc version is not in 
sync with your actual computer.

What kind of CPU do you have? Is it an old machine that does not 
support the SSE2 instruction set? In that case when you build gretl 
you should configure with

./configure --disable-sse2

Allin Cottrell
Riccardo (Jack) Lucchetti | 2 Nov 2011 08:17
Picon

Re: [Gretl-devel] saving the row/col names of a matrix

On Wed, 2 Nov 2011, Riccardo (Jack) Lucchetti wrote:

> On Tue, 1 Nov 2011, Allin Cottrell wrote:
>
>> (b) Row and/or column names are attached to the gretl_matrix struct
>> itself, rather than the wrapper. That is more plausible, but I still
>> don't like it much. The extra memory required for an empty
>> gretl_matrix would only be two pointers (8 bytes on a 32-bit system)
>> but it represents additional complexity that I'd prefer to keep out
>> of what is in concept a mathematical type.
>
> I agree: matrices should stay as lean-and-mean as possible. Besides, there is 
> the possibility of achieving Artur's original aim in Hansl, albeit in a way 
> that most people will find a bit convoluted: here's two ways to do it. My 
> personal preference goes to func2, but I happen to like bundles quite a lot.

Sorry for the noise: (1) I forgot to send my previous message to the 
users' list; (2) there was a small glitch in func2 (corrected below); (3) 
I'd like to express my point more explicitly: IMO, base types such as 
matrices should stay as unencumbered by extra info (or metadata, call it 
what you want) in the interest of efficiency. If you really need to wrap 
up a complex set of information into one entity, that's exactly what 
bundles are for.

<hansl>
set echo off
set messages off

function string func1(scalar r, scalar c, matrix *m)
    string rl = ""
    loop i=1..r --quiet
        sprintf rl "%s,row_%d", rl, i
    end loop
    string cl = ""
    loop i=1..c --quiet
        sprintf cl "%s,col_%d", cl, i
    end loop
    m = zeros(r,c)
    sprintf ret "%s %s", rl, cl
    return ret
end function

function bundle func2(scalar r, scalar c)
    bundle ret

    string rl = ""
    loop i=1..r --quiet
        sprintf rl "%s row_%d", rl, i
    end loop
    ret["Rlab"] = rl

    string cl = ""
    loop i=1..c --quiet
        sprintf cl "%s col_%d", cl, i
    end loop
    ret["Clab"] = cl

    m = zeros(r,c)
    ret["X"] = m

    return ret
end function

# ----- using func1 -----------------------------

a = {}
boo = func1(3,2,&a)
rowlab = strsub(strsplit(boo, 1), ",", " ")
collab = strsub(strsplit(boo, 2), ",", " ")

rownames(a, rowlab)
colnames(a, collab)
print a

# ----- using func2 -----------------------------

bundle zoo = func2(3,2)
rowlab = zoo["Rlab"]
collab = zoo["Clab"]
a = zoo["X"]

rownames(a, rowlab)
colnames(a, collab)
print a
</hansl>

Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche

r.lucchetti@...
http://www.econ.univpm.it/lucchetti
On Wed, 2 Nov 2011, Riccardo (Jack) Lucchetti wrote:

> On Tue, 1 Nov 2011, Allin Cottrell wrote:
>
>> (b) Row and/or column names are attached to the gretl_matrix struct
>> itself, rather than the wrapper. That is more plausible, but I still
>> don't like it much. The extra memory required for an empty
>> gretl_matrix would only be two pointers (8 bytes on a 32-bit system)
>> but it represents additional complexity that I'd prefer to keep out
>> of what is in concept a mathematical type.
>
> I agree: matrices should stay as lean-and-mean as possible. Besides, there is 
> the possibility of achieving Artur's original aim in Hansl, albeit in a way 
> that most people will find a bit convoluted: here's two ways to do it. My 
> personal preference goes to func2, but I happen to like bundles quite a lot.

Sorry for the noise: (1) I forgot to send my previous message to the 
users' list; (2) there was a small glitch in func2 (corrected below); (3) 
I'd like to express my point more explicitly: IMO, base types such as 
matrices should stay as unencumbered by extra info (or metadata, call it 
what you want) in the interest of efficiency. If you really need to wrap 
up a complex set of information into one entity, that's exactly what 
bundles are for.

<hansl>
set echo off
set messages off

function string func1(scalar r, scalar c, matrix *m)
    string rl = ""
    loop i=1..r --quiet
        sprintf rl "%s,row_%d", rl, i
    end loop
    string cl = ""
    loop i=1..c --quiet
        sprintf cl "%s,col_%d", cl, i
    end loop
    m = zeros(r,c)
    sprintf ret "%s %s", rl, cl
    return ret
end function

function bundle func2(scalar r, scalar c)
    bundle ret

    string rl = ""
    loop i=1..r --quiet
        sprintf rl "%s row_%d", rl, i
    end loop
    ret["Rlab"] = rl

    string cl = ""
    loop i=1..c --quiet
        sprintf cl "%s col_%d", cl, i
    end loop
    ret["Clab"] = cl

    m = zeros(r,c)
    ret["X"] = m

    return ret
end function

# ----- using func1 -----------------------------

a = {}
boo = func1(3,2,&a)
rowlab = strsub(strsplit(boo, 1), ",", " ")
collab = strsub(strsplit(boo, 2), ",", " ")

rownames(a, rowlab)
colnames(a, collab)
print a

# ----- using func2 -----------------------------

bundle zoo = func2(3,2)
rowlab = zoo["Rlab"]
collab = zoo["Clab"]
a = zoo["X"]

rownames(a, rowlab)
colnames(a, collab)
print a
</hansl>

Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche

r.lucchetti@...
http://www.econ.univpm.it/lucchetti
Giuseppe Vittucci | 3 Nov 2011 10:31
Picon
Favicon

Exact collinearity and modprint

Dear all,

when in a regression one or more variables are omitted due to exact
collinearity, the command modprint leads to misleading results cause the
initial list of regressors does not match the vector of coefficients
returned by gretl.

Is there a way to retrieve the list of regressors dropped by gretl or
the list of regressors eventually used in the regression?

Thanks
Giuseppe

Sam Buxton | 2 Nov 2011 11:51
Picon
Favicon

How to in Gretl

Hi all,

I am having problems doing a number of things in gretl. I was just 
wondering if anyone could help if they know how to produce the following 
models in gretl

1) exponential smoothing
2) moving average
3) naive model
4) bass diffusion model.

Thanks a speedy response would be greatly apprecieated.

Sam

-- 
Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi,
gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig
gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y
neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar
unwaith a dilëwch y neges. Os na fwriadwyd anfon y neges atoch chi,
rhaid i chi beidio â defnyddio, cadw neu ddatgelu unrhyw wybodaeth a
gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i
hanfonodd yn unig  ac nid yw o anghenraid yn cynrychioli barn
Prifysgol Bangor. Nid yw Prifysgol Bangor yn gwarantu
bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau neu
100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn
nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract
rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa
Cyllid Prifysgol Bangor.  www.bangor.ac.uk

This email and any attachments may contain confidential material and
is solely for the use of the intended recipient(s).  If you have
received this email in error, please notify the sender immediately
and delete this email.  If you are not the intended recipient(s), you
must not use, retain or disclose any information contained in this
email.  Any views or opinions are solely those of the sender and do
not necessarily represent those of the Bangor University.
Bangor University does not guarantee that this email or
any attachments are free from viruses or 100% secure.  Unless
expressly stated in the body of the text of the email, this email is
not intended to form a binding contract - a list of authorised
signatories is available from the Bangor University Finance
Office.  www.bangor.ac.uk

Pierre Chausse | 3 Nov 2011 14:55
Picon
Picon
Favicon

Re: How to in Gretl

Nothing is more speedy than Google.

For example, the following online textbook explains everything you need

http://www.learneconometrics.com/gretl/using_gretl_for_POE4.pdf






On 02/11/11 06:51 AM, Sam Buxton wrote:
Hi all, I am having problems doing a number of things in gretl. I was just wondering if anyone could help if they know how to produce the following models in gretl 1) exponential smoothing 2) moving average 3) naive model 4) bass diffusion model. Thanks a speedy response would be greatly apprecieated. Sam


--
Pierre Chaussé
Assistant Professor
Department of Economics
University of Waterloo
<div>
    Nothing is more speedy than Google.<br><br>
    For example, the following online textbook explains everything you
    need<br><br><a class="moz-txt-link-freetext" href="http://">http://</a><a class="moz-txt-link-abbreviated" href="http://www.learneconometrics.com/">www.learneconometrics.com/</a>gretl/using_gretl_for_POE4.pdf<br><br><br><br><br><br><br>
    On 02/11/11 06:51 AM, Sam Buxton wrote:
    <blockquote cite="mid:4EB120C0.4090206@..." type="cite">
      Hi all,

I am having problems doing a number of things in gretl. I was just 
wondering if anyone could help if they know how to produce the following 
models in gretl

1) exponential smoothing
2) moving average
3) naive model
4) bass diffusion model.

Thanks a speedy response would be greatly apprecieated.

Sam

    </blockquote>
    <br><br><div class="moz-signature">-- <br>Pierre Chauss&eacute;<br>
      Assistant Professor<br>
      Department of Economics<br>
      University of Waterloo</div>
  </div>

Gmane