|
On Jul 18, 12:15 pm, Adshak <adshaikh.hip...@googlemail.com> wrote:
> Dear All,
> I have three vectors vector1 and vector 2 and finalvector2, such
> that:
>
> % Generating vector 1 %%%%
>
> mu1 = 9.5;
> sd1 = 0.645;
>
> feed1 = normrnd(mu1,sd1,1,1000000);
>
> vector1 = cumsum(feed1);
>
> %cutoff
> cutoff = max(vector1);
>
> % Generating vector 2%%%%%
>
> mu2 = 19.7; %mu2 needs to be larger than mu1. It cannot be
> same or close to the value of mu1
> sd2 = 0.645;
>
> feed2 = normrnd(mu2,sd2,1,1000000); %length of samples here is
> 1000000
>
> vector2 = cumsum(feed2);
>
> %final vector2
>
> finalvector2 = vector2 (vector2 < cutoff);
>
> end
>
> Now it is obvious, that the number of elements in finalvector2 is
> going to be lot less than vector1, after application of 'cutoff'.
> Ofcourse vector2 and vector 1 will be same in size. But what I want
> is, even after the cutoff application, I want the number of elements
> in finalvector2 to be more or less same as the number of elements in
> vector1.
>
> It is clear that I need to generate more elements in feed2 to achieve
> this. The query is 'by how much?'
>
> I would have guessed it would be a relation between the following
> 'cutoff' and 'No of elements I require' and 'Number of extra elements
> in feed to generate'
>
> I am doing something wrong in calculating this relationship and
> implementing it though....
>
> Can somebody please help me?
>
> Will be very grateful for your responses.
>
> Cheers,
> Adshak.
Dear ALL,
To further clarify my query, how can I generate 1 million samples of
feed2 = (mu2,sd2,1,1000000) with the condition max(vector2)<= max
(vector1) being satisfied.
I will be very grateful for any response that can help me.
sincere thanks in advance.
|