Tag Info

Hot answers tagged

5

With no changes in the first 6 lines of your first code block, pNV = OwnValues[parametersNV] /. RuleDelayed[x_, {y_}] :> HoldForm[y] /. {x_} :> x; framelbl := {{"θ(ζ)", Rotate["", 180 Degree]}, {"ζ", pNV}}; Plot[{d1}, {x, 0, 1}, PlotRange -> All, Axes -> False, Frame -> True, LabelStyle -> Black, FrameLabel -> framelbl, ...


5

ClearAll[tF] SeedRandom[10] n = 100; sample = Sort[Sin[Pi*RandomVariate[UniformDistribution[{0, 1}], n]]]; dist = EmpiricalDistribution[sample]; Use tF to define a custom ProbabilityDistribution: tF[y_] := 2/Pi*ArcSin[y] tfdist = ProbabilityDistribution[{"CDF", tF[x]}, {x, 0, 1}]; Row[Plot[Evaluate[#[tfdist, x]], {x, 0, 1}, Filling -> Axis, ...


5

Also fixing your code... n=30; TF[y_] = 2/Pi*ArcSin[y]; SeedRandom[10]; sample = Sort[Sin[Pi*RandomVariate[UniformDistribution[{0, 1}], n]]]; d = EmpiricalDistribution[sample]; EF = CDF[d, x]; To get the max. difference, I tried NMaximize and others, but didn't work. The one that worked for me was this: X = NArgMax[{Abs[EF - TF[x]], 0 < x < 1}, x] ...


2

You need to specify dx as a function of n, or replace dx definition directly in Manipulate. Functional Form of dx Clear[f, a, b, n, dx]; f[x_] := x^2; a = 0; b = 1; dx[n_] := (b - a)/n; Manipulate[ Show[Plot[f[x], {x, a, b}, PlotStyle -> Thick, AxesLabel -> {"x", "y"}], Graphics[{Table[{Opacity[0.05], EdgeForm[Gray], Rectangle[{a + i ...


2

Manipulate[a = Plot[x, {x, 0, 1}]; b = Plot[1 - z, {z, 0, 1}]; Show[If[cond1 == 1, a, Graphics[]], If[cond2 == 1, b, Graphics[]], Axes -> (cond1+cond2>=1), PlotRange -> {{0, 1}, {0, 1}}, AspectRatio -> 1/GoldenRatio], Grid[{{Control[{{cond1, 1, ""}, {0, 1}}], "a"}, {Control[{{cond2, 1, ""}, {0, 1}}], "b"}}]] Change Axes -> ...


2

You had a few oddities in your syntax. If you want to define TF as a function of $y$, you had best use SetDelayed (:=) instead of set. Take a look at the documentation of search this site on this point. The constant $\pi$ is Pi in Mathematica, note the uppercase letter. $n$ was not defined in your code. I am arbitrarily using $100$ data points in the ...



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