MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Unexpected Characters Appearing in Results

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103294] Re: [mg103263] Unexpected Characters Appearing in Results
  • From: Gregory Lypny <gregory.lypny at videotron.ca>
  • Date: Sun, 13 Sep 2009 08:03:08 -0400 (EDT)
  • References: <200909112357.TAA25403@smc.vnet.net>

Thanks for checking, Bobby.  Yes, I executed exactly what you did  
below.  I was thinking that it might have to do with upgrading to Snow  
Leopard the other day.  I've got a message in to Wolfram tech  
support.  See what they have to say.

Regards,

	Gregory


On 2009-09-12, at 5:21 PM, DrMajorBob wrote:

> Here's what I get at my machine (64-bit Mac OS X, Mathematica 7.0):
>
> p = {{107, 138}, {119, 129}, {104, 101}, {107, 91}, {123, 94}};
> stdDev[x_] := Sqrt[Plus @@ (Plus[#, -Mean@x]^2 & /@ x)/Length@x]
>
> stdDev@p // N
>
> {7.53658, 19.1896}
>
> r = Differences@p/Most@p
>
> {{12/107, -(3/46)}, {-(15/119), -(28/129)}, {3/104, -(10/101)}, {16/
>  107, 3/91}}
>
> stdDev@r // N
>
> {0.105942, 0.0893377}
>
> I don't know why you're getting those "/.10" artifacts, but I don't  
> know if that's exactly what you did, either.
>
> Bobby
>
> On Sat, 12 Sep 2009 15:30:13 -0500, Gregory Lypny <gregory.lypny at videotron.ca 
> > wrote:
>
>> Hi Bobby,
>>
>> Yeh, you're right.  Kind of skimped on the details.  Sorry about  
>> that.
>>
>> Here's some data, five observations each on the prices of two  
>> stocks.  First element in each is stock 1 and the second element is  
>> stock 2.
>>
>> p= {{107, 138}, {119, 129}, {104, 101}, {107, 91}, {123, 94}}
>>
>> Here's a function for computing standard deviation that goes down  
>> each "column" as it were.  I think a version of this was suggested  
>> on MathGroup.
>>
>> stdDev[x_] := Sqrt[Plus @@ (Plus[#, -Mean@x]^2 & /@ x)/Length@x]
>>
>> The standard deviation of price is not a problem.
>>
>> {7.53658, 19.1896}
>>
>> Now I convert the prices to returns,
>>
>> (r = Differences@p/Most@p)
>>
>> {{12/107, -(3/46)}, {-(15/119), -(28/129)}, {3/104, -(10/101)},  
>> {16/107, 3/91}}
>>
>> leaving me with four observations each because of the  
>> differencing.  Taking the standard deviation of returns gives me
>>
>> {0.105942 \.10, 0.0893377 \.10}
>>
>> where the \.10 appears when I copy from Mathematica and paste into  
>> my mail software, but in Mathematica, the \.10 appears as an  
>> exclamation mark (!) with what appears to be a skinny space between  
>> it and the last digit reported for each result.
>>
>> The answers for returns are correct, and the exclamation mark still  
>> appears if I compute r as a numerical approximation rather than  
>> rationals.  Any thoughts?
>>
>> Regards,
>>
>> 	Gregory
>>
>>
>>
>> On 2009-09-12, at 1:47 AM, DrMajorBob wrote:
>>
>>> Details, Gregory. Details.
>>>
>>> Bobby
>>>
>>> On Fri, 11 Sep 2009 18:57:30 -0500, Gregory Lypny <gregory.lypny at videotron.ca 
>>> > wrote:
>>>
>>>> Hello everyone,
>>>>
>>>> I created a function to compute standard deviation, and in some
>>>> instances it returns a result with an exclamation mark (!) at the  
>>>> end,
>>>> as in
>>>>
>>>> 	0.143855 !
>>>>
>>>> When the result is copied as plain text and pasted elsewhere, it  
>>>> comes
>>>> out as
>>>>
>>>> 	0.143855 \.10
>>>>
>>>> Any reason why this is happening?  I recently upgraded my Mac to  
>>>> Snow
>>>> Leopard, and thought that might be the cause.
>>>>
>>>> Regards,
>>>>
>>>> 	Gregory
>>>>
>>>
>>>
>>> --DrMajorBob at yahoo.com
>>
>
>
> -- 
> DrMajorBob at yahoo.com



  • Prev by Date: Re: Unexpected Characters Appearing in Results
  • Next by Date: Re: Re: Re: Produce PDFs of Documentation
  • Previous by thread: Re: Unexpected Characters Appearing in Results
  • Next by thread: Re: Unexpected Characters Appearing in Results