octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #43610] When I paste commands into the GUI com


From: anonymous
Subject: [Octave-bug-tracker] [bug #43610] When I paste commands into the GUI command window, Octave crashes completely and closes.
Date: Fri, 14 Nov 2014 13:59:48 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?43610>

                 Summary: When I paste commands into the GUI command window,
Octave crashes completely and closes.
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 14 Nov 2014 13:59:47 UTC
                Category: GUI
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Crash
                  Status: None
             Assigned to: None
         Originator Name: Joe Lee
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

This is a new problem, and doesn't happen every time.  It seems to be when
there is an error in the code I paste in:

I started by pasting in my little function (this didn't cause a crash): 

##S mapping
pkg load statistics

cd C:\Octave\Octave-3.8.2

load 'logistic.dat' #load up and pre-process a timeseries of data from the
logisic map to use as an example
#as it is chaotic.
data=flipud(logistic); #flip so that most recent at top, so not going
backwards.

#load 'tinkerbell.dat';
#data=flipud(tinkerbell);

#may need to then one minus the data if doing
#one step projection, or Tp minus if doing Tp steps.
#define m and d, theta and Tp (last 3 will be in function when done)
#d=2;
#Tp=1
#theta=2
#latest = 90
#earliest = 150

function [Yhat, closeness, weights, FAR] =
smap(data,earliest,latest,d,Tp,theta)

  x=data(latest:earliest,:);
  m=length(x); 
  #always rescale so Xt(0) = 1 //try not doing this
  #x = x.+(1-(x(m,:)));

#embed the time series:
  m = length(x);
  embedded= ones((m-d),1); #presize a matrix
  for i= 1:d;
  col= x([i:(m-(d-(i-1)))],1);
  embedded= [embedded, col];
  endfor
# this embedded has the original column of 1's, so chop them off:
# Actually, don't!  embedded= embedded(:,2:(d+1));

#embedded is now a matrix of d+1 columns and n-d-1 rows. 
  [n,dim]= size(embedded);# get size of the embedded time series matrix

#calculate distances between all points to get distbar
#can do this using pdist (statistics package) so need to load statistics if
not already done

  distbar =mean(pdist(embedded))  

#now need the distance between latest simplex and others:
#Assumes most recent at the top

  Xt = embedded(1,:);
#Need Yi:
  Yi = embedded(2:Tp:n-Tp,:);
#And Xi:
  Xi = embedded(Tp+2:Tp:n,:);
#FAR is vector of distances between latest known point and every other point
in library
#i.e Work out (||Xi-Xt||)
  far = Xi.-Xt;
  FAR = sqrt(sum(far.^2,2));

#calculate weights These are not normalized, so divide by sum weights
  weights = exp(-theta.*FAR./distbar);
  weights = weights./(sum(weights));
#calculate Yhat: yhat = A inverse B Xt
#where A = weight(||xi-Xt||)Xi and B = weight(||Xi-Xt||)Yi
#Xi is each point in the library, Xt is the predictee (point) and Yi is where
#Xi ended up at.
 

 #Yhat = mean(weights.*Yi);
 #Yhat = Yhat(1,1)
 
  B = weights.*Yi;
  A = weights.*Xi;
  Yhat = (A\B).*Xt;
  Yhat = sum(Yhat);
  Yhat = Yhat(1,2)

#now get the actual true value for the point from the data:
  tru = data(1:(latest-1),:);
#always rescale so Xt(0) = 1 //try not doing this
 # tru = tru.+(1-(x(m,:)));


#Difference from actual point Yt: 
  Yt = tru(length(tru));
  closeness = sqrt((Yhat.-Yt)^2);

endfunction

-Verbatim-

Then I tried to run the following code, which does have an error in it (it
doesn't make sense for i to start at 0), but this led to the whole thing
crashing.  (It doesn't crash if changed to be i=1:10).


clvector=1
for i=0:10
[yt,cl] = smap(data,150,90,i,1,4);
clvector = [clvector;cl]; 
endfor
clvector = clvector(2:(length(clvector)))
axis = 0:(length(clvector)-1)
plot (axis, clvector, 'x')




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 14 Nov 2014 13:59:47 UTC  Name: logistic.dat  Size: 215kB   By: None
Here's the data to use if you wish
<http://savannah.gnu.org/bugs/download.php?file_id=32433>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43610>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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