Can't reproduce bootstrap regression result matlab

24 views Asked by At

I have a simple linear regression. I want to obtain the standard errors of this regression by bootstrap. I want to start by obtaining the betas of the regression from the bootstrap, because i need to compute other quantities with those betas as well.

I am running the following code in matlab.

beta_bootstr=bootstrp(k,@(bootr)regress(RES.yhat+bootr,XX),r);

My problem is simple: every time I run this code I get a different result.

I tried to add a seed before:

rng('default')

beta_bootstr=bootstrp(k,@(bootr)regress(RES.yhat+bootr,XX),r);

But it does nothing.

How can I make sure the results can be replicated? Thank you.

Nvm i solved it- i needed to reset(stream).

0

There are 0 answers