apply.fromstart {PerformanceAnalytics} | R Documentation |

## calculate a function over an expanding window always starting from the beginning of the series

### Description

A function to calculate a function over an expanding window from the start of the timeseries. This wrapper allows easy calculation of “from inception” statistics.

### Usage

apply.fromstart(R, FUN = "mean" , gap = 1, ...)

### Arguments

`R` |
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns |

`FUN` |
any function that can be evaluated using a single set of returns (e.g., rolling beta won't work, but `Return.annualized` will) |

`gap` |
the number of data points from the beginning of the series required to “train” the calculation |

`...` |
any other passthru parameters |

### Value

A timeseries in a zoo object of the calculation results

### Author(s)

Peter Carl

### See Also

`apply`

### Examples

data(managers)
apply.fromstart(managers[,1,drop=FALSE], FUN="mean", width=36)

[Package

*PerformanceAnalytics* version 0.9.9-5

Index]