From: Raymond Hoogendoorn on
Hi all,

I have a math problem.

I have three vectors of the same length, representing a car's headway S, speed V and a vector (e.g. Z) which can take on the value of 0 or 1 (representing the fact if a driver will take a certain action or not).

What I want is to be able to calculate the (joint) probability that a value of 1 in Z occurs at the specific values of S and V.

I have no clue how to do this. I tried a lot of options. Please help!

Kind regards

Raymond
From: Ross on
"Raymond Hoogendoorn" <r.g.hoogendoorn(a)tudelft.nl> wrote in message <i0p3q3$st6$1(a)fred.mathworks.com>...
> Hi all,
>
> I have a math problem.
>
> I have three vectors of the same length, representing a car's headway S, speed V and a vector (e.g. Z) which can take on the value of 0 or 1 (representing the fact if a driver will take a certain action or not).
>
> What I want is to be able to calculate the (joint) probability that a value of 1 in Z occurs at the specific values of S and V.
>
> I have no clue how to do this. I tried a lot of options. Please help!
>
> Kind regards
>
> Raymond

If you tell us what you have tried and what you thought was wrong with that, we can give you some relevant help

We can't tell whether your problem is with understanding joint probability, or writing matlab code or something else

Ross
From: Raymond Hoogendoorn on
"Ross " <rosswoodskiwi(a)hotmail.com> wrote in message <i0p8lo$7et$1(a)fred.mathworks.com>...
> "Raymond Hoogendoorn" <r.g.hoogendoorn(a)tudelft.nl> wrote in message <i0p3q3$st6$1(a)fred.mathworks.com>...
> > Hi all,
> >
> > I have a math problem.
> >
> > I have three vectors of the same length, representing a car's headway S, speed V and a vector (e.g. Z) which can take on the value of 0 or 1 (representing the fact if a driver will take a certain action or not).
> >
> > What I want is to be able to calculate the (joint) probability that a value of 1 in Z occurs at the specific values of S and V.
> >
> > I have no clue how to do this. I tried a lot of options. Please help!
> >
> > Kind regards
> >
> > Raymond
>
> If you tell us what you have tried and what you thought was wrong with that, we can give you some relevant help
>
> We can't tell whether your problem is with understanding joint probability, or writing matlab code or something else
>
> Ross

Hi,

Determining the prob density functions separately for S and V was quit easy. The problem lies in combining them. I've tried a Markov chain approach but that didn't work.

My main problem is with programming it in Matlab. However, another problem is that I am a psychologist and not an engineer or expert in math.

Kind regards

Raymond
From: Steven Lord on

"Raymond Hoogendoorn" <r.g.hoogendoorn(a)tudelft.nl> wrote in message
news:i0pa0t$1t7$1(a)fred.mathworks.com...
> "Ross " <rosswoodskiwi(a)hotmail.com> wrote in message
> <i0p8lo$7et$1(a)fred.mathworks.com>...
>> "Raymond Hoogendoorn" <r.g.hoogendoorn(a)tudelft.nl> wrote in message
>> <i0p3q3$st6$1(a)fred.mathworks.com>...

*snip*

> Hi,
>
> Determining the prob density functions separately for S and V was quit
> easy. The problem lies in combining them. I've tried a Markov chain
> approach but that didn't work.
>
> My main problem is with programming it in Matlab. However, another problem
> is that I am a psychologist and not an engineer or expert in math.

Why don't you post a SMALL example of your S, V, and Z data and the code
you've written to solve the problem? That way the readers can try executing
your example and may be able to offer specific suggestions about your code.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Tom Lane on
> I have three vectors of the same length, representing a car's headway S,
> speed V and a vector (e.g. Z) which can take on the value of 0 or 1
> (representing the fact if a driver will take a certain action or not).
>
> What I want is to be able to calculate the (joint) probability that a
> value of 1 in Z occurs at the specific values of S and V.

Like the other responders, I am having trouble understanding what you want.
But:

Prob(Z,S,V) = Prob(Z) * Prob(S,V|Z)

So if you can estimate the marginal probability of Z, and you can estimate
the joint probability of S and V separately for each Z value, then you can
estimate the joint probability of all three.

But from your text description, even though you wrote "joint," it sounds
more like you want the conditional probability of Z given values of S and V.

I recommend looking up "Bayes theorem" and "conditional probability" in a
book or wikipedia or someplace, and see if that helps you formulate the
problem.

-- Tom