Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #16081 > unrolled thread
| Started by | Tomas Garza <tgarza10@msn.com> |
|---|---|
| First post | 2013-10-19 07:48 +0000 |
| Last post | 2013-10-19 07:48 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Help with Manipulate Tomas Garza <tgarza10@msn.com> - 2013-10-19 07:48 +0000
| From | Tomas Garza <tgarza10@msn.com> |
|---|---|
| Date | 2013-10-19 07:48 +0000 |
| Subject | Re: Help with Manipulate |
| Message-ID | <l3tdfj$9tn$1@smc.vnet.net> |
First, remove the semicolon at the end of your code. This may be interfering with the displaying process.Second, bear in mind that the calculation takes a very long time if the values of your parameters get too large.Third, try to fix the PlotRange so that the plot doesn't jump all over the place as you move the controls.Lastly, I suggest a smoother way to compute the sum.
I tried the following code and it works fine:
Clear[flist];flist[par1_,par2_]:=RandomVariate[FRatioDistribution[2,2 par1],par2];Manipulate[sum=Fold[Plus,0,Table[flist[\[CurlyPhi],np],{nr}]];Histogram[sum,{Min[sum],Max[sum],1},"PDF",AspectRatio->1/3,PlotRange->{{Min[sum],Max[sum]},All},ImageSize->Large],{{\[CurlyPhi],5,"parameter"},1,50,Appearance->"Labeled"},{{np,1000,"number of data points"},1,10000,Appearance->"Labeled"},{{nr,20,"number of replications"},5,200,Appearance->"Labeled"}]
-Tomas
> From: emammendes@gmail.com
> Subject: Help with Manipulate
> To: mathgroup@smc.vnet.net
> Date: Fri, 18 Oct 2013 04:44:48 -0400
>
> Hello
>
> Although I have been using Mathematica for a while I still consider myself a rookie. Could someone explain what I am doing wrong with the following code, please?
>
> Manipulate[
> sum=RandomVariate[FRatioDistribution[2,2 \[CurlyPhi]],np];
> Do[sum=sum+RandomVariate[FRatioDistribution[2,2 > \[CurlyPhi]],np],{i,2,nr}];
> Histogram[sum,{Min[sum],Max[sum],1},"PDF",AspectRatio->1/3,PlotRange-> {{Min[sum],Max[sum]},All},ImageSize->Large],
> {{\[CurlyPhi],5,"parameter"},1,1000, Appearance->"Labeled"},
> {{np,1000,"number of data points"},1,1000000, Appearance->"Labeled"},{{nr,20,"number of replications"},5,10000, Appearance->"Labeled"}];
>
> Nothing shows up.
>
> Is there a faster way to implement the summation?
>
> Many many thanks
>
> Ed
>
>
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web