|
|
Normrnd of matrix
Is it possible to use Normrnd to generate random numbers from a preexisting matrix maintaining the sigma and mu values wanted.
ex. A=[1 2 3 4 5 ]
normrndA=[another 1X5 matrix with mean of 1 and SD of .5]=C
and I want to say B=normrnd[C with mean of 1 and SD of .5]
So, far I cannot get Normrnd to accept the mean and standard deviation for a specific matrix .
Any ideas or suggestions about whether this can be done will be appreciated. Thanks!
|
|
0
|
|
|
|
Reply
|
Shernita
|
3/4/2010 7:22:23 PM |
|
Shernita wrote:
> Is it possible to use Normrnd to generate random numbers from a
> preexisting matrix maintaining the sigma and mu values wanted.
>
> ex. A=[1 2 3 4 5 ] normrndA=[another 1X5 matrix with mean of 1 and SD of
> .5]=C
> and I want to say B=normrnd[C with mean of 1 and SD of .5]
I cannot figure out what you are asking about the preexisting matrix.
> So, far I cannot get Normrnd to accept the mean and standard deviation
> for a specific matrix .
Multiply the result of Normrnd by the desired standard deviation and add the
desired mean to that.
|
|
0
|
|
|
|
Reply
|
Walter
|
3/4/2010 7:32:07 PM
|
|
Walter Roberson <roberson@hushmail.com> wrote in message <hmp2eb$ppo$1@canopus.cc.umanitoba.ca>...
> Shernita wrote:
> > Is it possible to use Normrnd to generate random numbers from a
> > preexisting matrix maintaining the sigma and mu values wanted.
> >
> > ex. A=[1 2 3 4 5 ] normrndA=[another 1X5 matrix with mean of 1 and SD of
> > .5]=C
> > and I want to say B=normrnd[C with mean of 1 and SD of .5]
>
> I cannot figure out what you are asking about the preexisting matrix.
>
>
> > So, far I cannot get Normrnd to accept the mean and standard deviation
> > for a specific matrix .
>
> Multiply the result of Normrnd by the desired standard deviation and add the
> desired mean to that.
I want to use another already defined matrix to generate the random numbers of a new matrix and define it with the same mean and standard deviation.
|
|
0
|
|
|
|
Reply
|
Shernita
|
3/4/2010 7:48:22 PM
|
|
Shernita wrote:
> I want to use another already defined matrix to generate the random
> numbers of a new matrix and define it with the same mean and standard
> deviation.
Do you mean that you new matrix should contain samples randomly selected from
the existing matrix? If so, then unless you allow for a tolerance on the mean
and standard deviation, you have a "knapsack problem", which is NP-complete
(that is, there are known algorithms for it, but it takes time that is
exponential in the matrix size); and if the matrix to be generated is smaller
than the existing matrix, there might not be any solution at all (and if the
matrix to be generated is the same size as the existing matrix, the only
solutions might be those which are permutations of the existing matrix.)
|
|
0
|
|
|
|
Reply
|
Walter
|
3/4/2010 8:06:30 PM
|
|
On 3/4/2010 2:22 PM, Shernita wrote:
> Is it possible to use Normrnd to generate random numbers from a
> preexisting matrix maintaining the sigma and mu values wanted.
>
> ex. A=[1 2 3 4 5 ] normrndA=[another 1X5 matrix with mean of 1 and SD of
> .5]=C
> and I want to say B=normrnd[C with mean of 1 and SD of .5]
NORMRND will accept matrices for the mean and std dev arguments, but the purpose is to be able to generate an output matrix each of whose elements has a different mean and std dev. I don't think that's what you are trying to do.
If you want a matrix all of whose elements are drawn from the same distribution, then you need to pass in scalars for the mean and std dev. Your example code doesn't provide an A whose overall mean and std dev are 1 and .5, so it's rather difficult to give advice. But it may be that the scalars you are looking for are mean(A(:)) and std(A(:)).
|
|
0
|
|
|
|
Reply
|
Peter
|
3/4/2010 8:18:47 PM
|
|
|
4 Replies
444 Views
(page loaded in 0.006 seconds)
Similiar Articles: Jacobian matrix from lsqnonlin - comp.soft-sys.matlabHi guys, I'd like to get the jacobian matrix as estimated by lsqnonlin. ... Normrnd of matrix - comp.soft-sys.matlab Jacobian matrix from lsqnonlin - comp.soft-sys ... Welford algorithm for computing standard deviation - comp ...Normrnd of matrix - comp.soft-sys.matlab Welford algorithm for computing standard deviation - comp ... Jacobian matrix from lsqnonlin - comp.soft-sys.matlab | Computer ... comp.soft-sys.matlab - page 30I've just noticed that the Stat toolbox functions such as normrnd use the same random ... 10/22/2003 11:01:20 AM) Hi, I want to create a single precision matrix of zeros as ... Copy-on-write for real/imaginary parts of complex data? - comp ...... and imaginary parts: % (test data – 1000x1000 complex array) w = normrnd(0 ... outputs in matlab are as complex numbers,I want to know how can I write ... matrices ... normrnd - Normal random numbers - MathWorks - MATLAB and Simulink ...mu and sigma can be vectors, matrices, or multidimensional arrays that have the same ... 6,1./(1:6)) n1 = 2.1650 2.3134 3.0250 4.0879 4.8607 6.2827 n2 = normrnd(0,1 ... Description of normrnd - BioSig% Return an @var{r} by @var{c} or @code{size (@var{sz})} matrix of ... % -*- texinfo -*- % @deftypefn {Function File} {} normrnd (@var{m}, @var{s}, @var{r}, @var{c ... 7/29/2012 11:06:30 PM
|
|
|
|
|
|
|
|
|