| Libgretl Reference Manual |
|---|
printoutprintout — |
#define GRETL_DIGITS #define GRETL_MP_DIGITS #define PAGELINES void session_time (PRN *prn); void logo (void); void lib_logo (void); void gui_script_logo (PRN *prn); void gui_logo (PRN *prn); void text_print_model_confints (const CoeffIntervals *cf, PRN *prn); void print_freq (const FreqDist *freq, PRN *prn); void print_xtab (const Xtab *tab, gretlopt opt, PRN *prn); void print_smpl (const DATAINFO *pdinfo, int fulln, PRN *prn); void print_contemp_covariance_matrix (const gretl_matrix *m, double ldet, PRN *prn); int outcovmx (MODEL *pmod, const DATAINFO *pdinfo, PRN *prn); void obs_marker_init (const DATAINFO *pdinfo); void print_obs_marker (int t, const DATAINFO *pdinfo, PRN *prn); void varlist (const DATAINFO *pdinfo, PRN *prn); void maybe_list_vars (const DATAINFO *pdinfo, PRN *prn); int get_printdata_blocks (void); int printdata (const int *list, const char *mstr, const double **Z, const DATAINFO *pdinfo, gretlopt opt, PRN *prn); int print_data_sorted (const int *list, const int *obsvec, const double **Z, const DATAINFO *pdinfo, PRN *prn); int text_print_fit_resid (const FITRESID *fr, const DATAINFO *pdinfo, PRN *prn); int print_fit_resid (const MODEL *pmod, const double **Z, const DATAINFO *pdinfo, PRN *prn); int text_print_forecast (const FITRESID *fr, double ***pZ, DATAINFO *pdinfo, gretlopt opt, PRN *prn); void print_iter_info (int iter, double crit, int type, int k, const double *b, const double *g, double sl, PRN *prn); void text_print_vmatrix (VMatrix *vmat, PRN *prn); void gretl_print_fullwidth_double (double x, int digits, PRN *prn); void gretl_print_value (double x, PRN *prn); char* gretl_fix_exponent (char *s); void bufspace (int n, PRN *prn); void print_centered (const char *s, int width, PRN *prn); void gretl_printxn (double x, int n, PRN *prn); int do_printf (const char *line, double ***pZ, DATAINFO *pdinfo, PRN *prn); int generate_obs_markers (const char *s, double ***pZ, DATAINFO *pdinfo); int in_usa (void); char* bufgets (char *s, size_t size, const char *buf); void bufgets_init (const char *buf); void bufgets_finalize (const char *buf); void scroll_pause (void); int scroll_pause_or_quit (void);
void session_time (PRN *prn);
Print the current time to the specified printing object,
or to stdout if prn is NULL.
prn : |
where to print. |
void gui_script_logo (PRN *prn);
Print to prn a header for script output in gui program.
prn : |
gretl printing struct. |
void gui_logo (PRN *prn);
Print gretl GUI version information to the specified printing
object, or to stdout if prn is NULL.
prn : |
where to print. |
void text_print_model_confints (const CoeffIntervals *cf, PRN *prn);
Print to prn the 95 percent confidence intervals for parameter
estimates contained in cf.
cf : |
pointer to confidence intervals. |
prn : |
gretl printing struct. |
void print_freq (const FreqDist *freq, PRN *prn);
Print frequency distribution to prn.
freq : |
gretl frequency distribution struct. |
prn : |
gretl printing struct. |
void print_xtab (const Xtab *tab, gretlopt opt, PRN *prn);
Print crosstab to prn.
tab : |
gretl cross-tabulation struct. |
opt : |
|
prn : |
gretl printing struct. |
void print_smpl (const DATAINFO *pdinfo, int fulln, PRN *prn);
Prints the current sample information to prn.
pdinfo : |
data information struct |
fulln : |
full length of data series. |
prn : |
gretl printing struct. |
void print_contemp_covariance_matrix (const gretl_matrix *m, double ldet, PRN *prn);
m : |
|
ldet : |
|
prn : |
int outcovmx (MODEL *pmod, const DATAINFO *pdinfo, PRN *prn);
Print to prn the variance-covariance matrix for the parameter
estimates in pmod.
pmod : |
pointer to model. |
pdinfo : |
data information struct. |
prn : |
gretl printing struct. |
| Returns : | 0 on successful completion, error code on error. |
void obs_marker_init (const DATAINFO *pdinfo);
Check the length to which observation markers should be printed, in a tabular context. (We don't want to truncate 10-character date strings by chopping off the day.)
pdinfo : |
data information struct. |
void print_obs_marker (int t,
const DATAINFO *pdinfo,
PRN *prn);
Print a string (label, date or obs number) representing the given t.
t : |
observation number. |
pdinfo : |
data information struct. |
prn : |
gretl printing struct. |
void varlist (const DATAINFO *pdinfo, PRN *prn);
Prints a list of the names of the variables currently defined.
pdinfo : |
data information struct. |
prn : |
gretl printing struct |
void maybe_list_vars (const DATAINFO *pdinfo, PRN *prn);
Prints a list of the names of the variables currently defined, unless gretl messaging is turned off.
pdinfo : |
data information struct. |
prn : |
gretl printing struct |
int printdata (const int *list,
const char *mstr,
const double **Z,
const DATAINFO *pdinfo,
gretlopt opt,
PRN *prn);
Print the data for the variables in list, from observations t1 to
t2.
list : |
list of variables to print. |
mstr : |
optional string holding names of matrices to print. |
Z : |
data matrix. |
pdinfo : |
data information struct. |
opt : |
if OPT_O, print the data by observation (series in columns);
if OPT_N, use simple obs numbers, not dates; if OPT_T, print the
data to 10 significant digits; if OPT_L, print the data to a number
of digits set by "set longdigits" (default 10).
|
prn : |
gretl printing struct. |
| Returns : | 0 on successful completion, 1 on error. |
int print_data_sorted (const int *list,
const int *obsvec,
const double **Z,
const DATAINFO *pdinfo,
PRN *prn);
Print the data for the variables in list, using the sort order
given in obsvec. The first element of obsvec must contain the
number of observations that follow. By default, printing is plain
text, formatted in columns using space characters, but if the prn
format is set to GRETL_FORMAT_CSV then printing respects the user's
choice of column delimiter.
list : |
list of variables to print. |
obsvec : |
list of observation numbers. |
Z : |
data matrix. |
pdinfo : |
data information struct. |
prn : |
gretl printing struct. |
| Returns : | 0 on successful completion, non-zero code on error. |
int text_print_fit_resid (const FITRESID *fr, const DATAINFO *pdinfo, PRN *prn);
fr : |
|
pdinfo : |
|
prn : |
|
| Returns : |
int print_fit_resid (const MODEL *pmod, const double **Z, const DATAINFO *pdinfo, PRN *prn);
Print to prn the fitted values and residuals from pmod.
pmod : |
pointer to gretl model. |
Z : |
data array. |
pdinfo : |
data information struct. |
prn : |
gretl printing struct. |
| Returns : | 0 on successful completion, 1 on error. |
int text_print_forecast (const FITRESID *fr, double ***pZ, DATAINFO *pdinfo, gretlopt opt, PRN *prn);
Print the forecasts in fr to prn, and also plot the
forecasts if OPT_P is given.
fr : |
pointer to structure containing forecasts. |
pZ : |
pointer to data array. |
pdinfo : |
dataset information. |
opt : |
if includes OPT_P, make a plot of the forecasts.
|
prn : |
printing structure. |
| Returns : | 0 on success, non-zero error code on error. |
void print_iter_info (int iter,
double crit,
int type,
int k,
const double *b,
const double *g,
double sl,
PRN *prn);
Print to prn information pertaining to step iter of an
iterative estimation process.
iter : |
iteration number. |
crit : |
criterion (e.g. log-likelihood). |
type : |
type of criterion (C_LOGLIK or C_OTHER)
|
k : |
number of parameters. |
b : |
parameter array. |
g : |
gradient array. |
sl : |
step length. |
prn : |
gretl printing struct. |
void gretl_print_fullwidth_double (double x,
int digits,
PRN *prn);
x : |
|
digits : |
|
prn : |
char* gretl_fix_exponent (char *s);
Some C libraries (e.g. MS) print an "extra" zero in the exponent when using scientific notation, e.g. "1.45E-002". This function checks for this and cuts it out if need be.
s : |
string representation of floating-point number. |
| Returns : | the fixed numeric string. |
void print_centered (const char *s,
int width,
PRN *prn);
If the string s is shorter than width, print it centered
in a field of the given width (otherwise just print it
straight).
s : |
string to print. |
width : |
width of field. |
prn : |
gretl printing struct. |
void gretl_printxn (double x,
int n,
PRN *prn);
Print a string representation of the double-precision value x
in a format that depends on n.
x : |
number to print. |
n : |
controls width of output. |
prn : |
gretl printing struct. |
int do_printf (const char *line,
double ***pZ,
DATAINFO *pdinfo,
PRN *prn);
Implement a somewhat limited version of C's printf for use in gretl scripts.
line : |
command line. |
pZ : |
pointer to data array. |
pdinfo : |
dataset information. |
prn : |
printing struct. |
| Returns : | 0 on success, non-zero on error. |
int generate_obs_markers (const char *s,
double ***pZ,
DATAINFO *pdinfo);
s : |
|
pZ : |
|
pdinfo : |
|
| Returns : |
char* bufgets (char *s,
size_t size,
const char *buf);
This function works much like fgets, reading successive lines
from a buffer rather than a file. It differs from fgets in
that it discards the line termination ("\n" or "\r\n") on output.
Important note: use of bufgets() on a particular buffer must be
preceded by a call to bufgets_init() on the same buffer, and must be
followed by a call to bufgets_finalize(), again on the same
buffer.
s : |
target string (must be pre-allocated). |
size : |
maximum number of characters to read. |
buf : |
source buffer. |
| Returns : | s (or NULL if nothing more can be read from buf).
|
void bufgets_init (const char *buf);
Initializes a text buffer for use with bufgets().
buf : |
source buffer. |
void bufgets_finalize (const char *buf);
Signals that we are done reading from buf.
buf : |
source buffer. |
| << Printing and graphing | modelprint >> |