COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### classregtree #3

• Follow

```In the documentation of stats toolbox, readable on
http://www.mathworks.com/access/helpdesk/help/toolbox/stat/classregtree.html
it is said that we can use a "weights" option. I dont understand how we can do it.
Somebody can help me?

thanks

Maurice
```
 0

```"Maurice " <maurice.charbit@telecom-paristech.fr> wrote in message <ht07q0\$84r\$1@fred.mathworks.com>...
> In the documentation of stats toolbox, readable on
>         http://www.mathworks.com/access/helpdesk/help/toolbox/stat/classregtree.html
> it is said that we can use a "weights" option. I dont understand how we can do it.
> Somebody can help me?
>
> thanks
>
> Maurice

Hi Maurice, weights is a numeric vector of nonnegative numbers. There must be one weight for each observation in your dataset, which means that the number of weights has to equal the number of elements in the row dimension of your X matrix. Remember, each column of X is a predictor variable and the number of elements in every column of X is your number of observations. By default, every observation is given an equal weight of one, which in essence says that all the observations are deemed to be equally precise, of equal quality, or equally reliable, depending on how you want to look at it.

I'm assuming the fact that you are considering the weights option means that you want to downweight, i.e. reduce the influence, some of your observations?

The syntax is just as shown in the documentation:

w = ones(100,1); % weights vector obviously these are just ones

% some junk data
X = randn(100,2);
y = randn(100,1);
T = classregtree(X,y,'weights',w);

Wayne
```
 0

1 Replies
56 Views

5/24/2013 7:02:56 PM