# Creating a continuous probability distribution with parameters

I am trying to create a continuous probability distribution and then trying to draw a random sample of size 5. Need help in creating one.

myK[alpha0_,beta0_,c_,w] :=
(beta0/alpha0((c+w)/alpha0)Exp[-((c+w)/alpha0)^beta0])/Exp[-(c/alpha0)^beta0];
dist[alpha1_,beta1_c1_] = ProbabilityDistribution[myK[alpha1,beta1,c1,x],{x,0,∞}];
myK[1,1,2,w]
E^-w (2+w)
dist[1,1,2]
(* E^-w (2+w) *)

ProbabilityDistribution[myK[alpha1,beta1,c1,\[FormalX]],{\[FormalX],0,∞}][1,1,2]
RandomVariate[dist[1,1,2],5]
(* ProbabilityDistribution[myK[alpha1,beta1,c1,\[FormalX]],{\[FormalX],0,∞}][1,1,2] *)
(* RandomVariate[ProbabilityDistribution[myK[alpha1,beta1,c1,\[FormalX]],{\[FormalX],0,∞}][1,1,2],5] *)

• Your definition of myK uses w instead of w_. Your definition of dist has strange arguments. Finally, RandomVariate can only produce real numbers as output, so your parameters need to be numbers when it is called. – Carl Woll Sep 23 '17 at 20:40
• As pointed out by Carl Woll you have a number of syntax errors. Correcting and normalizing: myK[alpha0_, beta0_, c_, w_] := (beta0/ alpha0 ((c + w)/alpha0) Exp[-((c + w)/alpha0)^beta0])/ Exp[-(c/alpha0)^beta0]; dist[alpha1_, beta1_, c1_] := ProbabilityDistribution[ myK[alpha1, beta1, c1, x], {x, 0, \[Infinity]} , Method -> "Normalize"]; Plot[PDF[dist[1, 1, 2], x] // Evaluate, {x, 0, 10}] Plot[CDF[dist[1, 1, 2], x] // Evaluate, {x, 0, 10}, PlotRange -> {0, 1}] RandomVariate[dist[1, 1, 2], 5]  should work – ubpdqn Sep 24 '17 at 10:05
• Thanks ubpdqn . As you can see I am trying to define a conditional distribution of Weibull with condition (x>c). – nutan Sep 25 '17 at 16:31
• I hit the post button mistakenly. ... I am still not able to use my defined function as a distribution . And the RandomVariate is not working. Thanks for your patience. – nutan Sep 25 '17 at 16:33
• Thanks all, I also looked at the answers to the other questions posted and realized that i neded to to add Assumptions -> , varying the ranges of the parameters. – nutan Sep 28 '17 at 14:08