Group Abstract Group Abstract

Message Boards Message Boards

Plotting two datasets in ListLinePlot gives errors?

Posted 3 years ago
POSTED BY: Jotwie
6 Replies

Mathematica is case sensitive - you have defined data, so anything using Data will definitely not work.

The result from how data is defined, it has the header TemporalData. Here is what you can do with this:

data["Properties"]
(*  Out:     {"Components","DateList","DatePath","DatePaths","Dates","FirstDates",\
"FirstTimes","FirstValues","LastDates","LastTimes","LastValues",\
"Part","Path","PathComponent","PathComponents","PathCount",\
"PathDates","PathFunction","PathFunctions","PathLength","PathLengths",\
"Paths","PathTimes","SliceData","SliceDistribution","TimeList",\
"Times","ValueDimensions","ValueList","Values"}   *)

So - for example for getting all values you just write:

data["Path"]

or for the value at time t=2:

data["SliceData", 2]

or you have an interpolating function for any time value inside the respective interval:

data["PathFunction"][2.0001]

Liebe Gruesse -- Henrik

POSTED BY: Henrik Schachner
Posted 3 years ago

Dear all,

Another question related to this topic: how is it possible to take a value of the path generated by data = RandomFunction[GeometricBrownianMotionProcess[.05, .25, 100], {0, 30, .01}]; Data[[2]] for example doesn‘t evaluate the path „data“ at time 2. How do I get the value of the process at time 2, i.e. the value of the path…?? Thank you,

Jotwie

POSTED BY: Jotwie
Posted 3 years ago

Danke. Das hat geklappt. Gruß nach Weilheim.

POSTED BY: Jotwie

I am quite angry because ...

No need for that, really! Your dataG just need to have step the same size and limits as data. Try e.g.:

data = RandomFunction[GeometricBrownianMotionProcess[.05, .25, 100], {0, 30, .01}];
dataG = Table[{x, 100/(1 + .0275)^(30 - x)}, {x, 0, 30, .01}];
ListLinePlot[{data, dataG}, Filling -> Axis, PlotRange -> All]
POSTED BY: Henrik Schachner
Posted 3 years ago

Hi there,

okay, sorry... this is my code:

data = RandomFunction[
  GeometricBrownianMotionProcess[.05, .25, 100], {0, 30, .01}]
dataG = 100/(1 + .0275)^(30 - Range[0, 30, .01]);
ListLinePlot[{data,dataG}, Filling -> Axis]

This provides an error. Any ideas?? Kind regards,

Jotwie

POSTED BY: Jotwie

Please include your code and output using one of the methods explained in the rules: http://wolfr.am/READ-1ST

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard