Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7182
| From | Anne Beyer <abeyer@stanford.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Problem with FindFit - No more memory available. |
| Date | 2011-12-13 10:52 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jc7app$p0g$1@smc.vnet.net> (permalink) |
Hi,
I'm trying to fit a model to data using FindFit. The model includes a
FindRoot and NIntegrate function. When I run the program, I get the
error message that "No more memory is available. Mathematica kernel
has shut down." Do you know what I'm doing wrong? Any help is highly
appreciated.
Thanks,
Anne
<< "MultivariateStatistics`"
H[t_, m_, s_] := CDF[LogNormalDistribution[m, s], t]/
PDF[LogNormalDistribution[m, s], t]
r[t_, c_, m_, s_] := (c + t)/(c*H[t, m, s] + t*(c + t))
t[c_?NumericQ, m_?NumericQ, s_?NumericQ, y_?NumericQ] := x /.
FindRoot[r[x, c, m, s] == y, {x, 0.2}]
U[t_?NumericQ, m_?NumericQ, s_?NumericQ, c_?NumericQ] :=
NIntegrate[0.5*(c/(c*H[x, m, s] + x*(c + x)))^2, {x, t, Infinity}]
w[c_?NumericQ, m_?NumericQ, s_?NumericQ, y_?NumericQ] := U[t[c, m, s,
y], m, s, c] + (t[c, m, s, y]*c)/(c + t[c, m, s, y])*1/2*y^2
"Data and estimation"
data = {{0.2, 0.02}, {0.4, 0.05}, {0.6, 0.1}, {0.8, 0.15}, {0.3,
0.03}}
model = w[c, m, s, y]
estimatedw = FindFit[data, {model, c > 0, s > 0}, {{c, 1}, {m, 1},
{s, 1}}, y]
Show[ListPlot[data], Plot[estimatedw[r], {r, 0, 0.8}], Frame -> True]
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
Problem with FindFit - No more memory available. Anne Beyer <abeyer@stanford.edu> - 2011-12-13 10:52 +0000 Re: Problem with FindFit - No more memory available. Ray Koopman <koopman@sfu.ca> - 2011-12-14 11:01 +0000
csiph-web