<< nistdataset_getpath nistdataset

nistdataset >> nistdataset > nistdataset_read

nistdataset_read

Reads a dataset from NIST

Calling Sequence

data = nistdataset_read(filename)

Parameters

filename :

a 1-by-1 matrix of strings, the name of the file to read

data :

a data structure containing the data from the file

Description

The data variable has type NISTDTST and contains several fields. The fields of the data structure are self-explanatory.

Some fields are mandatory, including: name, category, description, reference.

Some files do not have datastring and model fields.

Depending on the category, some fields are optional.

If the category is "Nonlinear Least Squares Regression", then the following fields are set: modelNumberOfParameters, modelEq, modelPar, modelFun, residualSumOfSquares, residualStandardDev, degreeFreedom, numberOfObservations, x, y, start1, start2, parameter, standarddeviation.

In the "Nonlinear Least Squares Regression" category, the field "modelFun" is a function which evaluates the model function. The "modelFun" function has the header :

y = modelFun(x,b)
where x is a m-by-n matrix of doubles, the input of the model, b is a 1-by-numberOfParameters matrix of doubles, the parameters, and y is a m-by-n matrix of doubles, the output of the model. For example, the "modelFun" field can be used to benchmark regression methods or Non Linear Least Squares solvers.

If the category is "Univariate" or "Univariate: Summary Statistics", then the following fields are set: sampleMean, sampleSTD, sampleAutocorr, y.

Examples

// Read "datasets/nls/lower/Gauss2.dat"
path = nistdataset_getpath();
filename = fullfile(path,"datasets","nls","lower","Gauss2.dat");
data = nistdataset_read(filename)
// Plot the data
scf();
plot(data.x,data.y,"bo")
// See the number of parameters
data.modelNumberOfParameters
// Evaluates the model at one point
y = data.modelFun(data.x(1),data.parameter)
// Evaluates the model at all x points
y = data.modelFun(data.x,data.parameter);
// Plots the model against the data
h = scf();
plot(data.x,y,"r-");
plot(data.x,data.y,"bo");
legend(["Model","Data"]);
xtitle("Gauss2","X","Y");
h.children.children(3).children.thickness = 2;

// Read "datasets/univ/Lottery.dat"
path = nistdataset_getpath();
filename = fullfile(path,"datasets","univ","Lottery.dat");
data = nistdataset_read(filename)
// Compare the sample mean with the reference mean
data.sampleMean
mean(data.y)

// See the files in "datasets/univ"
path = nistdataset_getpath();
ls(fullfile(path,"datasets","univ"))

// See the files in "datasets/nls/lower"
path = nistdataset_getpath();
ls(fullfile(path,"datasets","nls","lower"))

Bibliography

Statistical Reference Datasets, http://www.itl.nist.gov/div898/strd/

Authors


Report an issue
<< nistdataset_getpath nistdataset