Re: Simplifying expressions, and Alpha
- To: mathgroup at smc.vnet.net
- Subject: [mg31352] Re: [mg31336] Simplifying expressions, and Alpha
- From: BobHanlon at aol.com
- Date: Tue, 30 Oct 2001 04:35:36 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2001/10/29 2:53:24 AM, msdawy at hotmail.com writes: >i have 2 problems... i'd be very grateful if anyone could help me.. >1. some expressions return very complex expressions (e.g. when u solve >a third degree equation), you get a very complex formula for the >result. i am looking for a way to output the result in a >human-readable format (like 2.3342218) not with many roots, and stuff >like this, how can i do it? > >2. how can i find the point on a chi squared distribution where the >CDF will be 0.995? > 1. Use N[Solve[]], Solve[]//N, or just NSolve[]. 2. The inverse of CDF is Quantile. Needs["Statistics`ContinuousDistributions`"]; Quantile[ChiSquareDistribution[n], x] 2*InverseGammaRegularized[n/2, 0, x] Quantile[ChiSquareDistribution[3], 0.995] 12.838156466598651 or using Solve Solve[CDF[ChiSquareDistribution[n], q] == x, q] {{q -> 2*InverseGammaRegularized[ n/2, 0, x]}} Solve[CDF[ChiSquareDistribution[3], q] == 0.995, q] {{q -> 12.838156466598651}} Plot[Evaluate[Table[ CDF[ChiSquareDistribution[n], x], {n, 1, 5, 2}]], {x, 0, 20}, PlotStyle -> Table[Hue[k/3], {k, 0, 2}], AspectRatio -> 1]; Plot[Evaluate[Table[ Quantile[ChiSquareDistribution[n], x], {n, 1, 5, 2}]], {x, 0, 1}, PlotStyle -> Table[Hue[k/3], {k, 0, 2}], PlotRange -> {0, 20.5}, AspectRatio -> 1]; Bob Hanlon Chantilly, VA USA