Help with 3D plot!
- From: "sun sy" <a@xxxxx>
- Date: Wed, 15 Aug 2007 19:56:17 +0000 (UTC)
^
Hello everyone!
I am new here, and would appreciate it very much if someone
can help me with the following issue. It is a very
interesting question/quiz for experts!
(please reply if you can provide even the slightest help!)
Thanks in advance,
Intro:
There is an artificial market with customers present in it.
Each customer has a price and waiting time value.
The price value of customers is generated using a Gamma
distribution (with preset numeric parameters) and the wait
values are generated from another Gamma distribution based
on the price value of each customer (i.e. one of the
parameters of the Gamma distribution for waiting times is
determined from customer price value).
Currently, given an arbitrary customer, I can calculate the
probability of all price values (from 0 to 100) using the
following M-file:
http://www.maths.lth.se/matstat/wafo/documentation/wafodoc/wafo/wstats/wggampdf.html
I can also calculate the probability of various customer
waiting times (from 0 to 50), if I know the price value of
that customer.
The Problem:
How to calculate the combined probability in MatLab? i.e.
How can we calculate what is the probability that a customer
c, has a waiting time of t1 and a price of p1?
Mathematically this is performed by multiplying the
probability that a customer has that price p1 by the
probability of the customer has a waiting time t1 given his
price is p1. But I do not know how to perform this operation
in MatLab, . . .
How to generate a 3D surface that its X-axis is the price,
its Y-axis is the waiting time, and the Z-axis is the
probability P().
In other words, the plot will show what is the probability
that customer c has price x, given it has a waiting time t.
Currently I am typing the following commands but I don’t get
the correct answer:
price_values = linspace(0,100,200);
time_values = linspace(0,50,200);
[PRICE,TIME]=meshgrid(price_values,time_values);
PROBABILITY = wggampdf (PRICE , 180 , 0.5 , 1) .*
wggampdf(TIME , 50 – 49.*PRICE , 1 , 1);
surf (PRICE , TIME , PROBABILITY , ‘EdgeColor’ , ‘none’ );
//It seems I am not using the correct operators or messing
up the dimensions??
NB. wggampdf (x , a , b , c ) : this function calculates
the probabilities of the values in matrix/array x from a
Gamma distribution with parameters a , b , and c.
http://www.maths.lth.se/matstat/wafo/documentation/wafodoc/wafo/wstats/wggampdf.html
.
- Prev by Date: Re: Best way to loop through unknown structure
- Next by Date: Help with 3D plot!
- Previous by thread: Save changes in handles structure
- Next by thread: Help with 3D plot!
- Index(es):
Relevant Pages
|
Loading