Learn R Programming

BBEST (version 0.1-8)

set.data: Set data

Description

The function sets key parameters necessary for the fit, such as sigma, lambda and SB

Usage

set.data(x, y, sigma=NA, lambda=NA, SB=NA)

Arguments

x

numeric vector, specifies grid points.

y

numeric vector, specifies function values.

sigma

numeric vector, if not NA, specifies estimated noise.

lambda

numeric vector, if not NA, specifies estimated mean signal magnitude.

SB

numeric vector, if not NA, specifies estimated coherent baseline.

Value

A list with elements

x

numeric vector, specifies gridpoints.

y

numeric vector, specifies function values.

sigma

numeric vector, specifies estimated noise.

lambda

numeric vector, specifies estimated mean signal magnitude.

SB

numeric vector, specifies estimated coherent baseline.

Details

One way (not the simplest) to prepare experimental data for the fit. This function returns a list of the above parameters -- an object of type data. Objects of that type are used as arguments for some functions implemented in the package. In most cases only the elements x and y are required in the object data. However, all 5 elements (and one optional, see set.Gr) must be specified to execute the fit, i.e. prior to the do.fit call.

The object of that type can also be created via read.data, read.sqa and read.sqb. Parameters "sigma", "lamdba" and "SB" can be determined automatically, see set data keyword.

The general recipe for setting an object data is the following. If vectors x and y are stored in the text file, use read.data. If they are stored in a .sqb-file, call read.sqb. If they are stored in the memory, use set.data. Then use functions set.sigma, set.lambda, and set.SB) to specify the remaining parameters.