lsqcurvefit where function changes for every y
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
I would like to do something like this
f = @(lambda, x) obj.tranchePrice(lambda, x, groupings);
[x, resnorm, residual] = lsqcurvefit(f, x0, xdata, obj.cdoTrancheData);
and the function
function price=tranchePrice(obj, lambda, ~)
... bla bla
% Then I need to know which tranche I am in.
% I.e the index of the y in the provided data is currently tested,
% because the tranches has different attachment and detachment points,
% which makes the following calulations hard.
for k=1:n
defaultLeg = cdoDefaultLeg(k, n, normAttach, normDetach)
protectionLeg = obj.cdoProtectionLeg(defaultLeg, normAttach, normDetach)
...
end
end
So there is one atachment and detachment point for every y provided in the lsqcurvefit function. But I dont know how I find the right points when in the tranchePrice function.
Réponses (0)
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!