help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parse error?


From: Taza
Subject: Re: Parse error?
Date: Fri, 9 Dec 2011 01:04:54 -0800 (PST)

http://octave.1599824.n4.nabble.com/file/n4175847/Asset_Paths_Simulation_errors.jpg
 
HI

Am trying to use octave to simulate an asset paths, however when i wrote my
code and saved it in the script as an m-file, on running it at the octave
prompt, it indicates parse error line 18 of file /home/user/AssetPaths.m,
and more other parse & syntax errors as shown in the inserted image , to
make it even more problem, when i try to access the editor via command
prompt (edit AssetPaths.m) to start trying to correct errors, its not
possible since it still indicates the parse error and syntax error issues.
how can i go about to solve this problem to run my code successfully.

this is the script.

% Script to price an Asian put option using a Monte-Carlo approach.

S0 =50;       % Price of underlying today
X = 55;       % Strike at expiry
mu = 0.04;    % expected return
sig = 0.1;    % expected vol.
r = 0.03;     % Risk free rate
dt = 1/365;   % time steps
etime = 50;   % days to expiry
T = dt*etime; % years to expiry

nruns = 1000; % Number of simulated paths

% Generate potential future asset paths
S = AssetPaths(S0,mu,sig,dt,etime,nruns);

% Plot the asset paths
time = etime:-1:0;
plot(time,S,'Linewidth',2);
set(gca,'XDir','Reverse','FontWeight','bold','Fontsize',24);
xlabel('Time to Expiry','FontWeight','bold','Fontsize',24);
ylabel('Asset Price','FontWeight','bold','Fontsize',24);
title('Simulated Asset Paths','FontWeight','bold','Fontsize',24);
grid on
set(gcf,'Color','w');


--
View this message in context: 
http://octave.1599824.n4.nabble.com/Parse-error-tp2322504p4175847.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]