Hot answers tagged

4

Instead of fitting a function to the histogram (an estimate of the PDF), it is generally better to fit a distribution (not a function) to the raw, unbinned data. Use FindDistributionParameters or EstimatedDistribution. Example: data = RandomVariate[NormalDistribution[], 200]; EstimatedDistribution[data, NormalDistribution[mean, sigma]] You could do this,...


4

If the objective is to determine an envelope in the following form $$f(t)=A\pm \sqrt{D t}+B t$$ that contains a desired expected proportion ($1-\alpha$) of the values at each time step, then for the time series mentioned the coefficients are $A=1$, $B=0$, and $D=(\Phi^{-1}(1-\alpha/2))^2$ where $\Phi^{-1}$ is the inverse of the standard normal cumulative ...


4

Here is a wrapper for NonlinearModelFit that handles data with a known correlation matrix: covariantFit1::usage = "Wrapper for NonlinearModelFit that \ includes a covariance matrix. It does not handle the simple \ data format or handle constraints. It is computationally \ inefficient since it evaluates \"form\" n^2 times for every \ step, where n is the ...


3

Update Plot data for several regions provinces = {"lombardia", "sicilia"}; dataByProvince = covid19Italy /@ provinces; dataByProvince // Map[(KeyTake[#, {"date", "total infected"}] &), #, {2}] & // Values // Flatten[#, 1] & // DateListPlot[#, ScalingFunctions -> "Log", PlotLegends -> Capitalize@provinces, PlotMarkers -&...


3

This is an extended comment rather than an answer. I think that there are two issues: (1) the amount of data available is inadequate to estimate all 6 parameters, and (2) there is a potential for a severe amount of numeric instability. A straightforward approach to estimate the parameters is to use FindDistributionParameters: mle = ...


2

Suppose one had a bunch of time series with no specifics about the data generation mechanism but did know that each time series was generated independently from the others. (Yes, that's using a somewhat loose interpretation of independence.) Further one wants to estimate an envelope that would contain the central $100(1-\alpha)$% of the observations for ...


2

I don't think the model is flexible enough to fit the data. Playing with the parameters does not seem to produce a better fit. Below I use the parameter estimates for the initial values. Manipulate[gpp = Plot[model[μ, r, a, b, c, d, f][x], {x, 0, 5}, PlotStyle -> Red]; Show[ListPlot[data], gpp], {{μ, 149.836}, 140, 160, Appearance -> "Labeled"}, {...


1

While getting good fits with theoretical models is most desirable/satisfying, if good predictions is the overall objective, why not just fit the data with a simple model? Also the objective in your linked notebook seems to be the estimation of two parameters ($a$ and $b$) which are assumed to be common to 4 datasets. That assumption might not likely be ...


1

An alternative approach is to find the maximum likelihood estimators of the parameters given a known covariance structure. (In addition, this approach is amenable to estimating the parameters of the covariance matrix if just the structure of that matrix is known.) One of the advantages of the other answer is an easily obtained nicely formatted table of the ...


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