Re: Weird problem with fmincon on 2008b




"Steve Thomas" <tdasddt@xxxxxxxxxx> wrote in message
news:h1mlum$ovf$1@xxxxxxxxxxxxxxxxxxxxx
Hi John, Steven

Thanks for your responses. I agree my explanation is rather poor so I will
restate. I am simulating a data generating process hence the use of randn.
I know the parameters a priori and wish to assess the accuracy of
estimates of the parameters in the presence of certain pertubations.
Everything goes well until I open up a second instance of Matlab 2008b (in
Win XP). In the second instance, I keep getting a matrix is singular error
for the same problem (in the meantime, the first instance of Matlab keeps
runnning smoothly)!

Could it be that that two instances of Matlab are concurrently requesting
some resource/process, with the first instance of Matlab having priority
over the second? Is this a known problem?

Possible, but doubtful. I think it's FAR more likely an issue with the
pseudorandom number generator state.

Start one session of MATLAB and perform some operations involving RAND,
RANDN, and/or RANDI. Then generate a 4-by-4 matrix using RAND.

Now start a new session of MATLAB and generate a 4-by-4 matrix using RAND.
Compare the two matrices; they will likely not be the same, as the
pseudorandom number generator in the two sessions are not in the same state.
One of the matrices may be singular and the other nonsingular.

Read at least the first page of the chapter in Cleve's textbook that deals
with random number generator:

http://www.mathworks.com/moler/random.pdf

--
Steve Lord
slord@xxxxxxxxxxxxx


.



Relevant Pages

  • Re: Weird problem with fmincon on 2008b
    ... generated using randn. ... It may be that the state of the random number generator ... generating a random nonsingular matrix the way you use RAND* in your code. ... completely independent stream ... ...
    (comp.soft-sys.matlab)
  • Re: Matlabs random number generator is suspicious... what to do?
    ... Are they ways that I can make Matlab's random number generator better? ... The cause of this as of yet unknown problem has to ... the default generator in MATLAB. ... different scaling method might make all the difference. ...
    (comp.soft-sys.matlab)
  • Re: rand function question
    ... format long; rand ... Setting the generator to the same fixed state ... states leads to unique computations, however, it does not improve any ... Since MATLAB resets the state at start-up, ...
    (comp.soft-sys.matlab)
  • Re: randn & state
    ... sets have the same analysis code. ... I thought that Matlab uses random seeds by default. ... Setting the generator to the same fixed state ... states leads to unique computations, however, it does not improve any ...
    (comp.soft-sys.matlab)
  • Re: strong nonrandom pattern in rand
    ... points you to a mex file on MATLAB Central, ... The current versions Matlab contain an internal Mersenne Twister and ... explicit request for 'twister' or 'seed', ... borrow generator is used. ...
    (comp.soft-sys.matlab)