Tag Info

Hot answers tagged

7

Plot the objective function f[x,y] for 100 values of x: plt = Plot[ y InverseSurvivalFunction[dist, # + y] & /@ Range[0, 1., .01], {y, 0, 1}, Evaluated -> True, ImageSize -> 400, PlotRange -> {{0, 1}, {-.1, 1}}]; Post-proces the previous plot to mark points corresponding to the global maximum on each of the 100 curves: plt /. ...


5

Directly from the documentation of LinearModelFit X = {5, 10, 15, 20, 25, 30, 35} Y = {9.4, 18.3, 26.2, 36.3, 37.4, 47.3, 56.3} fit = LinearModelFit[data = Transpose@{X, Y}, {1, x}, x] (* FittedModel[1.49929 x+3.04286] *) Show[ListPlot[data], Plot[fit[x], {x, 0, 35}], Frame -> True] ListPlot[fit["FitResiduals"], Filling -> Axis] Note that ...


4

The fit given in this question, a + b t^2, is actually linear in a and b, so the regression line can be found with a linear fit, i.e. x = {1, 2, 3, 4}; y = {0.891, 0.885, 0.844, 0.836}; data1 = Transpose[{x, y}]; n1 = Normal@NonlinearModelFit[data1, a + b t^2, {a, b}, t]; n2 = Normal@LinearModelFit[data1, {1, t^2}, t]; n1 == n2 True The prediction ...


3

The problem is numerically unstable for some parameter ranges. We shall show a simple example. Your normalized distribution is given by p[q_, n_, \[Mu]_, \[Nu]_, s_] := Exp[4 n s q] q^(4 n \[Nu] - 1) (1 - q)^(4 n \[Mu] - 1)/(Gamma[4 n \[Mu]] Gamma[ 4 n \[Nu]] Hypergeometric1F1Regularized[4 n \[Nu], 4 n (\[Mu] + \[Nu]), 4 n s]) Check ...


3

First some analysis. The slowness is due to the time it takes to compute InverseSurvivalFunction[dist, u]. InverseSurvivalFunction is a general purpose function and perhaps not optimized for mixture of normal distributions. An improvement in speed can be obtained by using some calculus to reduce the number of times we have to compute ...


2

f[x_] = 4/5 * ((1/(4 (1 - x)^3) + 1/(2 (1 - x)^2)) UnitStep[-x] + (1/(4 (1 + x)^3) + 1/(2 (1 + x)^2)) UnitStep[x])//FullSimplify; f[1] = f[1.] = Limit[f[x], x -> 1] 1/8 f[-1] = f[-1.] = Limit[f[x], x -> -1] 1/8 dist = ProbabilityDistribution[f[x], {x, -Infinity, Infinity}]; Plot[f[x], {x, -10, 10}, PlotRange -> {0, ...


2

Not sure what is going on with the different results of Integrate and NIntegrate. This does not mean that the analytic form of $C$ is erroneous. Note that plotting the likelihood function (using the expression of $C$ provided by Integrate and the parameter values you used) over a resticted range of $s$ (instead of $[0,1]$) clearly shows that the ...


2

In general, it can be a useful first step in figuring out what's going on in these situations to check if your distribution is valid, using the DistributionParameterQ: DistributionParameterQ@MultinomialDistribution[n, pj] (* MultinomialDistribution::vprobprm: The value {0.567834,0.0502306,0.0292996,0.0237149,0.0229541,0.0263614,0.040333,0.239272} at ...



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