How to write a non-standard (four parameter) beta pdf as a symbolic expression?
Show older comments
Hi there, new to matlab, would appreciate any help!
I want to write an expression for a 4 parameter beta probability density function in matlab.
Here's what I wrote:
syms x a b q r assume(q>0 & r>0 & a<=u<=b) pd = (((x-a)^(q-1))*((b-x)^(r-1)))/(beta(q,r))*((b-a)^(q+r-1))
I thought I'd check to see if this made sense, by integrating the expression over a support and checking to see it returned 1. I took the following values: a=0.3 (lower bound) b= 1 (upper bound) q=r=2 (shape parameters)
int(pd,x,0.3,1)
unfortunately, I don't get 1 as an answer!
Answers (1)
Torsten
on 7 Dec 2017
pd = (x-a)^(q-1)*(b-x)^(r-1)/(beta(q,r)*(b-a)^(q+r-1))
Best wishes
Torsten.
Categories
Find more on Calculus in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!