search for: fitnorm

Displaying 2 results from an estimated 2 matches for "fitnorm".

Did you mean: fitnorm2
2020 Oct 17
2
??? is to nls() as abline() is to lm() ?
...And though I could hack this together with parsing fit$m$formula to get() the formula from the environment and then paste() the parameter list in there - that sounds really, really awkward. So I hope that there's an obvious way that I have overlooked. Here's sample code to illustrate. : fitNorm <- function(x, y) { # fit a normal distribution # Param: x domain # y densities # Value: the fit object F <- function(x, a, mu, sig) { # some parametrized function return( ( a / (sig*sqrt(2*pi)) ) * exp( (-1/2)*((x-mu)/sig)^2 ) ) } mu <- weighted.mean(x...
2020 Oct 17
0
??? is to nls() as abline() is to lm() ?
...together with parsing fit$m$formula to get() the formula from the environment and then paste() the parameter list in there - that sounds really, really awkward. > > So I hope that there's an obvious way that I have overlooked. > > Here's sample code to illustrate. : > > fitNorm <- function(x, y) { > # fit a normal distribution > # Param: x domain > # y densities > # Value: the fit object > F <- function(x, a, mu, sig) { # some parametrized function > return( ( a / (sig*sqrt(2*pi)) ) * exp( (-1/2)*((x-mu)/sig)^2...