| To: | <s-news@wubios.wustl.edu> |
|---|---|
| Subject: | |
| From: | "Leeds, Mark" <mleeds@mlp.com> |
| Date: | Thu, 17 Jul 2003 22:52:20 -0400 |
| Thread-index: | AcNM15uDjYsOx/E2QeKj75Xqo5DGdA== |
|
i don't know if it's
because i am tired
but can anyone
figure out the code
for the following
two things
but loops are not
allowed.
i've been sitting
here for
three hours and i
have tried
many things for
both
and nothing has
worked.
A) I have a vector x
that's generally
increasing but not
always. so,
if it
was graphed over time,
it would generally
be increasing
but would have some
dips. i want to
compute the largest
peak to
to trough in x. in
other words,
what was the largest
down period
it went through. in
finance,
if x is cumulative
profit,
this is
called the largest drawdown.
B) I have a vector
y of say
size
250 that
contains postive and
negative numbers.
i want to calculate
the number
of negative values
in the sets
of
indices 1-50,2-51,3-524-53 ...
......, 201-250. so,
i want
201
numbers representing
the number of
negative values
in the moving window
of
length 50
?
thanks. i really
appreciate it.
mark
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: lme$apVar and PROC MIXED Std. Error of varcomp ests, Spencer Graves |
|---|---|
| Next by Date: | previous email, Leeds, Mark |
| Previous by Thread: | lme$apVar and PROC MIXED Std. Error of varcomp ests, Sven . Knudsen |
| Next by Thread: | previous email, Leeds, Mark |
| Indexes: | [Date] [Thread] [Top] [All Lists] |