MrMarc

3163 Reputation

18 Badges

17 years, 133 days

MaplePrimes Activity


These are answers submitted by MrMarc

DJ Clayworth,

thanx for your input but I did not get it to work ! 

Your button code does not seem to have a reference to a plot or a procedure    Do(%Plot0(play)=true);

Let say we have a procedure called X() which is the animation.

If I want to start that animation with a button I tried the following button code    Do(%Plot0=X(),play=true);

which did not work ....any other suggestions ?

 

for the record I never managed to connect Maple 12 to Microsofts SQL Server 2005/2008 !  I did however manage to connect mysql.

I would recommend staying away from Microsoft SQL Server 2005/2008  (because it waisted two weeks of my time).

Simply download mysql (which works with Maple and any database files including microsoft access). The user should

download mysql + mysql tools (which for some reason does not come with the original installation of mysql which is very strange

since it is essential. it is very dificuly to connect without mysql tools which is the graphical interface ) and then you can import

access files into Maple directly through a Tcp/Ip connection on your computer . Another experience was that it was quite slow

( not as effecient as I would have imagined. I am not sure if it has to do with my slow internet connection or not ?!) so I stopped

using it and only use csv files now, which are directly imported in Maple much quicker :-)

 

 

The way that works best for me is to rearange the data with a pivot table in excel and then save the data as a csv file which

is then imported into maple as follows:.

 

L := ImportMatrix("C:\\.................csv", source = csv);
Nr, Nc := ArrayTools:-Size(L) ;

with(LinearAlgebra):
A:=Transpose(Matrix( [[seq(i, i = 1 .. 50)], [seq(i, i = 1 .. 50)]]) );
Nr, Nc := ArrayTools:-Size(A) ;
 

 

Doug could you please have a look at the attached worksheet and the corresponding data

 

First change the ImportMatrix link so it matches where you have the data on your computer.

 

Everything is working correctly accept that stupid maplet shutdown which means that I cannot put it in a

 

startup code region and have a maplet plot my stock selections.

 

Download 8342_SP-500-Monthly (2003-2009).csv
View file details

View 8342_plot stock - Maplet.mw on MapleNet or Download 8342_plot stock - Maplet.mw
View file details

 

ok, thank you Doug for your effort and expertise :-)

It is not really what I wanted but I am not sure how much I can demand since I was the one asked for help.

 

These are the characteristics I want the maplet to have.

 

1) It should remain open when I click  ok or alternativly relauch it self when I click ok.

2) It should return my selection ie favorite Canadian city or ploting a stock chart when the maplet is

still open again alternativly close down the maplet when I click ok, return my selection and automatically relaunch the maplet.

 

In the above maplet I have to close it down first and then it displays my choices.

 

What I want to do is to put  data loading code etc in the startup region and when I open the worksheet I

want a maplet to open asking me what stocks I want to plot . Such a maplet should remain open

(since I cannot run the code again since the code is in the start up region) and plot the selected stock when I click ok and

when I make a new selection in the list and click ok I want the stock chart to be updated with my new selection etc

Many demands but I think it would look nice.....

 

A similar problem with the following code. I want the maplet to update the variable and relaunch it self after you

select a value and click ok.

 

with(Maplets[Elements]):
L := ["Waterloo", "Ottawa", "Victoria", "Edmonton", "Regina", "Winnipeg", "Toronto", "Quebec City", "Fredericton", "Halifax", "Charlottetown", "St. John\'s", "Whitehorse", "Yellowknife", "Iqaluit"] :
maplet := Maplet([["Pick your favorite Canadian city:  ", DropDownBox[D1](L[1], L)], [Button("OK", Shutdown(['D1'])), Button("Cancel", Shutdown())]]):
Maplets[Display](maplet) ;

1) The first reason specification. We can simply use a simple Column in a Matrix to run the test. The test can easily be specified.

 

 ShapiroWilkWTest(Column(AA, 1), level = 0.05)

 

2) The second reason. Look at the output

 

Shapiro and Wilk's W-Test for Normality
---------------------------------------
Null Hypothesis:
Sample drawn from a population that follows a normal distribution
Alt. Hypothesis:
Sample drawn from population that does not follow a normal distribution

Sample size:                  100
Computed statistic:       0.941602
Computed pvalue:         0.000364451

Result: [Rejected]
There exists statistical evidence against the null hypothesis
 

 

The hypotheis are properly specified. The test statistics and p-values are given and even the interpretation of the statistical test is

given. This is what I called good function. I have not seen any other statistical software that actually provid you with the interpretation

of the statistical test. I like that  and I would like to see more of that.  Compare that output to the regression fit function where you

have to write your own code to get the most simple statistics such a t-values, p-values  etc etc

Thank you for your input Robert ! :-)

why dont you just click on the animation and in the animation tool box on top select FPS and the right click on the animation

and select export Graphics Interchange Format (GIF)...and then redo the procedure for different levels of FPS....

ok, the code to produce the below pictures is given by:

 

restart: with(Statistics) : with(plots) : randomize() :
n := 10 : nsim := 5 :
numb:=proc()  local  s, i, p, An, col ;

col := ["Green", "Blue", "Red", "Yellow", "Pink", "Brown", "Orange", "IndianRed", "Gold", "Chocolate", "DarkCyan", "DarkGoldenrod", "DeepPink", "DarkGreen", "DarkMagenta", "DarkSeaGreen", "OrangeRed", "Orchid", "PaleGoldenrod", "PaleGreen", "PaleTurquoise", "ForestGreen", "Peru", "SpringGreen", "Plum"][(rand(1 .. 25))()] :

s[1] := 100 : for i from 2 to n do  s[i] := s[i-1]+Sample(RandomVariable(Normal(0, 8)), 1)[1]  end do :      

for i to n do p[i] := [seq(s[a], a = 1 .. i)] end do :    

An := proc(time)      LineChart(p[round(time)],color=col, thickness=3) end proc : 
 
animate(An, [time], time = 1 .. n, frames = n) ;   end proc :   

display([seq(numb(),i=1..nsim)], insequence=true, labels = ["Time", "Stock Price"], font=[times,roman,14]) ;
 

 

You can set the number of periods and the number of simulations (n and nsim) in the begining

I am planning to also add code to plot simultanious unit root simulations......  :-)  looks quite good do far I must say !

 

 

If we change the insequence=true to insequence=false in the display comand we will get the below picture.

 

 

I managed to solve it after spending the whole day on it plus some programming luck !   Yhippee 

The solution looks really good ! :-)   I will post it shortly ........

ok thanx for your input ! Yes I have managed to do it with an button. :-)

but it would be nice be able to create an animation with all these different trajectories that can be exported as a GIF to powerpoint

maybe you could add a function into the animate command that forces the procudure to reiterate...?!

thanx Robert :-)  Yes that seams to do the trick. thank you :-)

Is there any other way it can be solved without a maplet ?!

I tried to use the code alec helped me with a couple of days ago (which is quite good:   it ads a random number to the list contineously)

restart; with(Statistics) :
r := Sample(RandomVariable(Normal(0, 1)), 1)[1] :
if `not`(assigned(LL)) then LL := [r] else LL := [op(LL), r] end if ;
 

but I have not managed to get it to work inside a procedure....maybe it is something that can be used ?!

again thanx for your help...:-)  Would not have managed it on my own...

saved me a  at least couple of days work..ha , ha . I am so determind so I would probably have waisted 2 weeks otherwise.....

First 14 15 16 17 18 19 20 Last Page 16 of 24