「Gis and r 007」の版間の差分

提供: OSGeo.JP Wiki
移動: 案内検索
(瀬戸)
(Summary of a Point Pattern Dataset (点分布データセットの要約))
行15: 行15:
 
SDA4PPの公式サイト ( http://ggit.metu.edu.tr/~volkan/index.html ) の各機能の説明文を訳し、それぞれ具体例を示しつつ、自分たちの研究にどう応用するか示す。
 
SDA4PPの公式サイト ( http://ggit.metu.edu.tr/~volkan/index.html ) の各機能の説明文を訳し、それぞれ具体例を示しつつ、自分たちの研究にどう応用するか示す。
 
====瀬戸====
 
====瀬戸====
 +
SDA4PPの該当ページは以下のとおり。
 +
*[http://sites.google.com/site/vkepoglu/Home/intensity Uniform Intensity]
 +
*[http://sites.google.com/site/vkepoglu/Home/density-ppp Kernel Density]
 +
 
=====Summary of a Point Pattern Dataset (点分布データセットの要約)=====
 
=====Summary of a Point Pattern Dataset (点分布データセットの要約)=====
 
*Description (説明)
 
*Description (説明)

2011年1月1日 (土) 23:37時点における版

表紙へ戻る

※Wiki記法の書き方については http://ja.wikipedia.org/wiki/Help:%E6%97%A9%E8%A6%8B%E8%A1%A8 を参照。


第7回GIS+R勉強会

参加者

  • 清野(リアル)
  • 瀬戸(リアル)
  • 渡邉(リアル)

報告

SDA4PPの公式サイト ( http://ggit.metu.edu.tr/~volkan/index.html ) の各機能の説明文を訳し、それぞれ具体例を示しつつ、自分たちの研究にどう応用するか示す。

瀬戸

SDA4PPの該当ページは以下のとおり。

Summary of a Point Pattern Dataset (点分布データセットの要約)
  • Description (説明)

点分布データセットの有効な要約を表示する。

  • Usage (使用法)
## S3 method for class 'ppp':
summary(object, ..., checkdup=TRUE)
  • Arguments(引数)

object 点分布 ("ppp"クラスのオブジェクト). ... 無視される checkdup 二重の点の存在がないかをチェックするかどうかを示す論理値

  • Details(詳細)

点分布データセットの有効な要約を表示する。

これは、全体的な機能を要約するための方法である。

もしcheckdup=TRUEならば、そのパターンはduplicated.pppを用いて重複ポイントの有無をチェックされるだろう。パターンが多くの点を含んでいるなら手間がかかっている場合があるので、checkdup=FALSEを設定することによって、照合を無効にすることができる。。

清野

SDA4PPの該当ページは以下のとおり。

  • Simulation Envelope of CSR
  • Fit Poisson Model

翻訳中だが、間に合わず。

Simulation Envelope of CSRは量が多かったので、半ばまでの訳で止まっている。

Fit Poisson Modelはその場で翻訳だけはした。以下に貼る。

Poisson Point Process Model (ポワソン点過程モデル)
  • Description (説明)

Creates an instance of the Poisson point process model which can then be fitted to point pattern data.

ポイントパターンデータにフィットできるポワソンポイントプロセスモデルのインスタンスを作る。

  • Usage (使用法)
Poisson()
  • Details (詳細)

The function ppm, which fits point process models to point pattern data, requires an argument interaction of class "interact" describing the interpoint interaction structure of the model to be fitted. The appropriate description of the Poisson process is provided by the value of the function Poisson.

これは、ポイントパターンデータに適合するポイントプロセスモデルであるppm関数で、適合するモデルのインターポイント・インタラクション構造を記述するクラス"interact"のインタラクション引数を求める。ポワソンプロセスの適切な説明はポワソン関数の値として提供されている。

This works for all types of Poisson processes including multitype and nonstationary Poisson processes.

すべてのタイプのポワソンプロセスの作業は、マルチタイプで非定常のポワソンプロセスを含む。

  • Value (値)

An object of class "interact" describing the interpoint interaction structure of the Poisson point process (namely, there are no interactions).

クラス"interact"のオブジェクトはポワソンポイントプロセス(つまりインタラクションはない)のインターポイント・インタラクション構造として記述される。

Simulation Envelope of CSR (CSRのエンベロープシミュレーション)
  • Description(説明)

Computes simulation envelopes of a summary function.

summary()関数のエンベロープシミュレーションを計算する。

  • Usage(利用法)
envelope(Y, fun=Kest, nsim=99, nrank=1, ...,
simulate=NULL, verbose=TRUE, clipdata=TRUE,
start=NULL,control=list(nrep=1e5,expand=1.5),
transform=NULL,global=FALSE,ginterval=NULL, saveall=FALSE,
nsim2=nsim, internal=NULL)
  • Arguments(変数)
    • Y Either a point pattern (object of class "ppp") or a fitted point process model (object of class "ppm").

ポイントパターン("ppp"クラスのオブジェクト)かフィットしたポイントプロセスモデル("ppm"クラスのオブジェクト)を選ぶ変数。

    • fun Function that computes the desired summary statistic for a point pattern.

ポイントパターンのための期待されたsummary統計を計算するための関数。

    • nsim Number of simulated point patterns to be generated when computing the envelopes.

エンベロープを計算する時に生成されるシミュレートされたポイントパターンの数。

    • nrank Integer. Rank of the envelope value amongst the nsim simulated values. A rank of 1 means that the minimum and maximum simulated values will be used.

整数。nsimシミュレート値内のエンベロープ値のランク。ランク1は最小と最大のシミュレート値が用いられたことを意味する。

    • ... Extra arguments passed to fun.

funに渡される追加の変数。

    • simulate Optional. Specifies how to generate the simulated point patterns. If simulate is an expression in the R language, then this expression will be evaluated nsim times, to obtain nsim point patterns which are taken as the simulated patterns from which the envelopes are computed. If simulate is a list of point patterns, then the entries in this list will be treated as the simulated patterns from which the envelopes are computed.

オプション。シミュレートされたポイントパターンをどうやって生成するか指定する。もしシミュレートがR言語内での表現であるならば、計算されたエンベロープからシミュレートされたパターンとして得られたnsimポイントパターンを得るためにnsim回求められる。

    • verbose Logical flag indicating whether to print progress reports during the simulations.

シミュレーション中に進捗状況を表示するかどうかの論理フラグ。

    • clipdata Logical flag indicating whether the data point pattern should be clipped to the same window as the simulated patterns,

before the summary function for the data is computed. This should usually be TRUE to ensure that the data and simulations are properly comparable.

データポイントパターンを、データのsummary()関数を計算する前に、シミュレートされたパターンとして同じウィンドウにクリップするかどうかの論理フラグ。これはデータとシミュレーションが適切に比較できることを保証するために、通常はTRUEである。

    • start,control Optional. These specify the arguments start and control of rmh, giving complete control over the simulation algorithm.

オプション。これらはシミュレーションアルゴリズムの完全な制御を与えるため、rmhのstartとcontrolの変数を指定する。

    • transform Optional. A transformation to be applied to the function values, before the envelopes are computed. An expression object (see Details).

オプション。エンベロープが計算される前に、関数値に適用された変形。

    • global Logical flag indicating whether envelopes should be pointwise (global=FALSE) or simultaneous (global=TRUE).

エンベロープがポイントワイズ(global =FALSE)かサイマルテイニアス(global=TRUE)か指示する論理フラグ。

    • ginterval Optional. A vector of length 2 specifying the interval of r values for the simultaneous critical envelopes. Only relevant if global=TRUE.

オプション。サイマルテイニアスなクリティカルエンベロープのためのr値のインターバルを指定する長さ2のベクトル。global=TRUEの時だけ関連する。

    • saveall Logical flag indicating whether to save all the simulated curves.

全てのシミュレートされた曲線をセーブするかどうか支持する論理フラグ。

    • nsim2 Number of extra simulated point patterns to be generated if it is necessary to use simulation to estimate the theoretical mean of the summary function. Only relevant when global=TRUE and the simulations are not based on CSR.

summary()関数の理論的な意味を評価するためにシミュレーションを使う必要があると考えられた場合に生成された、追加のシミュレートされたポイントパターンの数。global=TRUEでシミュレーションがCSRに基づいていない時にだけ関連する。

    • internal Do not use this argument. It is used by the package's internal code.

この変数は使ってはいけない。パッケージ内のコードに使われている。

  • Details(詳細)

Simulation envelopes can be used to assess the goodness-of-fit of a point process model to point pattern data. See the References.

エンベロープシミュレーションは、ポイントプロセスモデルがポイントパターンデータによく適合する度合を評価するために用いられる。

This function first generates nsim random point patterns in one of the following ways.

この関数は、以下に挙げる方法のうちの一つの、nsimランダムポイントパターンを最初に生成する。

    • If Y is a point pattern (an object of class "ppp") and simulate=NULL, then this routine generates nsim simulations of Complete Spatial Randomness (i.e. nsim simulated point patterns each being a realisation of the uniform Poisson point process) with the same intensity as the pattern Y. (If Y is a multitype point pattern, then the simulated patterns are also given independent random marks; the probability distribution of the random marks is determined by the relative frequencies of marks in Y.)
    • もしYがポイントパターン(クラス”ppp”のオブジェクト)でかつシミュレートがNULLであれば、このルーチンは、同じ強度のパターンYと完全な空間ランダム性(例:nsimシミュレートされたポイントパターンはそれぞれ均等なポワソンポイントプロセスと理解される)のnsimシミュレーションを生成する(もしYがマルチタイプポイントパターンならば、シミュレートされたポイントパターンは独立したランダム点数も与えられる。ランダム点数の確率分布はY内の点数の相対度数によって定義される)。
    • If Y is a fitted point process model (an object of class "ppm") and simulate=NULL, then this routine generates nsim simulated realisations of that model.
    • もしYがフィットしたポイントプロセスモデル(クラス"ppm"のオブジェクト)で、シミュレートがNULLであれば、このルーチンはそのモデルのnsimシミュレートされた認識を生成する。
    • If simulate is supplied, then it determines how the simulated point patterns are generated. It may be either

もしシミュレートが与えられたならば、それはどのようにシミュレートされたポイントパターンが生成されたか定義される。

      • an expression in the R language, typically containing a call to a random generator. This expression will be evaluated nsim times to yield nsim point patterns. For example if simulate=expression(runifpoint(100)) then each simulated pattern consists of exactly 100 independent uniform random points.

それはR言語内での表現でもあり、一般的にはランダム生成の呼び出しを含む。この表現は、nsimポイントパターンが生成されるまでnsim回計算される。例えば、もしsimulate=expression(runifpoint(100))ならば、それぞれのシミュレートされたパターンは正確に100個の独立した均一のランダムポイントから成り立つ。

      • a list of point patterns. The entries in this list wil be taken as the simulated patterns.

ポイントパターンのリスト。このリストのエントリはシミュレートされたパターンから取られる。

The summary statistic fun is applied to each of these simulated patterns. Typically fun is one of the functions Kest, Gest, Fest, Jest, pcf, Kcross, Kdot, Gcross, Gdot, Jcross, Jdot, Kmulti, Gmulti, Jmulti or Kinhom. It may also be a character string containing the name of one of these functions.

summary統計funはこれらのシミュレートされたパターンそれぞれに適用される。一般的にfunはKest, Gest, Fest, Jest, pcf, Kcross, Kdot, Gcross, Gdot, Jcross, Jdot, Kmulti, Gmulti, Jmultiあるいは Kinhom関数の一つである。また、これらの関数名の一つを文字列に含む。

The statistic fun can also be a user-supplied function; if so, then it must have arguments X and r like those in the functions listed above, and it must return an object of class "fv".

統計funはユーザー定義の関数になりえる。もしそうならば、それは上記に列挙した関数同様、変数Xとrを必ず持つ。そしてそれはクラス"fv"のオブジェクトを必ず返す。

Upper and lower critical envelopes are computed in one of the following ways:

上記と下記のクリティカルエンベロープは以下のような方法により計算される。


pointwise(ポイントワイズ):


by default, envelopes are calculated pointwise (i.e. for each value of the distance argument r), by sorting the nsim simulated values, and taking the m-th lowest and m-th highest values, where m = nrank. For example if nrank=1, the upper and lower envelopes are the pointwise maximum and minimum of the simulated values.

デフォルトでは、エンベロープはポイントワイズとして計算され(例えばそれぞれの距離変数rの値)、nsimシミュレートされた値によってソートされ、mがnランクの場合にm-th最小値とm-th最大値をとる。例えば、nランクが1の時は、最大と最小のエンベロープはシミュレートされた値のポイントワイズの最大と最小になる。

The pointwise envelopes are not “confidence bands” for the true value of the function! Rather, they specify the critical points for a Monte Carlo test (Ripley, 1981). The test is constructed by choosing a fixed value of r, and rejecting the null hypothesis if the observed function value lies outside the envelope at this value of r. This test has exact significance level alpha = 2 * nrank/(1 + nsim).

ポイントワイズエンベロープは関数の真の値のための"信頼度帯"ではない!むしろ、それらはモンテカルロテスト(Ripley, 1981)のクリティカルポイントを指示する。このテストはrの固定値を選ぶことで構築され、このr値のエンベロープの外側に、観測された関数値が位置するようであれば、帰無仮説を否定するとになる。このテストは正確な重要度レベルのアルファは2 * nrank/(1 + nsim)である。

simultaneous(サイマルテイニアス):

if global=TRUE, then the envelopes are determined as follows. First we calculate the theoretical mean value of the summary statistic (if we are testing CSR, the theoretical value is supplied by fun; otherwise we perform a separate set of nsim2 simulations, compute the average of all these simulated values, and take this average as an estimate of the theoretical mean value). Then, for each simulation, we compare the simulated curve to the theoretical curve, and compute the maximum absolute difference between them (over the interval of r values specified by ginterval). This gives a deviation value d[i] for each of the nsim simulations. Finally we take the m-th largest of the deviation values, where m=nrank, and call this dcrit. Then the simultaneous envelopes are of the form lo = expected - dcrit and hi = expected + dcrit where expected is either the theoretical mean value theo (if we are testing CSR) or the estimated theoretical value mmean (if we are testing another model). The simultaneous critical envelopes have constant width 2 * dcrit. The simultaneous critical envelopes allow us to perform a different Monte Carlo test (Ripley, 1981). The test rejects the null hypothesis if the graph of the observed function lies outside the envelope at any value of r. This test has exact significance level alpha = nrank/(1 + nsim).

もしglobal=TRUEならば、エンベロープは以下のように定義される。

The return value is an object of class "fv" containing the summary function for the data point pattern, the upper and lower simulation envelopes, and the theoretical expected value (exact or estimated) of the summary function for the model being tested. It can be plotted using plot.fv.

Arguments can be passed to the function fun through .... This makes it possible to select the edge correction used to calculate the summary statistic. See the Examples. Selecting only a single edge correction will make the code run much faster.

If Y is a fitted point process model, and simulate=NULL, then the model is simulated by running the Metropolis-Hastings algorithm rmh. Complete control over this algorithm is provided by the arguments start and control which are passed to rmh.

For simultaneous critical envelopes (global=TRUE) the following options are also useful:

ginterval determines the interval of r values over which the deviation between curves is calculated. It should be a numeric vector of length 2. There is a sensible default (namely, the recommended plotting interval for fun(X)). transform specifies a transformation of the summary function fun that will be carried out before the deviations are computed. It must be an expression object using the symbol . to represent the function value. For example, the conventional way to normalise the K function (Ripley, 1981) is to transform it to the L function L(r) = sqrt(K(r)/pi) and this is implemented by setting transform=expression(sqrt(./pi)). Such transforms are only useful if global=TRUE. It is also possible to extract the summary functions for each of the individual simulated point patterns, by setting saveall=TRUE. Then the return value also has an attribute "savedata" containing all the summary functions for the individual simulated patterns. It is an "fv" object containing functions named sim1, sim2, ... representing the nsim summary functions.

Value

An object of class "fv", see fv.object, which can be plotted directly using plot.fv. Essentially a data frame containing columns

r the vector of values of the argument r at which the summary function fun has been estimated obs values of the summary function for the data point pattern lo lower envelope of simulations hi upper envelope of simulations theo theoretical value of the summary function under CSR (Complete Spatial Randomness, a uniform Poisson point process) if the simulations were generated according to CSR mmean estimated theoretical value of the summary function, computed by averaging simulated values, if the simulations were not generated according to CSR. Additionally, if saveall=TRUE, the return value has an attribute "savedata" which contains the summary functions computed for each of the nsim simulated patterns.

Warning

An error may be generated if one of the simulations produces a point pattern that is empty, or is otherwise unacceptable to the function fun.


渡邉

SDA4PPの該当ページは以下の通りである。

  • Ripley's K and L Function
  • Local Ripley's K and L

和訳を行なう前に関連書籍、関連ホームページを参照したが、 実際のデータで解析を試みるまでに至っていない。肝心の訳出については少しだけ。

Ripley's K and L Function、Local Ripley's K and Lのいずれに関しても、 L関数については勉強会後に訳出したので、その内容を記す。

K関数については、順次このページにアップする。


Ripley's K and L Function (リプリーのK関数およびL関数)
  • K-function(K関数)

疾病や犯罪などの発生データの空間パターンを分析するための式である。

一定範囲内のポイントデータにおいて認められる空間依存(クラスタリング、分散)を集計する。

フィーチャまたはそれに関連する値が、ある定められた範囲内での距離において、統計的に有意な値を示すかどうか判断する。


  • Description(概要)

ある一定範囲のポイントパターンから、Ripleyの通分された二次モーメントの関数K(r)を推測する。


  • Usage(用法)

Kest(X, ..., r=NULL, breaks=NULL, correction=c("border", "isotropic", "Ripley", "translate"), nlarge=3000)


  • Arguments(引数)

X observeされたポイントパターンに由来するK(r)の推測値が算出される。"ppp"クラス、あるいはas.pppで容認可能な幾つかのフォーマットにおけるデータのオブジェクトである。

... 無視できる。

r オプションである。evaluateされるべきK(r)の引数rの値のベクトル。デフォルトの値にしておく。

breaks オプションである。引数rに対する選択肢にあたる。通常はユーザに使用されることはない。

correction オプションである。"none"、"border"、"bord.modif"、"isotropic"、"Ripley"、"translate"などのオプションの選択肢に含まれる固有のベクトルである。

適用可能な傾き補正について明示する。

nlarge オプションである。効率的なしきい値である。もしポイントの数がnlargeを超えた場合、高速なアルゴリズムが使われ、境界値の補正のみが演算される。


  • Details(詳細)

定常的な点過程XのK関数(「リプリーのK関数」や「通分された二次モーメントの関数」などさまざまに呼ぶ)は、

lambda(編注:ラムダ計算?) K(r)が代表的なランダムポイントであるXからの距離r以内における、別のランダムポイントの期待値に等しいと定義される。

これらのlambdaはその過程の頻度であり、すなわち、範囲のユニットごとのXの期待値である。

K関数はXの二次モーメントの特性によって導出された。


(以下、現在訳出中)


  • L-function(L関数)

上記のK関数の式は2次関数で構成されており、微分して1次関数の形で表した式がL関数になる。

なおK関数については、このリプリーの式以外にも複数存在しており、それぞれのK関数においてL関数が導出される傾向がある。

以下、訳出した内容を記す。


  • Description(概要)

空間的ポイントパターンを求めるため、リプリーのL関数の推測値を計算する。


  • Usage(用法)

 Lest(...)


  • Arguments(引数)

引数はK関数の推測値としてKestを適用する。


  • Details(詳細)

このコマンドは空間的ポイントパターンを求めるため、リプリーのL関数の推測値を計算する。

L関数はリプリーのK関数の変形である。

L(r)=sqrt(K(r)/pi)

K(r)はK関数である。リプリーのK関数についての情報は、Kestのページを参照すること。

Lestコマンドは、最初にK関数の推測値を計算するためにKestを呼び出す。そして微分を適用する。

完璧にランダムな(定常ポアソンの)ポイントパターンであるとき、L関数の理論値はL(r)=rである。

平方根はまた、推定を行なう際の偏差を変動させないようにする効果をもつ。

それゆえLは、エンベロープシミュレーションや仮説検定のテストに用いるのに都合がよくなる。


  • Value(値)

fvクラスは、plot.fvを使用して直接プロットを行なうことができるオブジェクトであり、fv.objectに詳しい。

データフレームは本質的に以下のカラムを含む。

r 推測された関数Lにおいて、引数のrの値のベクトル

theo 定常的なポアソン関数の理論値L(r)=r

選択された傾き補正によって、"border"、"bord.modif"、"iso"、あるいは"trans"などと名付けられたカラムを伴う。

これらのカラムは、傾き補正が取得された関数L(r)の推測値を含む。


  • Examples(例)

data(cells)

L <- Lest(cells)

plot(L)

plot(L, main="L function for cells")

Local Ripley's K and L (リプリーの局所的なK関数およびL関数)

Getis and Franklin(1987)によって定義される。

K関数は空間依存を求めるための範囲設定に配慮する必要があり、近傍の密度関数を算出する式が提示された。

空間的なポイントパターンXが与えられたとき、L[i](r) = sqrt( (a/((n-1)* pi)) * sum[j] e[i,j])が成立する。

注意事項

今後の方針

  • SDA4PPサイトの和訳は最低限行なう

次回の予定

1月14日(金)か17日(月)を第一候補。