setweights

Sets automatically the weights for the data (to be used in a regression)

Contents

Syntax

weight = setweights (data, weight)

Description

computes weights for given data and adds it to the weight structure for the zero-variate data y the weight will be min\left(100, \frac{1}{\max\left(10^-^6}, y\right ) ^2} \right) for the uni-variate data y the weight will be \frac{1}{N \bar{y}^2\right )

Inputs:

Output:

Example of use

weight = setweights(data, []) computes the data weights for all data and outputs a new structure weight with the results weight = setweights(data, weight) computes the missing data weights in structure weight and adds them to it