<Previous version of Ox>

# Ox 4.0: new features and fixes

New features and enhancements
Fixed problems and new features in 4.1
Problems fixed in 4.04
Problems fixed in 4.02
Problems in version 3.40 fixed in 4.00
OxGauss

## New features and enhancements

- Added `switch` and `switch_single` language constructs (and keywords).
- Direct access to data member variables of a class can now be provided (`struct`, `public`, `protected`). In a `struct` all members are public. In a `class`, `public` can be used to make data public (but `protected` and `public` do not apply to functions).
- New default uniform random number generator (MWC8222_52) with period 2^8222 and using full 52-bit floating point precision. Also new (and faster) standard normal generator based on the ziggurat method. Use `ranseed("PM")` to reset the old default for uniform and normal, in order to replicate results from older Ox versions.
- New FFT function `fft1d`, which is faster and works for arbitrary sample size. The original `fft` now uses the faster FFT version, and still converts the sample size to a power of two. Modified `dfft` to make it compatible with `fft1d`/`fft1d`. The new FFT is based on FFTE 2.0 by Daisuke Takahashi.
- `dayofeaster`, `dayofmonth`, `timeofday`, `"%C"` format.
- W test for normality (NormTestW in lib/normtest).
- Added `polyeval`.
- `MaxSQP`: removed singularity message in Maratos correction (now QR based), and many other improvements.
- `%t` and `%T` `sscan`/`fscan` formats to scan a token
- `%v` `sscan`/`fscan` and `print`/`fprint` formats to read and write values a Ox constant (literals). This can be used, e.g. to read and write the entire contants of a class object. An example is in `samples/inout/percent_v.ox`.
- Small improvement to format handling in `print`/`fprint` makes it easier to print strings with % in it. For example in `print("%s", "%GDP")` the second argument is treated as a string to print, not as a format.
- `Database` class uses `findsample` in `SetSelSample`; added `GetSelSampleMode`/`SetSelSampleMode`; added `Save` and `SetVar`. Added support for daily data (dated database). Ability to read Excel files with date/time columns.
- Extensions to `Modelbase` class to support many enhancements of OxPack.
- Added `findsample`; `loadmat`/`savemat` can handle variable names
- Slightly more accurate tailn/probn for probablities > 1e-20 (about 14-15 significant digits correct, instead of 10-11 before).
- Ox can run Ox files that use non-English characters in the filename (Windows 2000/XP).
- The default symbol table size is now 3000.

## Fixed problems and new features in version 4.1:

- Improved PcFiml output for single equation models.
- 10^10 as a constant expression (i.e. outside any function) would overflow (using integer arithmetic). Now works same as the run-time expression.
- `Modelbase::DoOptionsDlg` calls `SaveOptions()` when successful.
- The 64-bit version of Ox defines OX_64_BIT. Also, the 64-bit version will first try `xyz_64` (with the appropriate .so or .dll extension) if the dynamic link library is specified as `xyz` in the extern statement. So now, e.g., `arfima.so` and `arfima_64.so` can be installed in the arfima folder, and the correct version will be used automatically.
- Fixed several problems with loading CSV files.
- `densbinomial`, `densgeometric`, `densnegbin` returned .NaN with p=1 or p=0.
- Random number generators for distributions with two parameters (such as `rangamma`) would in some circumstances use the second argument as the third. This would only happen if they are both matrices, conformant to the dimension of the generated matrix (so not if both are scalars, the most common case).
- The following code:

      	  decl as = {"a","b"}, v = <0,1,2>;
      	  println(as[v[<0:1>]]);

  gave a runtime error: 'matrix[1][2]' cannot cast to int while it should just work.
- Select Variables dialog (OP_SELECTVAR) would allow database changes based on the previous incantation rather than the current. The actual database change also didn't work.
- `GetSampleByIndex` in help: link does not work
- `countc` could crash; now the second argument in `countc`/`countr` can be a column as well as a row vector
- Fixed some corner cases of `probf`/`tailf`: argument 0 always returns 0 (1 for `tailf`), +.Inf returns 1 (0 for `tailf`).
- `quanbeta` breaks down for large values of a and b (when distribution becomes quite rectangular). This was partially because of bad starting values.
- `unvech` with a scalar argument returns 0 instead of a 1x1 matrix with the scalar.
- reading xls file with embedded chart data (perhaps without actually holding a chart) could go wrong.
- Missing values for min/max in `DrawAxis` causes infinite loop
- `PcFiml` class: Chow test didn't work in a model without regressors.

