Tag Info

Hot answers tagged

8

As I said in the comments, under the null hypothesis (in this case that the data was drawn from a particular distribution family) the p-value should follow a uniform distribution on (0,1). Let me illustrate with a simple z-test. ztest[data_, mu0_, sigma_] := Block[{z, p, d}, z = (Mean[data] - mu0)/(sigma/Sqrt[Length[data]]); d = NormalDistribution[]; ...


4

The data does not look smoothly sigmoid. In particularly, there is an abrupt termination of the rise and the maximum slope appears to occur at end-point. Fitting the rising curve as an exponential: data = Transpose[{Temp1, Res1}]; cut = data[[200 ;; 292]] lmf[u_] := Exp[Normal@LinearModelFit[{#1, Log@#2} & @@@ cut, x, x]] /. x -> u slope[u_] := ...


4

UPDATE A more accurate explanation than the culprit being "low variability" is that because all of the dependent variable values begin with "-0.907" or "-0.908" essentially "eats up"/"wastes" the first 3 significant digits. Simply subtracting the minimimum value of the dependent variable works even better than standardizing by the mean and standard ...


4

The problem is due to the first two data points. Show[ListPlot[data], Plot[nlm[x], {x, 0, 3}], PlotRange -> All]


3

nlm = NonlinearModelFit[ data, (a - b x - (c - (d x - e)^2)/(f - (g x - k)^3)), {a, b, c, d, e, f, g, k}, x, Method -> NMinimize] Show[Plot[nlm[x], {x, 0, 6}], ListPlot[data, PlotStyle -> {Darker@Green, PointSize[0.03]}]]


3

Sometimes you need to be careful with the semantics. I0 and tS are parameters and not variables for the ODEs: pe = ParametricNDSolve[{ Eu'[t] == -k1 Eu[t] S[t] + k2 ES[t] + k3 ES[t] - k4 Eu[t] Iu[t] + k5 EI[t], ES'[t] == k1 Eu[t] S[t] - (k2 + k3) ES[t], EI'[t] == -(k5 + k6) EI[t] + k4 Eu[t] Iu[t], E2'[t] == k6 EI[t], ...


3

Seems reasonable to fit h. h = Fit[Reverse /@ data, {1, t, t^2}, t]; Show[Plot[h*Exp[-h*t], {t, 0, 7}], ListLinePlot[Transpose[{data[[All, 2]], expoF}]]]


2

You should (always?) evaluate your model on your data, or at the least, do it when you get errors: model = (100.0*((Subscript[k, 1]*n)/(Subscript[k, 2] - Subscript[k, 1])*((E^-(Subscript[k, 1]*t)) - (E^-(Subscript[k, 2]*t))))); dtptsC = {{1.0, 1.0}, {5.0, 80.0}, {10.0, 80.0}, {20.0, 63.0}, {30.0, 50.0}, {40.0, 38.0}, {60.0, 24.0}, {75.0, ...


2

Actually since version 9 there is ParametericNDSolve and NDSolveValue which both make the mentioned idiom even more attractive and doesn't even need the pattern matching you are struggling with: model = Module[{x, y, a, t}, ParametricNDSolveValue[ {a*(y'[x] t - y[x]) == 7, y[0] == 0}, y, {x, 0, 1}, {a, t} ] ] data = {#, model[0.5, 0.6][#] + ...


2

The function checks if the input is a number (NumberQ), otherwise it prints out an error. The function is only defined if the input is a number. Please check this alternate example: f[x_?OddQ] := "Here the function is defined for an odd number"; f[3] But the function it is not defined for an even number: f[2]


1

Change of variable: $s=k-j$. Manipulate is helpful for starting values: lp = ListPlot[dtptsC, PlotStyle -> Red, PlotMarkers -> {Automatic, 10}]; f[j_, s_, n_, t_] := 100 n/s ( Exp[-j t] - Exp[-(j + s) t]) Manipulate[ Show[Plot[f[j, s, n, t], {t, 1, 95}, PlotRange -> {0, 100}], lp], {j, 0.01, 0.3, Appearance -> "Labeled"}, {s, 0.0001, ...


1

Anton Antonov has implemented smoothing splines in his Quantile regression with B-splines package (direct link to the M-file). This post (duplicated in this thread) explains how can it be used. See also this post of mine for an example of use.



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