Hello,
I am trying to fit a exponential power distribution
y = b/(2*pi*a^2*gamma(2/b))*exp(-(x/a)^b)
to a bunch of data for x and y I have in a table.
data
x y
1 2527
2 7559
3125 219
...
25912925 1
26012975
I know optim should do a minimisation, therefor I used as the
optimisation function
opt.power - function(val, x, y) {
a - val[1];
b - val[2];
sum(y - b/(2*pi*a^2*gamma(2/b))*exp(-(x/a)^b));
}
I call: (with xm and ym the data from the table)
a1 - c(0.2, 100)
opt - optim(a1, opt.power,
2 matches
Mail list logo