Help to solve n equations with two unknowns

Hi..
I have n equations of the put-call parity: C=P+PV*F-K*PV, where I have vectors for C, P and K, meaning that I would like to find the two unknowns PV and F by least square. Since I am not very confident with Matlab, I have not been able to find out, how I can code this. Hope that someone can help me.
Thanks

Answers (2)

It looks like you have two unknowns and one equation. How do you think there is a unique solution?
PV * F = C - P + K * PV
One solution could be:
PV = 1
F = C - P + K * PV
another solution could be
F = 1
PV = C - P + K * PV
Or, more generally:
PV = A % A is a constant.
F = (C - P + K * PV)/A
and
F = A % A is a constant
PV = (C - P + K * PV)/A
If there is to be a unique solution, it would seem that there must be another constraining equation.

2 Comments

Matt - I think you missed that C, P, K are all vectors.
No, I got that part. What I missed is where Kristine said that PV and F were _both_ scalar.

Sign in to comment.

The general equation is
C = P + PV*F - K*PV
given vectors C, P, K, and scalar unknowns PV and F. However, F appears in only one place. Suppose you rewrote this in the similar form
(C - P) = T - K*PV
Could you estimate the coefficients T and K? Yes, obviously,
params = polyfit(K,C-P,1);
PV = params(1);
T = params(2);
This is simply a traditional form linear regression problem. Then once you have the constant coefficient T and the parameter PV, recover F as
K = T/PV;

Products

Asked:

on 20 Mar 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!