Reads a dataset from NIST
data = nistdataset_read(filename)
a 1-by-1 matrix of strings, the name of the file to read
a data structure containing the data from the file
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)
If the category is "Univariate" or "Univariate: Summary Statistics", then the following fields are set: sampleMean, sampleSTD, sampleAutocorr, y.
// 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")) | ![]() | ![]() |
Statistical Reference Datasets, http://www.itl.nist.gov/div898/strd/