help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Was Location of probability PDF's and CDF's in gnuplot?.Now fitting


From: Paul Kienzle
Subject: Re: Was Location of probability PDF's and CDF's in gnuplot?.Now fitting curves to data in gnuplot?
Date: Mon, 29 Aug 2005 22:56:46 -0400

Henry,

leasqr is Levenberg-Marquardt NLLS.

- Paul

On Aug 29, 2005, at 10:11 PM, Henry F. Mollet wrote:

Thanks Paul and Dimitri for pointing out that all these PDF's and CDF's are
located in stat.inc in /sw/share/doc/gnuplot/demo.

The reason I'm using gnuplot rather than Octave is because I want to take advantage of fit in gnuplot. I believe the equivalent is not available in Octave. Fit in gnuplot allows the use of any user-defined function and it then uses a non-linear least-squares (NLLS) Marquarde-Levenbert algorithm. It produces parameter values with asymptotic standard errors (A.S.E) for all
the parameters.

I saw that octave-forge has expfit.m, leasqr.m, wpolyfit.m and the
corresponding demos but this does not appear to be as general as fit in
gnuplot?

My question here is how can I get the results from gnuplot (e.g. the fitting parameters into Octave for further processing. I am in Octave already rather
than gnuplot and am using graw commands to do the fitting. I want to
calculate the loss function, aka WSSR, aka SSR, in parameter space. I would know how to do this in Octave and then plot the results but have no clue how
to calculate what I need in gnuplot.
Henry

on 8/26/05 9:44 PM, Paul Kienzle at address@hidden wrote:


Avocado:~ paulkienzle$ locate prob.dem
/sw/share/doc/gnuplot/demo/prob.dem
/Users/paulkienzle/darwinports/dports/math/gnuplot/work/gnuplot -3.8h.0/
demo/prob.dem


The functions are defined in stat.inc in the same directory.  For
logistic it is:

# Logistic PDF
logistic(x)=lambda*exp(-lambda*(x-a))/(1.0+exp(-lambda*(x-a)))**2

Note that many statistical functions are defined in Octave, though in
the case of logistic_pdf, it does not include the lambda and a
parameters so you instead need to use:

y = lambda*logistic_pdf(lambda*(x-a))

to get the same function as gnuplot.

- Paul


On Aug 26, 2005, at 11:15 PM, Henry F. Mollet wrote:

Where are the probability PDF's and CDF's located in gnuplot so I can
set
the path that they can be found. When in my home directory and trying
for
example 'logistic(x)' the function cannot be found. After I load the
demo
'prob.dem' and do a few functions and then quit, plot logistic(x) will
work
using my own parameters for a and lambda.
Henry

gnuplot> show loadpath
        loadpath is "/usr/local/share/gnuplot/demo/"
"/usr/local/bin/gnuplot"
        system loadpath is
gnuplot> pwd
/Users/hfm
gnuplot> plot logistic(x)
         undefined function: logistic

gnuplot> load 'prob.dem'
                   Statistical Library Demo, version 2.3
          Copyright (c) 1991, 1992, Jos van de Woude, address@hidden
NOTE: contains 54 plots and consequently takes a lot of time to run
                      Press Ctrl-C to exit right now
                      Press Return to start demo ...
Hit return to continue^C
gnuplot> plot logistic(x)  # Now I get a graph
gnuplot>

I assume that default value would be used for the parameters if I
don't give
them but this is not the problem:
gnuplot> plot logistic (x)
         undefined function: logistic
gnuplot> a = 0.0
gnuplot> lambda = 2.0
gnuplot> mu = a
gnuplot> sigma = pi/(sqrt(3.0) + lambda)
gnuplot> plot logistic (x)
         undefined function: logistic






-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------






-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]