# 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:

- data : structure with data
- weight : structure with weights

Output:

- weight : structure with added weights from data

## 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