Hot answers tagged

2

Adding links to comment by MarcoB Note the Attributes of RegionPlot Attributes[RegionPlot] (* {HoldAll, Protected, ReadProtected} *) Since RegionPlot and other plot functions have attribute HoldAll you need to use Evaluate a = {x^2 < y^3 + 1, y^2 < x^3 + 1}; RegionPlot[Evaluate[a], {x, -2, 5}, {y, -2, 5}]


2

A PDF is not a distribution. To convert a PDF to its associated distribution use ProbabilityDistribution Clear[λ, pb, Ps, μ] f[h_] := 1/Gamma[m]*(m/P)^m*h^(m - 1)*Exp[-(m*h)/P]; m = 1; P = 1; α = 4; δ = 2/α; int = Assuming[{A > 0, r > 0, λ > 0}, Integrate[(1 - Exp[-x*h*r^(-1/δ)])*pb*λ*π, {r, A, Infinity}, GenerateConditions -> False]] ...


2

This is an extended comment. f[h] as defined while clearly a probability density function is not of the type of function that Expectation expects. Consider the difference between the two functions f and g below: f[h_] := 1/Gamma[m]*(m/P)^m*h^(m - 1)*Exp[-(m*h)/P] (* Head *) Head[f] (* Symbol *) (* PDF *) f[h] (* (E^(-((h m)/P)) h^(-1 + m) ...


2

I think that value injection using With will work for you. Let's first define the sample g value you want: g = 1 + x^2 Now we define myfunc injecting the current definition of g inside its definition: Clear[myfunc] With[{g = g}, myfunc[f_] := Simplify[f/g]] Now let's change the value of g and check whether the definition of myfunc is affected: g = ...


1

Maybe something like this? g = 1 + x^2 Unprotect[saveg] saveg = g; myfunc[f_] := Simplify[(f/saveg)] Protect[saveg]



Only top voted, non community-wiki answers of a minimum length are eligible