Weibulldf and Xyreadr: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Scott
 
Line 1: Line 1:
===Purpose===
===Purpose===


Weibull distribution.
Reads one or more ASCII XY or XY... files into a DataSet object.


===Synopsis===
===Synopsis===


:prob = weibulldf(function,x,a,b)
:out = xyreadr(file,delim,options)


===Description===
===Description===


Estimates cumulative distribution function (cumulative, cdf), probability density function (density, pdf), quantile (inverse of cdf), or random numbers for a Weibull distribution.
Reads standard XY ASCII files in which the first column is a column of axisscale values (wavelengths, retention times, etc) and the second and possibly subsequent column(s) are values measured at the corresponding axisscale values. Returns a DataSet object with the first column of the file as the axisscale and all subsequent columns (both in the same file and in multiple files) concatenated and transposed as rows.  
 
This distribution is used to model lifetime data (time to failure). It is skewed to the right, but may appear symmetric for data in which there are relatively no small outcomes. Negative values in the sample are ignored.
 


It is '''REQUIRED''' that, if multiple files are being read, they must all have the same X range. If this is not true, the import may fail.


====Inputs====
====Inputs====


* '''function''' = [ {'cumulative'} | 'density' | 'quantile' | 'random' ], defines the functionality to be used. Note that the function recognizes the first letter of each string so that the string could be: [ 'c' | 'd' | 'q' | 'r' ].
* '''file''' = One of the following identifications of files to read:
 
: '''a)''' a single string identifying the file to read
* '''x''' = matrix in which the sample data is stored, in the interval (-inf,inf).
:: ('example.txt')
 
: '''b)''' a cell array of strings giving multiple files to read
'''for''' function=quantile - matrix with values in the interval (0,1).
::  ({'example_a' 'example_b' 'example_c'})
 
: '''c)''' an empty array indicating that the user should be prompted to locate the file(s) to read
*   '''for''' function=random - vector indicating the size of the random matrix to create.
::  ([])
 
* '''delim''' = An optional string used to specify the delimiter character.
* '''a''' = scale parameter (real).
::Supported delimiters include:
 
:* ''''tab'''' or  '\t' or sprintf('\t')
* '''b''' = shape parameter (real and positive).
:* ''''space'''' or  ' '
 
:* ''''comma'''' or  ','
'''Note''': If inputs (x, a, and b) are not equal in size, the function will attempt to resize all inputs to the largest input using the RESIZE function.
:* ''''semi''''   or  ';'
 
:* ''''bar''''   or  '|'
'''Note''': Functions will typically allow input values outside of the acceptable range to be passed but such values will return NaN in the results.
::If (delim) is omitted, the file will be searched for a delimiter common to all rows of the file and producing an equal number of columns in the result.
 
===Examples===
 
====Cumulative:====
 
>> prob = weibulldf('c',2,1,2)
 
prob =
 
    0.9817
 
>> x    = [0:0.1:10];
 
>> plot(x,weibulldf('c',x,1,2),'b-',x,weibulldf('c',x,3,7),'r-')
 
====Density:====
 
>> prob = weibulldf('d',2,1,1)
 
prob =
 
    0.1353
 
>> x    = [0:0.1:10];
 
>> plot(x,weibulldf('d',x,2,1),'b-',x,weibulldf('d',x,0.5,1),'r-')
 
====Quantile:====
 
>> prob = weibulldf('q',0.5,1,2)
 
prob =
 
    0.8326
 
====Random:====


>> prob = weibulldf('r',[4 1],2,1)
====Outputs====


ans =
* '''out''' = a DataSet object with the first column of the file(s) stored as the axisscale{2} values and all subsequent column(s) stored as rows of data.


    5.4812
===Options:===


    4.9755
*'''commentcharacter''': [<nowiki>''</nowiki>] any line that starts with the given character will be considered a comment and parsed into the"comment" field of the DataSet object. Deafult is no comment character. Example: '%' uses % as a commentcharacter.


    1.0562
* '''headerrows''': [{0}] number of header rows to expect in the file.


    4.4820
* '''waitbar''': [ 'off' |{'on'} ] governs use of waitbars to show progress.


===See Also===
===See Also===


[[betadr]], [[cauchydf]], [[chidf]], [[expdf]], [[gammadf]], [[gumbeldf]], [[laplacedf]], [[logisdf]], [[lognormdf]], [[normdf]], [[paretodf]], [[raydf]], [[triangledf]], [[unifdf]]
[[autoimport]], [[areadr]], [[dataset]], [[xclgetdata]], [[xclreadr]]

Latest revision as of 16:37, 21 September 2011

Purpose

Reads one or more ASCII XY or XY... files into a DataSet object.

Synopsis

out = xyreadr(file,delim,options)

Description

Reads standard XY ASCII files in which the first column is a column of axisscale values (wavelengths, retention times, etc) and the second and possibly subsequent column(s) are values measured at the corresponding axisscale values. Returns a DataSet object with the first column of the file as the axisscale and all subsequent columns (both in the same file and in multiple files) concatenated and transposed as rows.

It is REQUIRED that, if multiple files are being read, they must all have the same X range. If this is not true, the import may fail.

Inputs

  • file = One of the following identifications of files to read:
a) a single string identifying the file to read
('example.txt')
b) a cell array of strings giving multiple files to read
({'example_a' 'example_b' 'example_c'})
c) an empty array indicating that the user should be prompted to locate the file(s) to read
([])
  • delim = An optional string used to specify the delimiter character.
Supported delimiters include:
  • 'tab' or '\t' or sprintf('\t')
  • 'space' or ' '
  • 'comma' or ','
  • 'semi' or ';'
  • 'bar' or '|'
If (delim) is omitted, the file will be searched for a delimiter common to all rows of the file and producing an equal number of columns in the result.

Outputs

  • out = a DataSet object with the first column of the file(s) stored as the axisscale{2} values and all subsequent column(s) stored as rows of data.

Options:

  • commentcharacter: [''] any line that starts with the given character will be considered a comment and parsed into the"comment" field of the DataSet object. Deafult is no comment character. Example: '%' uses % as a commentcharacter.
  • headerrows: [{0}] number of header rows to expect in the file.
  • waitbar: [ 'off' |{'on'} ] governs use of waitbars to show progress.

See Also

autoimport, areadr, dataset, xclgetdata, xclreadr