ich habe folgende Funktionen, die ich so in Mathematica eingebe:
Code: Alles auswählen
P[t_]:= P(t) = P(t-1) + a * ED(t-1);
ED[t_] := ED(t) = DF(t) + DC(t);
DF[t_] := DF(t) = b*(F-P(t));
DC[t_] := DC(t) = c*(P(t)-F);
Code: Alles auswählen
a=1;
c=0.2;
b = 0.75;
F=100;
Code: Alles auswählen
ListLinePlot[{Table[P[t], {t, 0, 25}], Table[F, {t, 0, 25}]}, PlotStyle → {Black, Red},
Frame → True, FrameLabel → {"time", "price"}, AspectRatio → 0.4, PlotRange → All]
Ist es in R auch möglich die Funktionen zu plotten?
Ich habe folgendes versucht:
Code: Alles auswählen
f1 <- function(t) P(t-1) + a * ED(t-1)
f2 <- function(t) DF(t) + DC(t)
f3 <- function(t) b*(F-P(t))
f4 <- function(t) c*(P(t)-F)
a <- 1
b <- 0.75
c <- 0.2
F <- 100
P[0] = F + 1;
Code: Alles auswählen
plot