Message Boards Message Boards

0
|
7288 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Evaluate multiple lines of code on Wolfram Cloud?

Posted 5 years ago

Hi,

I am trying to execute codes of multiple lines on the wolfram portal/ cloud. But, I am unable to do so. Could you please help how to do so or suggest me some help document that can guide me.

A sample code is pasted below.

data = RandomVariate[NormalDistribution[0, 1], 1000];
EstimatedDistribution[data, NormalDistribution[mean, stdev], 
 ParameterEstimator -> {"MaximumLikelihood"}]

Thanks, Nitin

POSTED BY: Nitin Jain
6 Replies
Anonymous User
Anonymous User
Posted 5 years ago

i have no clue but try a wrapper that is meant to hold multiple statements

try data = Block[{},RandomVariate[NormalDistribution[0, 1], 1000]; EstimatedDistribution[data, NormalDistribution[mean, stdev], ParameterEstimator -> {"MaximumLikelihood"}]]

POSTED BY: Anonymous User
Posted 5 years ago

Thanks, John. It didn't work. I am just wondering if all the codes that work on the Wolfram Mathematica would also work on the cloud/online version.

data = RandomVariate[NormalDistribution[0, 1], 1000]; EstimatedDistribution[data, NormalDistribution[mean, stdev], ParameterEstimator -> {"MaximumLikelihood"}]

For example, this code works fine with Mathematica but the function "RandomVariate" itself doesn't seem to work on the cloud/ online version of Wolfram Alpha.

POSTED BY: Nitin Jain
Posted 5 years ago

Wolfram Alpha is not an implementation of the Wolfram Language. Some Wolfram Language expressions can be evaluated by Wolfram Alpha, but in general they will not. Mathematica does implement the Wolfram Language. If you do not have a Mathematica license you can try the free Wolfram Programming Lab which is essentially an online version of Mathematica.

POSTED BY: Rohit Namjoshi
Posted 5 years ago

I'm not certain that I can log into the same Wolfram cloud that you are using, but perhaps you can try these steps in the cloud and see if you get the same results that I do.

If I go here

[http://develop.open.wolframcloud.com/app/][1]

and click "Create a New Notebook" in the lower right corner

and wait for that to load and stabilize

and then paste

data = RandomVariate[NormalDistribution[0, 1], 1000];
EstimatedDistribution[data, NormalDistribution[mean, stdev],
ParameterEstimator -> {"MaximumLikelihood"}]

all in one long line and wait for that to appear and to stabilize and then click Evaluation on the menu bar and click Evaluate Cells in the drop down menu

then in a fraction of a second I get

NormalDistribution[0.023417332720967812, 0.9942659649019443]

That seems to be similar to what you are trying to do and it seems to eliminate some uncertainty about whether there are errors in the code you showed.

There are time and memory limitations on the use of that cloud page, but perhaps this can help you make a little progress.

POSTED BY: Bill Nelson
Anonymous User
Anonymous User
Posted 5 years ago

"Natively running the Wolfram Language, the Wolfram Cloud in effect makes every aspect of cloud operations programmable—introducing an unprecedented level of integration, flexibility, simplicity and power into a new generation of cloud technology."

I can't agree with the last post that "Cloud" is Alpha, alpha is an "ai project" and not the wolfram language (wolfram would not advertise it is, they are quite aware).

I cannot say you will be able to send more than 1 "small expr" at a time. But I think you can and there is a working example why I think that below.

There are at least 3 help sections to know of: kernel Settings, Cloud, Links (wsm), Parallel computer.

The Cloud help section clearly show you wrap your functions in, ie, "CloudPut[expr]". I don't see that you did that above. Reading mm's help on "expr". I can't say for sure if Block and Function wrappers are expr, but they are considered so for other mm's functions.

Aside from that, see Help on ref/LinkCreate. If you have more than 1 computer the kernels can talk to one another (also there are "parallel computing tools" which can use open kernels)

LinkWrite[link, EnterTextPacket["Print[a]; Print[b];"]]

(link can be any computer you have a WSM connection with, your own or the cloud, Cloud is likely a kind of wrapper on using the above)

Also your kernel Settings has a way to open and use remote kernels (without using cloud or link, connected kernels can be used "automatically" by the kernel, and if you run "parallel" commands mm can try to determine what of any expr or program can be run on alternate kernels

Your PC likely allows multiple kernels to be running.

You would use Cloud if you are Cloud sharing or Cloud computing in a project with others.

POSTED BY: Anonymous User
Posted 5 years ago

Thank you, everyone, for the replies. My objective was to see if every code that I am trying to execute on Wolfram Cloud/ Mathematica would run on WolframAlpha too. I am able to work multi-line codes on Wolfram Cloud but I don't think WolframAlpha can be used to execute the multi-line codes.

Thanks again for the prompt help.

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

Group Abstract Group Abstract