{"id":22423863,"url":"https://github.com/statcan/time-series-library","last_synced_at":"2025-08-01T07:32:34.550Z","repository":{"id":35020901,"uuid":"171530520","full_name":"StatCan/time-series-library","owner":"StatCan","description":"A TypeScript library for arithmetic on Statistics Canada time series vector data","archived":false,"fork":false,"pushed_at":"2023-01-04T21:54:45.000Z","size":611,"stargazers_count":7,"open_issues_count":6,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T17:41:16.829Z","etag":null,"topics":["time-series","typescript","visualization"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StatCan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-fr.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-19T18:50:55.000Z","updated_at":"2024-11-30T09:58:44.000Z","dependencies_parsed_at":"2023-01-15T12:10:21.373Z","dependency_job_id":null,"html_url":"https://github.com/StatCan/time-series-library","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/StatCan/time-series-library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Ftime-series-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Ftime-series-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Ftime-series-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Ftime-series-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StatCan","download_url":"https://codeload.github.com/StatCan/time-series-library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Ftime-series-library/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268185560,"owners_count":24209392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["time-series","typescript","visualization"],"created_at":"2024-12-05T18:13:17.672Z","updated_at":"2025-08-01T07:32:34.243Z","avatar_url":"https://github.com/StatCan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# time-series-library\n\nA TypeScript/JavaScript library for arithmetic on Statistics Canada time series \nvector data.\n\n\n# Installation\n\n```javascript\n// es6 module\nimport {Vector, VectorLib} from 'time-series-library';\n```\n\n# Usage\n\n**Vector:**  \n[get(index)](#Vector.get)  \n[refper(index), refperStr(index)](#Vector.refper)  \n[value(index)](#Vector.value)  \n[values()](#Vector.values)  \n[length](#Vector.length)  \n[push(datapoint)](#Vector.push)  \n[equals(other)](#Vector.equals)  \n[copy()](#Vector.copy)  \n[map(fn)](#Vector.map)  \n[find(predicate)](#Vector.find)  \n[filter(predicate)](#Vector.filter)  \n[range(startDate, endDate)](#Vector.range)  \n[latestN(n)](#Vector.latestN)  \n[interoperable(other)](#Vector.interoperable)  \n[intersection(others)](#Vector.intersection)  \n[sum()](#Vector.sum)  \n[average()](#Vector.average)  \n[reduce()](#Vector.reduce)  \n[operate(operation)](#Vector.operate)  \n[periodDeltaTransformation(transformation)](#Vector.periodDeltaTransformation)  \n[samePeriodPreviousYearTransformation(transformation)](#Vector.samePeriodPreviousYearTransformation)  \n[periodTransformation(transformation)](#Vector.periodTransformation)  \n[periodToPeriodPercentageChange(transformation)](#Vector.periodToPeriodPercentageChange)  \n[periodToPeriodDifference()](#Vector.periodToPeriodDifference)  \n[samePeriodPreviousYearPercentageChange()](#Vector.samePeriodPreviousYearPercentageChange)  \n[samePeriodPreviousYearDifference()](#Vector.samePeriodPreviousYearDifference)  \n[convertToFrequency(mode, converter)](#Vector.convertToFrequency)  \n[weekly(mode)](#Vector.weekly)  \n[monthly(mode)](#Vector.monthly)  \n[biMonthly(mode)](#Vector.biMonthly)  \n[quarterly(mode)](#Vector.quarterly)  \n[semiAnnual(mode)](#Vector.semiAnnual)  \n[annual(mode)](#Vector.annual)  \n[biAnnual(mode)](#Vector.biAnnual)  \n[triAnnnual(mode)](#Vector.triAnnual)  \n[quadrennial(mode)](#Vector.quadrennial)  \n[quinquennial(mode)](#Vector.quinquennial)  \n[round(decimals)](#Vector.round)  \n[roundBankers(decimals)](#Vector.roundBankers)  \n[json()](#Vector.json)  \n\n**VectorLib:**  \n[evaluate(expression, vectors)](#VectorLib.evaluate)  \n[generateDaily(values, startDate)](#VectorLib.generateDaily)  \n[generateWeekly(values, startDate)](#VectorLib.generateWeekly)  \n[generateMonthly(values, startDate)](#VectorLib.generateMonthly)  \n[generateBiMonthly(values, startDate)](#VectorLib.generateBiMonthly)  \n[generateQuarterly(values, startDate)](#VectorLib.generateQuarterly)  \n[generateSemiAnnual(values, startDate)](#VectorLib.generateSemiAnnual)  \n[generateAnnual(values, startDate)](#VectorLib.generateAnnual)  \n[generateBiAnnual(values, startDate)](#VectorLib.generateBiAnnual)  \n[generateTriAnnual(values, startDate)](#VectorLib.generateTriAnnual)  \n[generateQuadrennial(values, startDate)](#VectorLib.GenerateQuadrennial)  \n[generateQuinquennial(values, startDate)](#VectorLib.generateQuinquennial)  \n\n## Vector\n\nTo create a new vector:\n```javascript\nlet vector = new Vector();\n```\n\nVectors can also be initialized with data:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2},\n    {'refper': \"2018-03-01\", 'value': 3}\n]);\n```\n\nThe value of **refper** may be a **yyyy-mm-dd** formatted date string or a \n**Date** object.\n\nDatapoints may also hold addional information in the `metadata property`:\n```js\nlet vector = let vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1, 'metadata': {'key': 'value'}}\n]); \n```\n\n\u003ca name=\"Vector.get\"\u003e\u003c/a\u003e\n### get(index)\n\nReturns the datapoint of a vector at a specific index.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2},\n    {'refper': \"2018-03-01\", 'value': 3}\n]);\n\nlet result = vector.get(1);\n```\n\nResult:\n```javascript\n{'refper': \"2018-02-01\", 'value': 2}\n```\n\n\u003ca name=\"Vector.refper\"\u003e\u003c/a\u003e\n### refper(index), refperStr(index)\n\nGets the refeperence period of a datapoint at a specific index. \n\nThe function **refper** returns a data object and the function **refperStr** \nreturns a **yyyy-mm-dd** formatted date string. \n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2},\n    {'refper': \"2018-03-01\", 'value': 3}\n]);\n\nlet result = vector.refperStr(1);\n```\n\nResult:\n```javascript\n\"2018-02-01\"\n```\n\n\u003ca name=\"Vector.value\"\u003e\u003c/a\u003e\n### value(index)\n\nReturn the value of a datapoint at a specific index.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2},\n    {'refper': \"2018-03-01\", 'value': 3}\n]);\n\nlet result = vector.value(1);\n```\n\nResult:\n```javascript\n2\n```\n\n\u003ca name=\"Vector.values\"\u003e\u003c/a\u003e\n### values()\n\nReturn the list of values in a vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2},\n    {'refper': \"2018-03-01\", 'value': 3}\n]);\n\nlet result = vector.values();\n```\n\nResult:\n```javascript\n[1, 2, 3]\n```\n\n\u003ca name=\"Vector.length\"\u003e\u003c/a\u003e\n### length\n\nGets the length of a vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]);\n\nlet result = vector.length;\n```\n\nResult:\n```javascript\n2\n```\n\n\u003ca name=\"Vector.push\"\u003e\u003c/a\u003e\n### push(datapoint)\n\nAppends a datapoint to a vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1}\n]);\n\nvector.push({'refper': \"2018-02-01\", 'value': 2});\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]\n```\n\n\u003ca name=\"Vector.equals\"\u003e\u003c/a\u003e\n### equals(other)\n\nChecks if two vectors are equal.\n\nTwo vectors **a** and **b** are equal if the number of datapoints in **a** is \nequal to the number of datapoints in **b**, and for each datapoint with \nreference period **Ra** and value **Va** in **a**, there exists a datapoint in \n**b** whose reference period is equal to **Ra** and value is equal to **Va**. \n\nExample:\n```javascript\nlet v1 = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]);\nlet v2 = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]);\n\nlet result = v1.equals(v2);\n```\n\nResult:\n```javascript\ntrue\n```\n\n\u003ca name=\"Vector.copy\"\u003e\u003c/a\u003e\n### copy()\n\nReturns a new **Vector** object that is a copy of the calling **Vector**.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]);\n\nlet result = vector.copy();\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]\n```\n\n\u003ca name=\"Vector.map\"\u003e\u003c/a\u003e\n### map(fn)\n\nApplies a map function, **fn** on each point in a vector.   \n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 0},\n    {'refper': \"2018-01-02\", 'value': 1},\n    {'refper': \"2018-01-03\", 'value': 2},\n]);\n\nlet result = vector.map(p =\u003e p.value);\n```\n\nResult:\n```javascript\n[0, 1, 2]\n```\n\n\u003ca name=\"Vector.find\"\u003e\u003c/a\u003e\n### find(predicate)\n\nReturns the first datapoint in a vector matching a predicate function. Returns \n`undefined` if no match is found.   \n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 0},\n    {'refper': \"2018-01-02\", 'value': 1},\n    {'refper': \"2018-01-03\", 'value': 2},\n]);\n\nlet result = vector.find(p =\u003e p == 1);\n```\n\nResult:\n```javascript\n{'refper': \"2018-01-02\", 'value': 1}\n```\n\n\u003ca name=\"Vector.filter\"\u003e\u003c/a\u003e\n### filter(predicate)\n\nReturns a filtered vector based on a predicate function. The function \n**predicate** should be a function that operates on a datapoint and returns \na **boolean**.   \n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 0},\n    {'refper': \"2018-01-02\", 'value': 1},\n    {'refper': \"2018-01-03\", 'value': 2},\n]);\n\nlet result = vector.filter(p =\u003e p.value % 2 == 0);\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': 0},\n    {'refper': \"2018-01-03\", 'value': 2}\n]\n```\n\n\u003ca name=\"Vector.range\"\u003e\u003c/a\u003e\n### range(startDate, endDate)\n\nReturns the vector constrained within a specified range. The parameters \n**startDate** and **endDate** may be either date strings or date objects.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 0},\n    {'refper': \"2018-02-01\", 'value': 1},\n    {'refper': \"2018-03-01\", 'value': 2},\n    {'refper': \"2018-04-01\", 'value': 3}\n]);\n\nlet result = vlib.range(\"2018-02-01\", \"2018-03-01\");\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-02-01\", 'value': 1},\n    {'refper': \"2018-03-01\", 'value': 2}\n]\n```\n\n\u003ca name=\"Vector.range\"\u003e\u003c/a\u003e\n### latestN\n\nReturns a new vector containing only the last n reference periods of the \ncalling vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 0},\n    {'refper': \"2018-02-01\", 'value': 1},\n    {'refper': \"2018-03-01\", 'value': 2},\n    {'refper': \"2018-04-01\", 'value': 3}\n]);\n\nlet result = vlib.latestN(2);\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-03-01\", 'value': 2},\n    {'refper': \"2018-04-01\", 'value': 3}\n]\n```\n\n\u003ca name=\"Vector.interoperable\"\u003e\u003c/a\u003e\n### interoperable(other)\n\nChecks if two vectors are interoperable.\n\nTwo vectors **a** and **b** are interoperable if the number of datapoints in \n**a** is equal to the number of datapoints in **b**, and for each datapoint with \nreference period **Ra** in **a**, there exists a datapoint in **b** whose \nreference period is equal to **Ra**.\n\nExample:\n```javascript\nlet v1 = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]);\nlet v2 = new Vector([\n    {'refper': \"2018-01-01\", 'value': 3},\n    {'refper': \"2018-02-01\", 'value': 4}\n]);\n\nlet result = v1.interoperable(v2);\n```\n\nResult:\n```javascript\ntrue\n```\n\n\u003ca name=\"Vector.intersection\"\u003e\u003c/a\u003e\n### intersection(others)\n\nReturns the result of the intersection of the calling vector with other vectors. \n\nThe parameter **others** can either be a single vector or an array of vectors.\n\nThe result of vectors **a** intersected with **b** is defined as the vector \n**a'** and such that **a'** is composed only of datapoints with reference \nperiods defined in both **a** and **b**.\n\nExample:\n```javascript\nlet v1 = [\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2},\n    {'refper': \"2018-03-01\", 'value': 3},\n    {'refper': \"2018-04-01\", 'value': 4}\n];\nlet v2 = [\n    {'refper': \"2018-01-01\", 'value': 5},\n    {'refper': \"2018-03-01\", 'value': 6}\n];\n\nlet result = v1.intersection(v2);\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-03-01\", 'value': 3}\n]\n```\n\n\u003ca name=\"Vector.sum\"\u003e\u003c/a\u003e\n### sum()\n\nReturns the sum of all values in a vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", value: 1},\n    {'refper': \"2018-02-01\", value: 2},\n    {'refper': \"2018-03-01\", value: 3},\n]);\n\nlet result = vector.sum();\n```\n\nResult:\n```javascript\n6\n```\n\n\u003ca name=Vector.average\u003e\u003c/a\u003e\n### average()\n\nReturns the average of the values in a vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", value: 1},\n    {'refper': \"2018-02-01\", value: 2},\n    {'refper': \"2018-03-01\", value: 3},\n]);\n\nlet result = vector.average();\n```\n\nResult:\n```javascript\n2\n```\n\n\u003ca name=\"Vector.reduce\"\u003e\u003c/a\u003e\n### reduce(reducer)\n\nReduces the values in a vector based on the function **reducer**.\n\nThe function **reducer** has Number parameters **accumulator** and **current** \nand should return a Number.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 2},\n    {'refper': \"2018-02-01\", 'value': 3},\n    {'refper': \"2018-02-01\", 'value': 4}\n]);  \nlet result = vector.reduce(function(accumulator, current) {\n    return accumulator * current;\n});\n```\n\nResult:\n```\n24\n```\n\n\u003ca name=\"Vector.operate\"\u003e\u003c/a\u003e\n### operate(operation)\n\nPerforms an operation with another vector. The parameter **operation** is \na function with two **Number** inputs **a** and **b** that returns the result \nof an operation on both inputs. The input **a** should represent the value in \nthe calling vector and the input **b** should represent the value in the \nother vector.\n\nThe intersection of the two vectors are taken before performing the operation.\n\nExample:\n```js\nlet vectorA = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1},\n    {'refper': \"2018-02-01\", 'value': 2}\n]);\n\nlet vectorB = new Vector([\n    {'refper': \"2018-01-01\", 'value': 3},\n    {'refper': \"2018-02-01\", 'value': 4}\n]);\n\nlet result = vectorA.operate(vectorB, (a, b) =\u003e a + b);\n```\n\nResult:\n```js\n[\n    {'refper': \"2018-01-01\", 'value': 4},\n    {'refper': \"2018-02-01\", 'value': 6}  \n]\n```\n\n\u003ca name=\"Vector.periodDeltaTransformation\"\u003e\u003c/a\u003e\n### periodDeltaTransformation(transformation)\n\nReturns a new vector that is the result of a period to period transformation on \nthe calling vector. The parameter **transformation** should be a function \nwith two **Number** inputs representing the value of the current period and \nprevious period and should return the transformed value.\n\nThe first datapoint of the transformed vector will have a value of `null` since \nthere is no previous period to compare to.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", value: 1},\n    {'refper': \"2018-02-01\", value: 2},\n    {'refper': \"2018-03-01\", value: 3},\n]);\n\nlet result = vector.periodDeltaTransformation(function(curr, last)  {\n    return curr + last;\n});  \n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", value: null},\n    {'refper': \"2018-02-01\", value: 3},\n    {'refper': \"2018-03-01\", value: 5}\n]\n```\n\n\u003ca name=\"Vector.samePeriodPreviousYearTransformation\"\u003e\u003c/a\u003e\n### samePeriodPreviousYearTransformation(transformation)\n\nReturns a new vector that is the result of a same period previous year \ntransformation on the calling vector. The parameter **transformation** should \nbe a function with two **Number** inputs representing the value of the current \nperiod and previous period and should return the transformed value.\n\nThe first few datapoints of the transformed vector will have a value of `null` \nsince there is no previous year to compare to.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-03-31', 'value': 1},\n    {'refper': '2018-06-30', 'value': 2},\n    {'refper': '2018-09-30', 'value': 3},\n    {'refper': '2018-12-31', 'value': 4},\n    {'refper': '2019-03-31', 'value': 5},\n    {'refper': '2019-06-30', 'value': 6},\n    {'refper': '2019-09-30', 'value': 7},\n    {'refper': '2019-12-31', 'value': 8}\n]);\n\nlet result = vector.samePeriodPreviousYearTransformation(function(curr, last)  {\n    return curr - last;\n});  \n```\n\nResult:\n```javascript\n[\n    {'refper': '2018-03-31', 'value': null},\n    {'refper': '2018-06-30', 'value': null},\n    {'refper': '2018-09-30', 'value': null},\n    {'refper': '2018-12-31', 'value': null},\n    {'refper': '2019-03-31', 'value': 4},\n    {'refper': '2019-06-30', 'value': 4},\n    {'refper': '2019-09-30', 'value': 4},\n    {'refper': '2019-12-31', 'value': 4}\n]\n```\n\n\u003ca name=\"Vector.periodTransformation\"\u003e\u003c/a\u003e\n### periodTransformation(transformation)\n\nReturns a new vector that is the result of period transformation on \nthe calling vector. The parameter **transformation** should be a function \nwith a **Number** input representing the value of the current period and should \nreturn the transformed value.\n\nThe first datapoint of the transformed vector will have a value of `null` since \nthere is no previous period to compare to.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", value: 1},\n    {'refper': \"2018-02-01\", value: 2},\n    {'refper': \"2018-03-01\", value: 3}\n]);\n\nlet result = vector.periodTransformation(function(value)  {\n    return value * 2;\n});  \n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", value: 2},\n    {'refper': \"2018-02-01\", value: 4},\n    {'refper': \"2018-03-01\", value: 6}\n]\n```\n\n\u003ca name=\"Vector.periodToPeriodPercentageChange\"\u003e\u003c/a\u003e\n### periodToPeriodPercentageChange()\n\nReturns a period-to-period percentage change vector of the calling vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-01-01', 'value': 2},\n    {'refper': '2018-02-01', 'value': 6},\n    {'refper': '2018-03-01', 'value': 3}\n]);\n\nlet result = vector.periodToPeriodPercentageChange();\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': null},\n    {'refper': \"2018-02-01\", 'value': 200.0},\n    {'refper': \"2018-03-01\", 'value': -50.0}\n]\n```\n\n\u003ca name=\"Vector.periodToPeriodDifference\"\u003e\u003c/a\u003e\n### periodToPeriodDifference()\n\nReturns a period-to-period difference vector of the calling vector.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-01-01', 'value': 2},\n    {'refper': '2018-02-01', 'value': 6},\n    {'refper': '2018-03-01', 'value': 3}\n]);\n\nlet result = vector.periodToPeriodDifference();\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': null},\n    {'refper': \"2018-02-01\", 'value': 4},\n    {'refper': \"2018-03-01\", 'value': -3}\n]\n```\n\n\u003ca name=\"Vector.samePeriodPreviousYearPercentageChange\"\u003e\u003c/a\u003e\n### samePeriodPreviousYearPercentageChange()\n\nReturns the same period previous year percentage change vector of the calling \nvector.\n\n**Note:** Only works for vectors with frequencies of monthly of lower.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-06-01', 'value': 1},\n    {'refper': '2018-12-01', 'value': 2},\n    {'refper': '2019-06-01', 'value': 4},\n    {'refper': '2019-12-01', 'value': 8},\n    {'refper': '2020-06-01', 'value': 4},\n    {'refper': '2020-12-01', 'value': 4}\n]);\n\nlet result = vector.samePeriodPreviousYearPercentageChange();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2018-06-01', 'value': null},\n    {'refper': '2018-12-01', 'value': null},\n    {'refper': '2019-06-01', 'value': 300.0},\n    {'refper': '2019-12-01', 'value': 300.0},\n    {'refper': '2020-06-01', 'value': 0},\n    {'refper': '2020-12-01', 'value': -50.0}\n]\n```\n\n\u003ca name=\"Vector.samePeriodPreviousYearDifference\"\u003e\u003c/a\u003e\n### samePeriodPreviousYearDifference()\n\nReturns the same period previous year difference vector of the calling \nvector.\n\n**Note:** Only works for vectors with frequencies of monthly of lower.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-06-01', 'value': 0},\n    {'refper': '2018-12-01', 'value': 2},\n    {'refper': '2019-06-01', 'value': 0},\n    {'refper': '2019-12-01', 'value': 6},\n    {'refper': '2020-06-01', 'value': 0},\n    {'refper': '2020-12-01', 'value': 4}\n]);\n\nlet result = vector.samePeriodPreviousYearPercentageChange();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2018-06-01', 'value': null},\n    {'refper': '2018-12-01', 'value': null},\n    {'refper': '2019-06-01', 'value': 0},\n    {'refper': '2019-12-01', 'value': 4},\n    {'refper': '2020-06-01', 'value': 0},\n    {'refper': '2020-12-01', 'value': -2}\n]\n```\n\n\u003ca name=\"Vector.convertToFrequency\"\u003e\u003c/a\u003e\n### convertToFrequency(mode, converter)\n\nConverts the frequency of a vector to a user defined frequency.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each user defined frequency \n(Default).\n- `\"sum\"`: Takes the sum of each user defined frequency.\n- `\"average\"`: Takes the average of each user defined frequency.\n- `\"max\"`: Takes the maximum value of each user defined frequency.\n- `\"min\"`: Takes the minimum value of each user defined frequency.\n\nThe parameter **conveter** is a function with date parameters **curr** and \n**last** and a `Boolean` return value. This function should return true when \n**curr** and **last** are the defined frequency apart.\n\n**Note:** For the mode of operation, the vector is split into chunks where each \nchunk starts when the **converter** returns `true`. This operation starts from \nthe last reference period of the vector and proceeds in descending order by \ntime. Any chunk that does not have the same size as the latest chunk will be \nremoved.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-12-01', value: 1},\n    {'refper': '2018-12-12', value: 2},\n    {'refper': '2019-01-01', value: 3},\n    {'refper': '2019-01-12', value: 4},\n    {'refper': '2019-02-01', value: 5},\n    {'refper': '2019-02-12', value: 6}\n]);\n\nlet result = vector.convertToFrequency('last', function(curr, last) {\n    // Define frequency as monthly.\n    return curr.getMonth() === (last.getMonth() + 1) % 12;\n});\n```\n\nResult:\n```javascript\n[\n    {'refper': '2018-12-12', value: 2},\n    {'refper': '2019-01-12', value: 4},\n    {'refper': '2019-02-12', value: 6}\n]\n```\n\n\u003ca name=\"Vector.weekly\"\u003e\u003c/a\u003e\n### weekly(mode)\n\nConverts the frequency of a vector to weekly.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each week (Default).\n- `\"sum\"`: Takes the sum of each week.\n- `\"average\"`: Takes the average of each week.\n- `\"max\"`: Takes the maximum value of each week.\n- `\"min\"`: Takes the minimum value of each week.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2019-02-11', value: 1},\n    {'refper': '2018-02-12', value: 2},\n    {'refper': '2019-02-13', value: 3},\n    {'refper': '2019-02-14', value: 4},\n    {'refper': '2019-02-15', value: 5},\n    {'refper': '2019-02-18', value: 6},\n    {'refper': '2019-02-19', value: 7},\n    {'refper': '2019-02-20', value: 8},\n    {'refper': '2019-02-21', value: 9},\n    {'refper': '2019-02-22', value: 10},\n    {'refper': '2019-02-25', value: 11}\n]);\n\nlet result = vector.weekly();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2019-02-15', value: 5},\n    {'refper': '2019-02-22', value: 10}\n]\n```\n\n\u003ca name=\"Vector.monthly\"\u003e\u003c/a\u003e\n### monthly(mode)\n\nConverts the frequency of a vector to monthly.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each month (Default).\n- `\"sum\"`: Takes the sum of each month.\n- `\"average\"`: Takes the average of each month.\n- `\"max\"`: Takes the maximum value of each month.\n- `\"min\"`: Takes the minimum value of each month.\n\nExample:\n```javascript\n    let vector = new Vector([\n        {'refper': '2018-12-01', value: 1},\n        {'refper': '2018-12-12', value: 2},\n        {'refper': '2019-01-01', value: 3},\n        {'refper': '2019-01-12', value: 4},\n        {'refper': '2019-02-01', value: 5},\n        {'refper': '2019-02-12', value: 6}\n    ]);\n\n    let result = vector.monthly();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2018-12-12', value: 2},\n    {'refper': '2019-01-12', value: 4},\n    {'refper': '2019-02-12', value: 6}\n]\n```\n\n\u003ca name=\"Vector.biMonthly\"\u003e\u003c/a\u003e\n### biMonthly(mode)\n\nConverts the frequency of a vector to bi-monthly.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each two month period (Default).\n- `\"sum\"`: Takes the sum of each two month period.\n- `\"average\"`: Takes the average of each two month period.\n- `\"max\"`: Takes the maximum value of each two month period.\n- `\"min\"`: Takes the minimum value of each two month period.\n\nExample:\n```javascript\n    let vector = new Vector([\n        {'refper': '2018-01-01', value: 1},\n        {'refper': '2018-02-01', value: 2},\n        {'refper': '2019-03-01', value: 3},\n        {'refper': '2019-04-01', value: 4},\n        {'refper': '2019-05-01', value: 5},\n        {'refper': '2019-06-01', value: 6}\n    ]);\n\n    let result = vector.biMonthly();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2018-02-01', value: 2},\n    {'refper': '2019-04-01', value: 4},\n    {'refper': '2019-06-01', value: 6}\n]\n```\n\n\u003ca name=\"Vector.quarterly\"\u003e\u003c/a\u003e\n### quarterly(mode)\n\nConverts the frequency of a vector to quarterly.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each quarter (Default).\n- `\"sum\"`: Takes the sum of each quarter.\n- `\"average\"`: Takes the average of each quarter.\n- `\"max\"`: Takes the maximum value of each quarter.\n- `\"min\"`: Takes the minimum value of each quarter.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-01-01', value: 1},\n    {'refper': '2018-02-01', value: 2},\n    {'refper': '2019-03-01', value: 3},\n    {'refper': '2019-04-01', value: 4},\n    {'refper': '2019-05-01', value: 5},\n    {'refper': '2019-06-01', value: 6},\n    {'refper': '2019-07-01', value: 7},\n    {'refper': '2019-08-01', value: 8},\n    {'refper': '2019-09-01', value: 9},\n    {'refper': '2019-10-01', value: 10},\n    {'refper': '2019-11-01', value: 11},\n    {'refper': '2019-12-01', value: 12}\n]);\n\nlet result = vector.quarterly();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2019-03-01', value: 3},\n    {'refper': '2019-06-01', value: 6},\n    {'refper': '2019-09-01', value: 9},\n    {'refper': '2019-12-01', value: 12}\n]\n```\n\n\u003ca name=\"Vector.semiAnnual\"\u003e\u003c/a\u003e\n### semiAnnual(mode)\n\nConverts the frequency of a vector to semi-annual.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each semi-annum (Default).\n- `\"sum\"`: Takes the sum of each semi-annum.\n- `\"average\"`: Takes the average of each semi-annum.\n- `\"max\"`: Takes the maximum value of each semi-annum.\n- `\"min\"`: Takes the minimum value of each seni-annum.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': '2018-01-01', value: 1},\n    {'refper': '2018-02-01', value: 2},\n    {'refper': '2019-03-01', value: 3},\n    {'refper': '2019-04-01', value: 4},\n    {'refper': '2019-05-01', value: 5},\n    {'refper': '2019-06-01', value: 6},\n    {'refper': '2019-07-01', value: 7},\n    {'refper': '2019-08-01', value: 8},\n    {'refper': '2019-09-01', value: 9},\n    {'refper': '2019-10-01', value: 10},\n    {'refper': '2019-11-01', value: 11},\n    {'refper': '2019-12-01', value: 12}\n]);\n\nlet result = vector.semiAnnual();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2019-06-01', value: 6},\n    {'refper': '2019-12-01', value: 12}\n]\n```\n\n\u003ca name=\"Vector.annual\"\u003e\u003c/a\u003e\n### annual(mode)\n\nConverts the frequency of a vector to annual.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each year (Default).\n- `\"sum\"`: Takes the sum of each year.\n- `\"average\"`: Takes the average of each year.\n- `\"max\"`: Takes the maximum value of each year.\n- `\"min\"`: Takes the minimum value of each year.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-06-01\", 'value': 0},\n    {'refper': \"2018-12-01\", 'value': 1},\n    {'refper': \"2019-06-01\", 'value': 2},\n    {'refper': \"2019-12-01\", 'value': 3},\n    {'refper': \"2020-06-01\", 'value': 4},\n    {'refper': \"2020-12-01\", 'value': 5}\n]);\n\nlet result = vector.annual();\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-12-01\", 'value': 1},\n    {'refper': \"2019-12-01\", 'value': 3},\n    {'refper': \"2020-12-01\", 'value': 5}\n]\n```\n\n\u003ca name=\"Vector.biAnnual\"\u003e\u003c/a\u003e\n### biAnnual(mode)\n\nConverts the frequency of a vector to bi-annual.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each bi-annum (Default).\n- `\"sum\"`: Takes the sum of each bi-annum.\n- `\"average\"`: Takes the average of each bi-annum.\n- `\"max\"`: Takes the maximum value of each bi-annum.\n- `\"min\"`: Takes the minimum value of each bi-annum.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-12-01\", 'value': 0},\n    {'refper': \"2019-12-01\", 'value': 1},\n    {'refper': \"2020-12-01\", 'value': 2},\n    {'refper': \"2021-12-01\", 'value': 3},\n    {'refper': \"2022-12-01\", 'value': 4},\n    {'refper': \"2023-12-01\", 'value': 5}\n]);\n\nlet result = vector.biAnnual();\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-12-01\", 'value': 1},\n    {'refper': \"2021-12-01\", 'value': 3},\n    {'refper': \"2023-12-01\", 'value': 5}\n]\n```\n\n\u003ca name=\"Vector.triAnnual\"\u003e\u003c/a\u003e\n### triAnnual(mode)\n\nConverts the frequency of a vector to tri-annual.\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each tri-annum (Default).\n- `\"sum\"`: Takes the sum of each tri-annum.\n- `\"average\"`: Takes the average of each tri-annum.\n- `\"max\"`: Takes the maximum value of each tri-annum.\n- `\"min\"`: Takes the minimum value of each tri-annum.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-12-01\", 'value': 0},\n    {'refper': \"2019-12-01\", 'value': 1},\n    {'refper': \"2020-12-01\", 'value': 2},\n    {'refper': \"2021-12-01\", 'value': 3},\n    {'refper': \"2022-12-01\", 'value': 4},\n    {'refper': \"2023-12-01\", 'value': 5}\n]);\n\nlet result = vector.triAnnual();\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2020-12-01\", 'value': 2},\n    {'refper': \"2023-12-01\", 'value': 5}\n]\n```\n\n\u003ca name=\"Vector.quadrennial\"\u003e\u003c/a\u003e\n### quadrennial(mode)\n\nConverts the frequency of a vector to quadrennial (every 4 years).\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each quadrennium (Default).\n- `\"sum\"`: Takes the sum of each quadrennium.\n- `\"average\"`: Takes the average of each quadrennium.\n- `\"max\"`: Takes the maximum value of each quadrennium.\n- `\"min\"`: Takes the minimum value of each quadrennium.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-12-01\", 'value': 0},\n    {'refper': \"2019-12-01\", 'value': 1},\n    {'refper': \"2020-12-01\", 'value': 2},\n    {'refper': \"2021-12-01\", 'value': 3},\n    {'refper': \"2022-12-01\", 'value': 4},\n    {'refper': \"2023-12-01\", 'value': 5},\n    {'refper': \"2024-12-01\", 'value': 6},\n    {'refper': \"2025-12-01\", 'value': 7},\n    {'refper': \"2026-12-01\", 'value': 8},\n    {'refper': \"2027-12-01\", 'value': 9}\n]);\n\nlet result = vector.quadrennial();\n```\n\nResult:\n```javascript\n[\n    {'refper': '2022-01-31', 'value': 5},\n    {'refper': '2026-01-31', 'value': 9},\n    {'refper': '2030-01-31', 'value': 13}\n]\n```\n\n\u003ca name=\"Vector.quinquennial\"\u003e\u003c/a\u003e\n### quinquennial(mode)\n\nConverts the frequency of a vector to quinquennial (every 5 years).\n\nThe parameter **mode** is optional and can be one of the following strings:\n- `\"last\"`: Takes the last reference period of each quinquennium (Default).\n- `\"sum\"`: Takes the sum of each quinquennium.\n- `\"average\"`: Takes the average of each quinquennium.\n- `\"max\"`: Takes the maximum value of each quinquennium.\n- `\"min\"`: Takes the minimum value of each quinquennium.\n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-12-01\", 'value': 0},\n    {'refper': \"2019-12-01\", 'value': 1},\n    {'refper': \"2020-12-01\", 'value': 2},\n    {'refper': \"2021-12-01\", 'value': 3},\n    {'refper': \"2022-12-01\", 'value': 4},\n    {'refper': \"2023-12-01\", 'value': 5},\n    {'refper': \"2024-12-01\", 'value': 6},\n    {'refper': \"2025-12-01\", 'value': 7},\n    {'refper': \"2026-12-01\", 'value': 8},\n    {'refper': \"2027-12-01\", 'value': 9}\n]);\n\nlet result = vector.quinquennial();\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2022-12-01\", 'value': 4},\n    {'refper': \"2027-12-01\", 'value': 9}\n]\n```\n\n\u003ca name=\"Vector.round\"\u003e\u003c/a\u003e\n### round(decimals)\n\nReturns a new vector with all values in the calling vector roudned \nto a specified number of decimal places. \n\nIf **decimals** is not specified then the default value of `0` will be used.  \n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1.555},\n    {'refper': \"2018-02-01\", 'value': 1.554}\n]);\n\nlet result = vector.round(2);\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': 1.56},\n    {'refper': \"2018-02-01\", 'value': 1.55}\n]\n```\n\n\u003ca name=\"Vector.roundBankers\"\u003e\u003c/a\u003e\n### roundBankers(decimals)\n\nReturns a new vector with all values in the calling vector rounded to a \nspecified number of decimal places using the \n[Banker's rounding algorithm](http://wiki.c2.com/?BankersRounding). \n\nIf **decimals** is not specified then the default value of `0` will be used.  \n\nExample:\n```javascript\nlet vector = new Vector([\n    {'refper': \"2018-01-01\", 'value': 1.5},\n    {'refper': \"2018-02-01\", 'value': 2.5}\n]);\n\nlet result = vector.roundBankers(0);\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': 2},\n    {'refper': \"2018-02-01\", 'value': 2}\n]\n```\n\n\u003ca name=\"Vector.json\"\u003e\u003c/a\u003e\n### json()\n\nConverts a vector to a JSON formatted array.\n\nExample:\n```js\nlet vector = new Vector([\n    {'refper': '2018-01-01', 'value': 1},\n    {'refper': '2018-02-01', 'value': 2}\n]);\nlet result = vector.json();\n```\n\nResult:\n```json\n[\n    {\"refper\": \"2018-01-01\", \"value\": 1},\n    {\"refper\": \"2018-02-01\", \"value\": 2}\n]\n```\n\n## VectorLib\n\n\u003ca name=\"VectorLib.evaluate\"\u003e\u003c/a\u003e\n### evaluate(expression, vectors)\n\nPerforms arithmetic on a set of vectors. This function returns a **Vector** \nobject.\n\nAll input vectors will be intersected with each other before performing an \noperation using the **intersection** function.\n\nExample:\n```javascript\nlet vectors = {\n    '1': new Vector([\n        {'refper': \"2018-01-01\", 'value': 1},\n        {'refper': \"2018-02-01\", 'value': 2}\n    ]),\n    '2': new Vector([\n        {'refper': \"2018-01-01\", 'value': 3},\n        {'refper': \"2018-02-01\", 'value': 4}\n    ]),\n    '3': new Vector([\n        {'refper': \"2018-01-01\", 'value': 2},\n        {'refper': \"2018-02-01\", 'value': 2}\n    ])\n};\n\nlet result = vlib.evaluate(\"(v1 + 2*v2) * v3\", vectors);\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2018-01-01\", 'value': 16},\n    {'refper': \"2018-02-01\", 'value': 24}\n]\n```\n\n\u003ca name=\"VectorLib.generateDaily\"\u003e\u003c/a\u003e\n### generateDaily(values, startDate)\n\nGenerates a daily vector from a list of values starting from a specific \nreference period.\n\nExample:\n```javascript\nlet result = generateDaily([1, 2, 3], '2019-01-01');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-01\", 'value': 1},\n    {'refper': \"2019-01-02\", 'value': 2},\n    {'refper': \"2019-01-03\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateWeekly\"\u003e\u003c/a\u003e\n### generateWeekly(values, startDate)\n\nGenerates a weekly vector from a list of values starting from a specific \nreference period.\n\nExample:\n```javascript\nlet result = generateWeekly([1, 2, 3], '2019-01-01');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-01\", 'value': 1},\n    {'refper': \"2019-01-08\", 'value': 2},\n    {'refper': \"2019-01-15\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateMonthly\"\u003e\u003c/a\u003e\n### generateMonthly(values, startDate)\n\nGenerates a monthly vector from a list of values starting from a specific \nreference period. The last day of each month will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateMonthly([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2019-02-28\", 'value': 2},\n    {'refper': \"2019-03-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateBiMonthly\"\u003e\u003c/a\u003e\n### generateMonthly(values, startDate)\n\nGenerates a bi-monthly vector from a list of values starting from a specific \nreference period. The last day of each month will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateBiMonthly([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2019-03-31\", 'value': 2},\n    {'refper': \"2019-05-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateQuarterly\"\u003e\u003c/a\u003e\n### generateQuarterly(values, startDate)\n\nGenerates a quarterly vector from a list of values starting from a specific \nreference period. The last day of each month will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateQuarterly([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2019-04-30\", 'value': 2},\n    {'refper': \"2019-07-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateSemiAnnual\"\u003e\u003c/a\u003e\n### generateSemiAnnual(values, startDate)\n\nGenerates a semi annual vector from a list of values starting from a specific \nreference period. The last day of each month will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateSemiAnnual([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2019-07-31\", 'value': 2},\n    {'refper': \"2020-01-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateAnnual\"\u003e\u003c/a\u003e\n### generateAnnual(values, startDate)\n\nGenerates an annual vector from a list of values starting from a specific \nreference period. The last day of each year will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateAnnual([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2020-01-31\", 'value': 2},\n    {'refper': \"2021-01-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateBiAnnual\"\u003e\u003c/a\u003e\n### generateBiAnnual(values, startDate)\n\nGenerates a bi-annual vector from a list of values starting from a specific \nreference period. The last day of each year will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateBiAnnual([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2021-01-31\", 'value': 2},\n    {'refper': \"2023-01-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateTriAnnual\"\u003e\u003c/a\u003e\n### generateTriAnnual(values, startDate)\n\nGenerates a tri-annual vector from a list of values starting from a specific \nreference period. The last day of each year will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateTriAnnual([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2020-01-31\", 'value': 1},\n    {'refper': \"2023-01-31\", 'value': 2},\n    {'refper': \"2026-01-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateQuadrennial\"\u003e\u003c/a\u003e\n### generateQuadrennial(values, startDate)\n\nGenerates a quadrennial vector from a list of values starting from a specific \nreference period. The last day of each year will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateQuadrennial([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2023-01-31\", 'value': 2},\n    {'refper': \"2027-01-31\", 'value': 3}\n]\n```\n\n\u003ca name=\"VectorLib.generateQuinquennial\"\u003e\u003c/a\u003e\n### generateQuinquennial(values, startDate)\n\nGenerates a quinquennial vector from a list of values starting from a specific \nreference period. The last day of each year will be used as the reference \nperiods.\n\nExample:\n```javascript\nlet result = generateQuinquennial([1, 2, 3], '2019-01-31');\n```\n\nResult:\n```javascript\n[\n    {'refper': \"2019-01-31\", 'value': 1},\n    {'refper': \"2024-01-31\", 'value': 2},\n    {'refper': \"2029-01-31\", 'value': 3}\n]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatcan%2Ftime-series-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatcan%2Ftime-series-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatcan%2Ftime-series-library/lists"}