## Problems which have been fixed in version 4.04:

- Ox Console install in OxEdit: added Ox - compile command to Run menu.
- Changed .oxo link error to a warning if a version 3 compiled oxo file is used under version 4. Note that this will not help with code that imports a class that has changed (Database, Modelbase e.g.).
- `countc`/`countr` now skip over missing values.
- `savemat` for .mat/.fmt file: now ignores third argument if it is an array (previously generated a run-time error).
- Loading Excel files:
  Problem: if the first column looks like it defines a fixed frequency sample and has no label, it is not loaded. This has been fixed: the first column is maintained if it has a label or if it has numeric data. (same as GiveWin and Ox 3, Ox 4.00/4.02 would drop it).
  Enhancements:
  - A dot or any text starting with #N/A is treated as a missing value (previously it was only #N/A exactly).
  - Now dropping columns which have no entries at all (as happened in Ox 3/GiveWin)
  - `loadmat` defaults to treating strings as missing values (this is as in Ox 3, but different from loading an Excel file using the Database class). Dates are also left untranslated by default. This maintains symmetry between `loadmat` and `savemat`.
  - If the format argument of `loadmat` is set to 1 for an xls file, strings and dates are read in the same way as using the Database class. So `loadmat("x.xls")` is now the same as Ox 3.x), while `loadmat("x.xls", 1)` maintains strings as numbers and translates dates).
- `deletec(x,<>)` and `selectc(x,<>)` crash on empty second argument.
- `insertc`/`insertr` at the position of one plus the last column/row crashes.

## Problems in version 4.00 which have been fixed in version 4.02:

- OxPack:
  - main help command was not working
  - No `OP_ESTIMATE` or `OP_ESTIMATE_NODB`: always switch test menu entries on.
- `Modelbase::DbDrawTMatrix` did not grow the database correctly when required.
- `eigensym`: possible error in eigenvectors of blockdiagonal symmetric matrix.
- `eigensymgen`: now much faster for large matrices.
- `switch`/`switch_single` which doesn't end with `default` leads to IE Stack Error if the last case is executed and FALSE. `CTL_SAMPLEINDEX` field inside `OP_MATRIX_CTL`: entering a number before the inline edit field is shown leads to crash (is fine in all other control types)
- `getenv` will (most likely) lead to a crash
- 64-bit linux only: using a log file can lead to a crash when printing strings with string format specifier.
- g2ox.ox: `loaddata` and `savedata` definition wrong

## Problems in version 3.40 which have been fixed in version 4.00:

- Fixed problem with: `delete x[i]` where x is an array of objects.
- Fixed: accessing a baseclass static variable from inside a derived class did not work, because it behaved as if the derived class had its own copy. Using the baseclass's access function (if written) would work correctly though.
- this->undeclared[someindex] = somevalue; would lead to crash in parsing after several warning messages
- Fixed problem with destructor within namespace
- trace of a scalar double is wrong (so no problem with `trace(<1>)` but with `trace(1.0)`). `cdiv(< .;1 >,< .;1 >)` would give divide by zero warning. Now it returns `< .;. >`.
- The following should work but gave an error message that a scalar was expected:

      	  decl v = <10, 20>, a = new array[ v[0] ];

- `countr`, `countc`: if the intervals are not ordered, the return value is filled with missing values.
- `sortcindex(<>)` crashes.
- Cannot load an in7/bn7 data file which has only one observation.
- `MaxSQP` could (rarely: when `vc.==0`) get stuck in an infinite loop in the computation of the slope w.r.t. constraints in merit function. Also improved `MaxSQP` line search.
- `SolveQP_chol` could (very rarely) get stuck in an infinite loop when the `ddiag` value is zero.

## OxGauss

- Added support for `varput`/`varget`.
- Fixed a bug has been identified in a procedure which (1) calls as yet undefined procedures, (2) includes two or more for loops. In that case, the second (and further) loop incrementation can go awry. The reason is that there is insufficient space for the loop-local variables on the stack.
- Fixed bug in y/x when it means regression and trap(2) is on (replacing missing values with 0). ftos with character matrix didn't work:

      	    let s = "test";
      		print ftos( s, "%*.*s", 7, 7 );

Ox version 4.10. © JA Doornik

This file last changed
.