SIGN

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

SIGN

Previous pageReturn to chapter overviewNext page

This statement prints out information regarding the model signature in the model file (.frm), and the 'true' hash code corresponding to the model file (and whether they are identical). You can use the SIGN statement to obtain the hash code for signing a new (or changed) model. (If the model is unsigned, click the link 'more' to obtain a comment line with signature that can be copy-pasted into the .frm file.)

 

The hashcode is a kind of check-sum or fingerprint regarding .frm files. The signatures are technically so-called MD5 hashes, and can be put into .frm file as commentaries (for example: // Signature: fp88RzyZfJNaoTi3I4X3Ww). This string of 22 characters and digits (note: the hash code is case-sensitive!) identifies a specific model file, so altering the model file will result in a different hash code. The motivation behind the signatures is two-fold: (a) To be able to make sure that an official model version has not accidently been changed, and (b) The signatures are used to identify models for caching (faster loading). When calculating the signature (hash code), empty lines and comment lines are ignored (except for comments containing model block identifiers ###), so you may insert empty lines or comments any way you like in the .frm file and preserve the signature (any variable list after the VARLIST; or VARLIST$ tag will be ignored in the hashcode, too). But changing the equations (FRML) in any way will result in a new hash code. The hash code is technically 128 bits, and this means that the probability of two different model files having the same hash code is 2^(-128) = 2.9E-39 (that is, effectively zero).

 

 


 

Syntax

 

sign;

 


 

Examples

 

To obtain a signature for a (unsigned) model loaded with the MODEL statement, type:

 

sign;

 

You will get an output similar to this:

 

No signature was found in model file (more)
 - Signature in model file      : [not found]
 - True model file hash code    : fp88RzyZfJNaoTi3I4X3Ww

 

Try clicking the 'more' link to obtain a line similar to this:

 

// Signature: fp88RzyZfJNaoTi3I4X3Ww

 

This line can be copy-pasted into the .frm file (typically at the top), which signs the mode. After this, you will be told that the model signature is OK when loading the (unaltered) model with the MODEL statement.

 

 


 

Note

 

You may put other meta-information into the model file (.frm). As of now, Info, Date, Freq and Signature fields are supported. For instance:

 

// Info: Model used for forecasting 2012-2030

// Date: 7-11-2012 15:37:00

// Freq: q

// Signature: fp88RzyZfJNaoTi3I4X3Ww

 

Gekko will complain if this format deviates, for instance the Info field is to be written with capital 'I', with no blank before the colon, and one blank after the colon. This rigorousness regarding form is to make it easy to spot the information in different .frm files. The Info and Date fields will be displayed when loading the model (MODEL statement).

 

 


 

Related statements

 

MODEL, SIM